Skip to Content

Get Started

Authentication

bav_ API keys, the Bearer header, choosing a workspace and rotating keys.

Every request carries a credential in the Authorization header as a Bearer token. The API accepts two kinds:

  • API keys start with bav_. Use them from servers, scripts and AI tools.
  • Sign-in tokens come from signing in with your Bavlio account, as the Bavlio app and MCP clients do. They expire; API keys do not.

Key format

A Bavlio API key is bav_ followed by 43 URL-safe characters. The prefix lets you spot Bavlio keys in your secrets scanner. Treat the whole string as the secret: Bavlio stores only a hash of it, so a lost key cannot be shown again.

Example

Getting an API key

New account: start a registration

POST /registrations needs no credential. It opens an account and answers with the account's first API key in api_key.

The new account works straight away but is temporary until its email address is verified:

  1. 1

    Give an email address

    Pass email when you start, or later with POST /registrations/{id}/claim. Bavlio sends a verification link to it.

  2. 2

    Click the link

    GET /registrations/{id} answers with status: "verified" once the link was opened, and the account becomes permanent.

  3. 3

    Or lose the account

    An account still unverified after 7 days is deleted together with its keys.

Existing account: create a key

Connect Bavlio's MCP server to an AI tool such as Claude or Cursor. It signs you in with your Bavlio account; then ask it to create an API key. Once you hold any credential, POST /api-keys creates more:

The full key is in the secret field of this one response. Store it as a secret in your runtime, for example as BAVLIO_API_KEY, and never commit it to source.

Sending the key

Pass the key as a Bearer token on every request, REST and MCP alike.

Write Bearer with a capital B. Authorization: bearer bav_… is answered with 401 auth_missing.

AnswerWhen
401 auth_missingThere is no Authorization header, or it does not start with Bearer.
401 auth_invalidThe token is not a Bavlio key or sign-in token, the key was revoked, or the token expired.

Choosing a workspace

Keys belong to an account, not to a workspace. An account can belong to several workspaces, its own and the ones it was invited to, and the bavlio-workspace header picks the one a call acts in.

  • The value is a workspace id from GET /workspaces (memberships[].workspace.id).
  • Without the header, a call acts in your default workspace: the first one you created, or the one you chose with PUT /workspaces/default.
  • An id you do not belong to is answered with 404 workspace_not_found.

Calls about your account rather than a workspace ignore the header: /whoami, registrations, API keys, listing and creating workspaces, choosing the default, drafting a workspace and the invitations you received.

Roles

RoleCan
ownerEverything an admin can, and transfer ownership. Every workspace has exactly one owner.
adminChange the company profile and setup, invite and remove people, and manage billing.
memberWork with campaigns, the inbox, reviews, LinkedIn accounts, email and meetings.

A member calling an admin-only endpoint gets 403 team_admin_required; only the owner can transfer ownership (403 team_owner_required).

Rotating a key

  1. 1

    Create the new key first

    Both the old and the new key work in parallel, so there is no downtime.

  2. 2

    Deploy your runtime with the new key

    Update the secret in your environment and restart your workers.

  3. 3

    Check traffic moved to the new key

    GET /api-keys shows each key's last_used_at, updated at most every 5 minutes.

  4. 4

    Revoke the old key

    DELETE /api-keys/{id} answers the revoked key, with revoked_at set. A revoked key gets 401 auth_invalid on every request from then on. There is no undo: create a new key if you need one.

Scopes and permissions

An API key can do everything its account can, in every workspace the account belongs to. Keys have no scopes and do not expire, so revoke a leaked key at once.