Skip to content

Get started

Authentication

Authenticate with an API key in the x-api-key header. How keys are scoped, how to revoke them, how to keep them secret and what they can’t do.

The Flenvio API uses API keys. Send yours in the x-api-key header on every request:

curl "https://api.flenvio.com/v1/accounts" \
  -H "x-api-key: $FLENVIO_API_KEY"

Keys look like flv_ followed by 64 hexadecimal characters. Requests without a valid key get 401 Unauthorized.

Create a key

Create keys in the dashboard under Settings → Developer → API keys. Give each key a name and choose when it expires: in 30 days, 90 days, 1 year, or never. The key is shown once; Flenvio stores only a hash of it, so a lost key can’t be recovered. Create a new one instead.

  • You can have up to 10 active keys.
  • Choose its access: Full access or Read only (see below).
  • The key list shows each key’s access, when it was created, when it was last used (updated at most about once a minute) and when it expires.
  • Use one key per tool or agent, so you can revoke one without breaking the others.

What a key can access

Each key has one of two scopes, chosen when you create it (scope in the key list). Neither is limited to some accounts: a key covers your whole Flenvio account, so treat every key like your password.

ScopeDashboard labelWhat it can do
fullFull accessEverything the API allows: read your accounts, groups, posts and comments, publish and schedule, cancel and retry, change groups, upload media, reply to and moderate comments, send direct messages, and disconnect accounts. Keys created before scopes existed have full access.
read_onlyRead onlyOnly GET requests: list and read accounts, groups, posts, deliveries, comments and messages, and TikTok creator info. Any other request answers 403 with code: "api_key_read_only", and nothing is changed. Good for dashboards, reporting and agents that only need to look.
A read-only key trying to publish · 403
{
  "statusCode": 403,
  "error": "Forbidden",
  "code": "api_key_read_only",
  "message": "This API key is read-only. Use a key with full access to make changes."
}

What a key can’t do

These actions need you, signed in to the dashboard. With an API key they answer 401 Unauthorized:

  • Create, list or revoke API keys.
  • Connect or reconnect accounts (each platform’s sign-in needs a browser).
  • Delete your Flenvio account, or sign out your dashboard sessions.

Revoke a key

In Settings → Developer, select Revoke next to the key. It stops working immediately: the next request with it gets 401 with the message Invalid API key. Expired keys behave the same way. Revoking can’t be undone; create a new key if you need access again.

Keep your key secret

  • Call the API from a server, script or agent you control. Never put a key in a website’s JavaScript, a mobile app or anything you ship to other people.
  • Store it in an environment variable or a secret manager, not in source code. Don’t commit it to Git or paste it into issues, chats or screenshots.
  • Give automations and agents their own key with an expiry, and revoke it when the job is done.
  • If a key may have leaked, revoke it right away and create a new one.

Authentication errors

ResponseMeaning
401 {"message":"Invalid API key"}The key is wrong, revoked or expired, or your Flenvio account is being deleted.
401 {"message":"Unauthorized"}No x-api-key header was sent, or the endpoint needs a dashboard session (see above).
403 {"code":"api_key_read_only"}The key is read-only and the request would change something. Use a full-access key.
Authentication with API keys · Flenvio