Skip to Content
GuidesDevelopersResources
API actions

Authenticate the calls of an API action

Choose how Botello identifies itself to your API, from a Bearer token to OAuth 2, with encrypted secrets bound to the domain.

On requestThe Botello team turns this feature on for your workspace. Contact us to get it.
Plans
All plans
Roles
Owner, Admin
In the admin
Chatbot › Actions › Custom API actions

An action’s Authentication section defines how Botello identifies itself to your API. Choose a type and enter the secret: Botello encrypts it, never shows it again, never shows it to the assistant, and binds it to the domain of the URL. That way, nobody can redirect your key to another server by editing the action.

Best for

Any API that requires a key, a token, a username and password, or a server-to-server OAuth 2 flow (ERP, CRM, SaaS tools).

Before you start

  • You have an action, or you are creating one: see Create an API action.
  • You have the secret issued by your API: ideally a key dedicated to Botello, with minimum permissions (read-only if the action only reads).

Choose the authentication

Open the action

In ChatbotActionsCustom API actions, click Edit on the action, or create one.

Choose the type

In Authentication, choose the type your API expects (see the table below).

Enter the secret

Fill in the fields for the chosen type, then click Save. Once saved, the secret field shows “Value stored (leave empty to keep it)”: leave it empty to keep the value, or type a new one to replace it.

Test

Click Test. Under What Botello sent, check that the expected header is in the list of headers. Values are never displayed.

Authentication types

Type (admin label)Technical valueFieldsWhat Botello sends
Nonenone—Nothing.
Bearer tokenbearerTokenAuthorization: Bearer <token>
Username and password (Basic)basicUsername, PasswordAuthorization: Basic base64(username:password)
API keyapi_keySent in (A header or The URL), Name, KeyHeader <Name>: <key>, or parameter ?<Name>=<key> appended to the URL
OAuth 2 (client credentials)oauth2_client_credentialsToken URL, Client ID, Client secret, Scope (optional), Audience (optional), Client credentials sent inAuthorization: Bearer <obtained token>

Any type other than None requires its secret: without it, saving is refused (“Complete the authentication (the secret is required).”).

An API key name: letters, digits, _, . and -, 64 characters at most. Reserved names (Host, Cookie, X-Botello-…) are refused.

OAuth 2 (client credentials)

For an API that issues short-lived tokens from a client ID and a client secret (RFC 6749, “client credentials” flow):

  1. Before the call, Botello requests a token from the Token URL: a POST request in application/x-www-form-urlencoded, with grant_type=client_credentials, plus the scope and audience if filled in. The client authenticates according to Client credentials sent in:
    • Header (Basic), the default: Authorization: Basic base64(client_id:client_secret), each part form-encoded;
    • Request body: client_id and client_secret in the form body, for token servers that refuse the Basic header.
  2. Your token server answers in JSON with access_token and, preferably, expires_in.
  3. Botello keeps the token in memory until it expires minus 60 seconds (5 minutes if expires_in is missing), then requests a new one.
  4. If your API answers 401, Botello discards the token, requests a new one and retries once.

The token request has the same protections as the call: public address only, no redirects, response of 64 KB at most, 8-second timeout. If the token cannot be obtained, the call is not made and the test shows Authentication refused (OAuth token).

Editing the action (any field) clears the token from memory. Changing the Token URL requires you to enter the Client secret again: a secret is never sent to a different token server.

Audience (optional) is for token servers that require it to know which API the token is for (Auth0, for example). Leave it empty otherwise.

Encrypted secrets bound to the domain

  • Secrets (token, password, key, client secret, headers marked Secret) are encrypted with AES-256-GCM when saved. They are only decrypted in memory, at call time.
  • They are never sent back to the admin, never written to logs, never shown to the assistant. In the test, a key passed in the URL is masked as •••.
  • They are bound to the domain of the URL at the time you enter them.

Changing domain means re-entering the secrets

If you change an action’s URL to another domain (for example from api.exemple.ch to api.autre.ch), saving is refused until you have entered each secret again, or removed the secret headers. This is deliberate: a team member allowed to edit the action cannot send your key to their own server. Changing only the path, on the same domain, requires nothing.

Examples

An API that expects a key in the X-Api-Key header:

Configuration
Authentication : API key
Sent in        : A header
Name           : X-Api-Key
Key            : sk_live_…   (encrypted when saved)

Request sent by Botello:

Request
GET /v1/stock?sku=MC-40-BLK HTTP/1.1
Host: api.exemple.ch
Accept: application/json
User-Agent: Botello-Actions/2.0
X-Api-Key: sk_live_…
X-Botello-Timestamp: 1791364200
X-Botello-Request-Id: req_6f0c2b7e9a1d4c3b8e5f7a2d1c0b9e8f
X-Botello-Signature: sha256=…
Do

Create a key reserved for Botello in your system, read-only if the action only reads. You can revoke it without affecting anything else.

Avoid

Reuse your store’s admin key, or put the key in a non-secret header: it would be visible in the admin.

Troubleshooting

What you seeLikely causeFix
“Complete the authentication (the secret is required).”Type chosen without a secretEnter the token, password, key or client secret
Saving refused after a URL changeThe domain changed and the action has secretsEnter each secret again, or remove the secret headers
Authentication refused (OAuth token)The token URL is wrong, the client secret is wrong, or the response has no access_tokenCheck the token URL, the Client ID, the secret, the scope and the audience. If your server refuses the Basic header, choose Request body
HTTP 401 in the testYour API refuses the keyCheck the key and where it is sent (header or URL)
Invalid configurationA secret is missing or cannot be readEnter the secret again

Frequently asked questions

Learn more

Was this page helpful?
Checked against the product on 14 November 2026 Suggest a fix

On this page