Create an access token
POST/v1/bot:bot_id/:api_key/members/accessToken
Create a new access token for a member to activate memberships without payment. For more information on access tokens, please check out our help article.
Request
Responses
- 201
- 400
- 401
- 404
The access token has been successfully created.
The affiliate_id provided is invalid. It must start with a letter, be at least 3 characters long, no more than 12, consisting of letters and numbers only, and be unique (not used by anyone else).
You haven't installed a payment method in your bot, or it is in test mode. You can install one by opening Telegram, open your bot, type /settings -> Test mode and switch it off. Then, go to /settings -> Payment Methods and install a payment method. Another reason, applicable if you're on the Pay As You Go 7% billing plan, could be a [violation of our Acceptable Use Policy](https://docs.tgmembership.com/tgmembership/troubleshooting/access-token-abuse).
The member_id provided is invalid, or belongs to someone who hasn't previously interacted with the bot, or the person has blocked the bot.