Skip to main content

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.raveculture.xyz/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": "solo"
}
FieldTypeDescription
validbooleanWhether the token is valid
planstringPlan tier assigned to the invite. Currently always "solo".
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 email field was removed from the verify response. The invite codes table does not store an email column. If you previously relied on this field, use a separate user lookup after verification.

Errors

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

List invites (admin)

GET /api/admin/invites
Returns all invites with summary counts. Requires an authenticated session with an admin email address.

Response

{
  "invites": [
    {
      "code": "a1b2c3d4...64 hex characters",
      "email": "invitee@example.com",
      "createdAt": "2026-03-25T21:00:00.000Z",
      "status": "active"
    }
  ],
  "total": 1,
  "active": 1
}
FieldTypeDescription
invitesarrayList of all invites
invites[].codestring64-character hex invite token
invites[].emailstringEmail the invite was created for
invites[].createdAtstringISO 8601 creation timestamp
invites[].usedAtstring | undefinedISO 8601 timestamp when the invite was used
invites[].statusstringOne of active, used, or expired
invites[].userIdstring | undefinedUser ID of the person who redeemed the invite
totalnumberTotal number of invites
activenumberNumber of currently active invites

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. Requires an authenticated session with an admin email address.

Request body

FieldTypeRequiredDescription
emailstringYesEmail address to associate with the invite

Response

{
  "success": true,
  "code": "a1b2c3d4...64 hex characters",
  "email": "invitee@example.com",
  "inviteUrl": "https://agentbot.raveculture.xyz/invite?token=a1b2c3d4..."
}
FieldTypeDescription
successbooleanWhether the invite was created
codestring64-character hex invite token
emailstringEmail the invite was created for
inviteUrlstringFull URL the recipient can use to accept the invite

Errors

CodeDescription
400Email is missing
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.