Dashboard
APISubscription Bot Access Token Redemption 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_•••'

Redeem a Subscription Bot Access Token for a Member

Apply a code to a named member of your Telegram subscription bot or Discord subscription bot through an authorized admin or project integration.

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

Authorization

Bearer TokenRequired

Requires memberships:add for a human admin. Restricted project API keys need access-tokens:redeem; access-tokens:create alone is insufficient.

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

codestringrequired

The access code issued for this project.

user_idstringrequired

Platform user ID as a string, or a user UUID linked to exactly one identity on this project's platform. JSON numbers are rejected.

Claim behavior and limits

user_id must be a string containing a platform user ID or a user UUID linked to exactly one identity on this project's platform. JSON numbers are rejected. An ambiguous UUID returns 409 AMBIGUOUS_PLATFORM_IDENTITY; an unlinked UUID returns 403 PLATFORM_LINK_REQUIRED.

Platform IDs are not checked remotely against Telegram or Discord. A mistyped ID consumes the code for that ID. Check the recipient before sending. This endpoint allows 60 requests per minute per acting admin or key and project.

Response fields

FieldMeaning
access_token_id, membership_idIdentifiers for the token and resulting membership.
membership_start_date, membership_end_dateUnix milliseconds; end date is null for lifetime access.
already_claimedThis code already granted access to this member. No second extension occurred.
fulfillment_pendingPlatform access delivery is pending. A membership is not itself a channel join.
billing_pendingWhen true, billing must settle before additional access is granted; response status is 202.

Existing access to the same plan is extended according to its membership rules. Recurring billing may need provider confirmation before the extension is granted. With 202, the returned dates describe existing access, not a completed new grant.

Retry the same code for the same member to recover an uncertain or pending result. A completed retry returns the original receipt with already_claimed: true. A different member receives 404. Wait for an in-flight request to finish before retrying; concurrent attempts can temporarily return 404 or 409.

For billing_pending, retry the same request or list by status to check progress. For fulfillment_pending, resolve platform access prerequisites, such as starting the Telegram bot or joining the configured Discord server, then retry the same code. Delivery can repeat after a lost acknowledgement, but retries never grant the duration twice.

If sending Idempotency-Key, retain the same key and request body for retries. Receipt recovery still uses the same code and member.

For a signed-in member redeeming their own code, use Claim Token. See the Access Tokens overview for the issue-and-activate lifecycle.

Last updated: