FNLB Devs

Developer Portal

Getting Started

Authentication

Every protected route needs an Authorization header. The API accepts three kinds of token. A route's page in the API reference lists which kinds it accepts.

TokenStarts withUse it when
API tokenFNLB_Your own bots and account, from a server you control.
OAuth2 access tokenFNLBOA2AT_A user approved your application.
Sessionneither prefixYou are signed in here. Try request on a reference page sends it for you.

Create an API token from the FNLB app or the web dashboard at app.fnlb.net/account. Create an OAuth2 client from Applications.

Where each token works

API api.fnlb.net/v1Gateway gateway.fnlb.net/v1SDK token / apiToken
API token FNLB_Routes that list API tokenOnly if the account has developer accessYes
OAuth2 FNLBOA2AT_Routes that list that scopeNeeds bots.readNeeds bots.run, categories.read, and bots.read
SessionTry request while you are signed inNot acceptedNo

The gateway always wants your account id in FNLB_BUCKET_ID. Read it from GET /user. The REST interface shows the query on a real URL.

Send the token as a bearer credential. The Bearer prefix is optional. The API strips it when it is present.

Authorization: Bearer FNLB_YOUR_API_TOKEN
FNLB API Token
API tokens in the FNLB account settings

Example

This lists the bots on the account that owns the token. The same call is GET /bots in the reference, where you can run it against your own account.

curl https://api.fnlb.net/v1/bots \
  -H "Authorization: Bearer FNLB_YOUR_API_TOKEN"

A successful response is a JSON array of bot objects. A failed response is JSON too:

{
  "type": "error",
  "errors": [
    {
      "message": "Invalid token provided.",
      "type": "general",
      "errorCode": "net.fnlb.errors.auth.invalid_token"
    }
  ]
}

errorCode stays stable. Match on that, not on message.

Common errors

CodeMeaning
net.fnlb.errors.common.invalid_requestThe path, query, or body does not match the route.
net.fnlb.errors.common.rate_limit_exceededThis IP hit the limit for this route. See Rate limits.
net.fnlb.errors.common.limit_exceededAn account limit was reached, such as how many bots you can create.
net.fnlb.errors.common.maintenance_modeThe API is in maintenance. Retry later.
net.fnlb.errors.auth.invalid_tokenThe token could not be read, or it was revoked.
net.fnlb.errors.auth.invalid_api_tokenThe value is not an active API token.
net.fnlb.errors.auth.unauthorizedThe route required a token and did not get a valid one.
net.fnlb.errors.auth.forbiddenThe token is valid, but it is missing a scope or a permission.
net.fnlb.errors.auth.user_bannedThe account cannot call the API.

HTTP status follows the same pattern as the reference: 400 for a bad request, 401 for a rejected token, 403 when the token cannot do this, 429 when the route was called too often.

Next

  • API reference

    Open a route and try it with the account you are signed in as.

  • OAuth2

    Get an access token for someone else's account.