Create an invitation or referral link with an optional credit amount.
x-api-key: YOUR_API_KEY orAuthorization: Bearer YOUR_API_KEYContent-Type: application/jsonx-api-key: YOUR_API_KEY (required for API key auth)| Field | Type | Required | Description |
|---|---|---|---|
type | string | No | Either "invitation" or "referralLink". Defaults to "invitation". |
amount | number | No | Credit amount to include with the invitation. Must be non-negative. Ignored for referral links (always 0). |
currency | string | No | Currency for the amount. Required if amount > 0. Use "USD" for US dollars. |
recipientName | string | No | Name of the invitation recipient. |
issuerName | string | No | Name of the person sending the invitation. |
issuerNote | string | No | Personal note to include with the invitation. |
| Field | Type | Description |
|---|---|---|
insertId | string | Database ID of the created invitation. |
redeemCode | string | Unique code the recipient uses to redeem the invitation. |
url | string | Full URL to share with the recipient. |
type | string | The invitation type ("invitation" or "referralLink"). |
amount | number | Credit amount attached to this invitation. |
currency | string | null | Currency of the amount, or null if amount is 0 (recipient chooses currency). |
| Status | Body | Description |
|---|---|---|
| 400 | "Invalid request body" | Request body is not valid JSON. |
| 400 | "InvalidAmount" | The provided amount is negative. |
| 400 | "InsufficientBalance" | Your account balance is insufficient for the specified amount. |
| 401 | "Invalid session" | Session is missing required data. |
| 401 | "Unable to get session" | Authentication failed. |
| 500 | "Failed to create invitation" | Server error during invitation creation. |
amount is 0 or not provided, the currency in the response is null, allowing the recipient to choose their preferred currency upon redemption.redeemCode uses a URL-safe alphabet that avoids ambiguous characters (no 0, O, 1, l).Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Invitation creation parameters
Either "invitation" or "referralLink". Defaults to "invitation".
invitation, referralLink Credit amount to include with the invitation. Must be non-negative. Ignored for referral links (always 0).
x >= 0Currency for the amount. Required if amount > 0.
Name of the invitation recipient.
Name of the person sending the invitation.
Personal note to include with the invitation.
Invitation created
Database ID of the created invitation.
Unique code the recipient uses to redeem the invitation.
Full URL to share with the recipient.
The invitation type.
invitation, referralLink Credit amount attached to this invitation.
Currency of the amount, or null if amount is 0.