Your
client_id and client_secret are not pre-issued static keys. They are returned dynamically in the response body when you call the login endpoint (POST /api/v1/login). You must perform a login call first to obtain them before using the OAuth2 Password Grant flow.Method 1: Bearer Token (Recommended for Agentic and MCP Clients)
The Bearer Token method is the simplest and most direct way to authenticate. You exchange your Botsify email and password for a short-livedaccess_token, then include that token in the Authorization header of every subsequent API request.
This method is recommended for server-side integrations, agentic clients, and MCP (Model Context Protocol) tooling because the token is easy to pass in a header and works across all API endpoints.
Step 1 — Obtain an access token
Step 2 — Use the token in requests
Pass the token in theAuthorization header using the Bearer scheme:
Method 2: OAuth2 Password Grant
Botsify supports the OAuth2 Resource Owner Password Credentials Grant (grant_type=password). This flow is useful when you are building an application that manages tokens on behalf of your users, or when you need OAuth2-compliant token handling (e.g. automatic refresh logic).
The
client_id and client_secret required by this flow come from the login API response described above in Method 1. Call POST /api/v1/login first to retrieve them, then use those values here.Request
access_token exactly as described in Method 1 — pass it in the Authorization: Bearer header.
Method 3: API Key
Every bot you create has its own API Key (also referred to asapikey in the API). The API Key is scoped to a single bot and is used primarily for bot-level operations such as sending messages, managing user attributes, and retrieving conversation history for that specific bot.
You can pass the API Key in one of two ways depending on the endpoint:
As a JSON body field:
The bot API Key is different from your account-level credentials. It is tied to a specific bot and does not grant access to account management endpoints. You can find your bot’s API Key in the Botsify dashboard under your bot’s settings, or in the response when you create a bot.
