# Bot API token

:::warning
**Bot access codes are deprecated.** Use a Bot API token everywhere you used an access code: in scripts, plugins, devices and HTTP API calls. A token is a drop-in replacement, so it goes wherever the access code went.

:::

Bot API tokens authenticate your bot with scripts, plugins and devices. They work like the [Security code](/doc/4ff9d6ec-51cf-425d-af00-f58ee8893efe) for groups, but control access to your personal bot.

## Creating a Bot API token


1. Log in to your account at <https://mysmartbots.com>.
2. In the menu on the left, click 'Your personal bots' and then 'manage bot'.
3. Click **Security > Access code & API tokens**.
4. Click **New token**, enter a **Name** and choose an **Expiration**, or **Never expires**.
5. To stop the old access code working, tick **Revoke legacy access code (recommended)**.
6. Click **Create token** and copy the token straight away. It is only shown once.

Tokens start with `bct_`. You can **Rotate**, **Expire** or **Delete** a token on the same page at any time.

 ![](https://nyc3.digitaloceanspaces.com/smartbots-docs/uploads/20adbcf8-a916-46eb-b77b-ad6944665550/3d0fa4fc-044d-43c2-a38f-f305c9c1c8fb/API_Token_Setup.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=DO801JV4MUMY3YAEJCWC%2F20261113%2Fnyc3%2Fs3%2Faws4_request&X-Amz-Date=20261113T140000Z&X-Amz-Expires=86400&X-Amz-Signature=d71c0f9b6bbad1424baafcde9acfce73fe27bf9b9de96ad840c74f11f3ec88f9&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject " =700x560")

## Legacy bot access code

Bot access codes still work for now, but they are deprecated. Replace them with Bot API tokens.


1. Log in to your account at <https://mysmartbots.com>.
2. In the menu on the left, click 'Personal bots' and then 'manage' next to the bot.  
   ![](https://nyc3.digitaloceanspaces.com/smartbots-docs/uploads/20adbcf8-a916-46eb-b77b-ad6944665550/f49030dc-5773-4d0f-85f3-36a453adf687/image.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=DO801JV4MUMY3YAEJCWC%2F20261113%2Fnyc3%2Fs3%2Faws4_request&X-Amz-Date=20261113T140000Z&X-Amz-Expires=86400&X-Amz-Signature=e6ecef0022dc4d3e23ed8a36c9e4414639909b0d2504e1f867f2be50fd35241b&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject " =383x375")
3. Set or change the bot access code:

 ![](https://nyc3.digitaloceanspaces.com/smartbots-docs/uploads/20adbcf8-a916-46eb-b77b-ad6944665550/648b453c-871d-4a75-99cd-ea0bfa7ab10b/image.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=DO801JV4MUMY3YAEJCWC%2F20261113%2Fnyc3%2Fs3%2Faws4_request&X-Amz-Date=20261113T140000Z&X-Amz-Expires=86400&X-Amz-Signature=57ac9a457839615b615b8424dc975e57111a51d51001bee4aaad31be31a18f89&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject " =422x252")