Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.agentbot.raveculture.xyz/llms.txt

Use this file to discover all available pages before exploring further.

Invite API

Create and verify invite tokens for gating access to the Agentbot platform.
Invite tokens are 64-character hex strings generated from crypto.randomBytes(32). The older 12-character code format is deprecated — see legacy format below.

Authentication

EndpointAuth required
POST /api/inviteSession (any authenticated user)
POST /api/invites/verifyNone
GET /api/admin/invitesSession (admin only)
POST /api/admin/invitesSession (admin only)

Create invite

POST /api/invite
Creates an invite token linked to your account. Requires an authenticated session.

Request body

FieldTypeRequiredDescription
namestringYesDisplay name for the invite recipient. Validated against injection patterns.

Response

{
  "success": true,
  "inviteUrl": "https://agentbot.sh/invite?token=abc123...&name=Alice",
  "token": "a1b2c3d4...64 hex characters"
}
FieldTypeDescription
successbooleanWhether the invite was created
inviteUrlstringFull URL the recipient can use to accept the invite
tokenstring64-character hex token

Errors

CodeDescription
400Name is missing or contains invalid characters
401Not authenticated
404User not found
500Failed to create invite

Verify invite

POST /api/invites/verify
Verifies an invite token and returns invite details. No authentication required. Tokens must be in the 64-character hex format.

Request body

FieldTypeRequiredDescription
tokenstringYes64-character hex invite token

Response (valid)

{
  "valid": true,
  "plan": "headliner",
  "audience": "headliner",
  "email": "invitee@example.com"
}
FieldTypeDescription
validbooleanWhether the token is valid
planstringPlan tier assigned to the invite. Returns "headliner" when the invite audience is headliner, otherwise "solo".
audiencestring | undefinedInvite audience tier: headliner, guest, or partner. Omitted when the invite was verified by token format alone.
emailstring | null | undefinedEmail associated with the invite, when stored. Omitted when the invite was verified by token format alone.
notestring | undefinedPresent only when the invite was verified by token format alone (database model pending). Omitted when the invite was verified against the database.
The branded headliner landing page at /basefm/headliner calls this endpoint to confirm the invite before pointing DJs to redemption and the DJ stream panel. It reads audience and email from the response to display issued-to details.

Errors

CodeDescription
400Token is missing, not a string, or not in valid 64-character hex format
404Invite not found
410Invite has already been used or has expired
500Verification failed

List invites (admin)

GET /api/admin/invites
Returns the most recent invites with summary counts. Requires an authenticated session with an admin email address. Records are persisted in the database, so invites survive process restarts and remain auditable.

Response

{
  "invites": [
    {
      "code": "a1b2c3d4...64 hex characters",
      "email": "invitee@example.com",
      "audience": "headliner",
      "createdAt": "2026-03-25T21:00:00.000Z",
      "expiresAt": "2026-06-25T21:00:00.000Z",
      "status": "active"
    }
  ],
  "total": 1,
  "active": 1
}
FieldTypeDescription
invitesarrayList of invites, ordered by creation time descending. Up to 200 entries.
invites[].codestring64-character hex invite token
invites[].emailstring | nullEmail the invite was created for
invites[].audiencestringInvite audience tier: headliner, guest, or partner
invites[].createdAtstringISO 8601 creation timestamp
invites[].usedAtstring | undefinedISO 8601 timestamp when the invite was redeemed
invites[].expiresAtstring | undefinedISO 8601 expiration timestamp. Omitted if the invite has no expiry.
invites[].statusstringOne of active, used, or expired. An invite is expired when expiresAt has passed and the invite has not been used.
totalnumberTotal number of invites returned
activenumberNumber of invites with status active

Errors

CodeDescription
403Not authorized (requires admin)
500Failed to retrieve invites

Create invite (admin)

POST /api/admin/invites
Creates an invite for a specific email address and persists it to the database. Requires an authenticated session with an admin email address.

Request body

FieldTypeRequiredDescription
emailstringYesEmail address to associate with the invite. Must be a valid email format; lower-cased on save.
audiencestringNoInvite audience tier. One of headliner, guest, or partner. Defaults to headliner.
expiresAtstringNoISO 8601 timestamp at which the invite expires. Omit for an invite with no expiry.

Response

{
  "success": true,
  "invite": {
    "code": "a1b2c3d4...64 hex characters",
    "email": "invitee@example.com",
    "audience": "headliner",
    "createdAt": "2026-03-25T21:00:00.000Z",
    "expiresAt": "2026-06-25T21:00:00.000Z",
    "status": "active"
  },
  "code": "a1b2c3d4...64 hex characters",
  "email": "invitee@example.com",
  "audience": "headliner",
  "inviteUrl": "https://agentbot.sh/invite?token=a1b2c3d4..."
}
Returns HTTP 201 Created on success.
FieldTypeDescription
successbooleanWhether the invite was created
inviteobjectThe created invite record. Same shape as items in the list invites response.
codestring64-character hex invite token (mirrors invite.code)
emailstringEmail the invite was created for (mirrors invite.email)
audiencestringInvite audience tier (mirrors invite.audience)
inviteUrlstringFull URL the recipient can use to accept the invite

Errors

CodeDescription
400Email is missing, not a valid email address, audience is not one of the allowed values, or expiresAt is not a valid ISO 8601 date
403Not authorized (requires admin)
500Failed to create invite

Legacy invite format

The previous invite system used 12-character hex codes with POST /api/invite/generate and POST /api/invite/validate. These endpoints are deprecated. Migrate to the new endpoints above.

Deprecated: generate invite code

POST /api/invite/generate
Previously generated a 12-character hex invite code. Replaced by POST /api/invite (session auth) and POST /api/admin/invites (admin session auth).

Deprecated: validate invite code

POST /api/invite/validate
Previously validated and consumed a 12-character invite code. Replaced by POST /api/invites/verify, which accepts 64-character hex tokens and returns valid and plan fields.