Dashboard
APISubscription Bot Access Token Preparation API
api.botsubscription.com
GET/v1/endpoint
AuthenticationBearer
Token
Stays in this tab. Required for this endpoint — the value below is what gets sent.
Mock
curl --request GET \
  --url https://api.botsubscription.com/v1/endpoint \
  --header 'Authorization: Bearer sk_live_•••'

Prepare Subscription Bot Access Tokens

Prepare inactive membership codes for your Telegram subscription bot or Discord subscription bot. Save the returned codes and ticket before activating the batch.

POST/v2/projects/{project_id}/access-tokens

Authorization

Bearer TokenRequired

Requires memberships:add for a human admin. Restricted project API keys need access-tokens:create.

Path Parameters

project_idstringrequired

The UUID of the project.

Headers

Idempotency-Keystring

Use a unique key for each distinct action; retain it with the unchanged request body when retrying.

Request Body

plan_idstringrequired

Plan UUID from the plan list API.

duration_secondsinteger | nullrequired

Required. Use 1–3,153,600,000 seconds, or null for calendar months or lifetime access.

duration_monthsinteger | null

Calendar months, 1–1,200. Send duration_seconds: null when using this field.

countintegerDefault: 1

Number of codes, from 1 to 100.

notestring

Optional batch label, normalized to one line, at most 100 characters.

Behavior and recovery

This prepares an inactive batch and returns 201. Save the response before activating it.

Both duration fields null means lifetime access. Two non-null durations are rejected. Durations apply when the code is claimed, not when it is prepared. Unknown body fields are rejected.

Response data contains:

  • tokens: array of objects with access_token_id and plaintext code.
  • activation_token: the private ticket for this exact batch and preparing principal.
  • expires_at: ticket expiration as Unix milliseconds, 30 minutes after preparation.
  • Each token can also include claim_url for a Telegram project when the current bot handle can be verified. It is omitted otherwise, including for Discord.

Successful preparation responses are not replayed. Reusing a completed Idempotency-Key returns 409 IDEMPOTENCY_RESPONSE_NOT_REPLAYABLE. If the response is lost, preparing another batch cannot orphan usable codes: the lost draft was never activated.

Next, activate the saved batch. Find the plan UUID through List Plans.

Last updated: