Skip to main content
Register a new distribution contract record for a token. This creates the contract record in Magna only — no on-chain transaction is created. Use Token Contracts first to check whether a contract already exists. Route: POST /api/external/v1/contracts/create

Headers

HeaderRequiredDescription
Content-TypeYesMust be application/json
x-magna-api-tokenYesYour Magna API token

Body parameters

FieldTypeRequiredDescription
tokenIdstring (uuid)YesThe token this contract belongs to
contractTypeenumYesType of distribution contract (see below)
namestringNoDisplay name (e.g. "Main Vesting Contract")
contractType is commonly one of:
ValueDescription
AIRLOCKStandard linear unlock + vesting contract
AIRLOCK_MERKLE_VESTERMerkle-tree based vesting (large recipient lists)
AIRDROPSimple airdrop contract
CUSTODYCustody / escrow contract
STAKINGStaking contract

Request example

curl -X POST https://app.magna.so/api/external/v1/contracts/create \
-H 'Content-Type: application/json' \
-H 'x-magna-api-token: YOUR_API_KEY' \
-d '{
  "tokenId": "tok...uuid",
  "contractType": "AIRLOCK",
  "name": "Main Vesting Contract"
}'

Response example

{
  "id": "c1...uuid",
  "name": "Main Vesting Contract",
  "type": "AIRLOCK",
  "tokenId": "tok...uuid",
  "address": null,
  "createdAt": "2024-04-15T21:26:21.000Z"
}