Authenticate with the FBL API

Learn how to obtain your FBL API token from the dashboard, pass it in the Authorization header, and handle authentication errors.

Every request to the FBL API requires authentication via a token. You obtain this token from your bot's dashboard settings and include it in the Authorization header of each request.

i

Keep your API token secret. Do not commit it to source control or expose it in client-side code. Use environment variables to manage it securely.

Get your API token

1

Open your bot's dashboard

Navigate to your bot's edit page on FBL and open the API tab:
https://fbl.gg/bots/:yourbotid/edit/api
2

Generate your token

Click Generate to create your FBL API token. The full token is shown once — copy it immediately and store it securely. If you lose it, you can regenerate a new one at any time (the old token will stop working).

Authenticate requests

Pass your token directly in the Authorization header without the Bearer prefix:

Authorization: your-fbl-token-here

For example, using curl:

curl https://fbl.gg/api/v1/bots/:botid \
  -H "Authorization: your-fbl-token-here"

Error responses

The FBL API returns errors in the RFC 7807 application/problem+json format. Every error response includes a structured body describing the problem:

type ProblemDetails = {
  type: string;
  title: string;
  status: HTTPStatusCode;
  detail: string;
};

A 401 Unauthorized response, for example, will include a type field identifying the error class, a human-readable title, the HTTP status code, and a detail message explaining the specific issue.