Endpoint
Headers
| Header | Required | Description |
|---|---|---|
Content-Type | Yes | Must be application/json |
x-magna-api-token | Yes | Your Magna API token |
Request Body
Required Fields
| Field | Type | Description |
|---|---|---|
amount | string (decimal) | The allocation amount (must be positive) |
contractId | string (uuid) | UUID of the contract to associate with this allocation |
tokenId | string (uuid) | UUID of the token for this allocation |
category | string | Category name for organizing allocations |
stakeholder | object | stakeholder information object |
| Field | Type | Description |
|---|---|---|
stakeholder.name | string | Full name of the stakeholder |
stakeholder.email | string (email) | Valid email address of the stakeholder |
stakeholder.xHandle | string | X (Twitter) handle of the stakeholder |
stakeholder.employeeNumber | string | Employee number or ID |
Optional Fields
Basic Information| Field | Type | Description |
|---|---|---|
description | string | null | Description of the allocation |
| Field | Type | Description |
|---|---|---|
unlockScheduleId | string (uuid) | UUID of the unlock schedule to apply |
unlockStartAt | string (ISO date) | When the unlock period should start |
vestingScheduleId | string (uuid) | UUID of the vesting schedule to apply |
vestingStartAt | string (ISO date) | When the vesting period should start |
releaseMode | string (enum) | How tokens should be released (e.g., “LINEAR”, “CLIFF”) |
| Field | Type | Description |
|---|---|---|
receivedOffMagna | string (decimal) | Amount already received outside of Magna (must be positive) |
cancellable | boolean | Whether the allocation can be cancelled (defaults to true) |
customAttributes | array | Array of custom key-value pairs for additional metadata |
customAttributes[].key | string | The attribute key |
customAttributes[].value | string | The attribute value |
walletAddress | string | Recipient’s wallet address (will be associated with the token’s blockchain platform) |
Example Request
Example Response
Validation Rules
amountmust be a positive decimal numbercontractIdandtokenIdmust be valid UUIDsstakeholder.emailmust be a valid email format if providedunlockScheduleIdandvestingScheduleIdmust be valid UUIDs if provided- Either
unlockScheduleIdorvestingScheduleIdmust be provided receivedOffMagnamust be a positive decimal if provided- Dates must be in ISO 8601 format
- The token specified by
tokenIdmust belong to the project associated with your API token
Important Notes
- Category Creation: If the specified category doesn’t exist, it will be automatically created
- Stakeholder Creation: A new stakeholder record will be created with the provided information
- Wallet Association: If a wallet address is provided, it will be associated with the blockchain platform of the token
- Default Values:
cancellabledefaults totrueif not specified - Custody Type: All allocations created via API use contract custody type
Error Responses
- 400 Bad Request: Invalid request body, missing required fields, or validation errors
- 401 Unauthorized: Invalid or missing API token, or token doesn’t belong to the specified project
- 404 Not Found: Contract ID, token ID, or schedule IDs don’t exist
- 422 Unprocessable Entity: Validation errors (e.g., invalid email format, negative amounts)
- 413 Payload Too Large: Request body exceeds 1MB limit