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

Create invite

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

Request body

Response

Errors

Verify invite

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

Request body

Response (valid)

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

List invites (admin)

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

Errors

Create invite (admin)

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

Response

Returns HTTP 201 Created on success.

Errors


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

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

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.