---
title: "POST /invitations/create"
method: POST
path: "/invitations/create"
---

# POST /invitations/create

`POST /invitations/create`

Create an invitation or referral link with an optional credit amount.

## Request body

- InvitationCreateRequest
  - `type` 'invitation' | 'referralLink' — Either "invitation" or "referralLink". Defaults to "invitation".
  - `amount` number — Credit amount to include with the invitation. Must be non-negative. Ignored for referral links (always 0).
  - `currency` string — Currency for the amount. Required if amount > 0.
  - `recipientName` string — Name of the invitation recipient.
  - `issuerName` string — Name of the person sending the invitation.
  - `issuerNote` string — Personal note to include with the invitation.

## Response `200`

Invitation created

- InvitationCreateResponse
  - `insertId` string, required — Database ID of the created invitation.
  - `redeemCode` string, required — Unique code the recipient uses to redeem the invitation.
  - `url` string, uri, required — Full URL to share with the recipient.
  - `type` 'invitation' | 'referralLink', required — The invitation type.
  - `amount` number, required — Credit amount attached to this invitation.
  - `currency` string, nullable, required — Currency of the amount, or null if amount is 0.

## Other responses

- `400` — Bad Request - Invalid request body, invalid amount, or insufficient balance
- `401` — Unauthorized - Invalid session or unable to get session
- `500` — Internal Server Error - Failed to create invitation

---

[API](https://skmtc.dev/nano-gpt/apis/nanogpt-api.md) · [All operations](https://skmtc.dev/nano-gpt/apis/nanogpt-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/nano-gpt/nanogpt-api/revisions/584e96d146b0/schema)
