Skip to the content

API keys

Keys let your own servers talk to an assistant, read and change dashboard data, or send events. Each key belongs to one assistant and does one job.

Where
Workspace menuDeployDevelopersAPI keys
Permission
Needs Manage keys and webhooks
Time
6 min read
Markdown
01 / 05Open New key. On DevelopersAPI keys, click New key.
  1. Open New key. On DevelopersAPI keys, click New key.
  2. Pick the assistant and a name. Name the key after what will use it, so you know what breaks if you revoke it.
  3. Choose the purpose. A Console key reads the dashboard API. With Choose scopes off it gets every read scope and nothing more.
  4. Create it. The full key appears once. Copy it into your server's secrets.
  5. It is in the list. Only the start of the key is shown from now on. Revoke it from its row when you no longer need it.

What an API key is

An API key is a secret your server sends as a Bearer token: Authorization: Bearer sk-agent-…. Every key belongs to exactly one assistant and has one purpose. The purpose decides where the key works; anywhere else it is refused.

PurposeBadgeWorks onUse it for
Chat (OpenAI-compatible API)Chat/v1/…/chat/completions, /v1/models, /v1/visitor-contextTalking to the assistant as a customer would. See Chat API.
Console (read the dashboard API)ConsoleThe dashboard routes listed on Read API, never on /v1Reading conversations, leads, tickets and usage, and with write scopes changing them.
Send events (your app tells the assistant what happened)Events/v1/events onlyYour app telling the assistant what happened. See Events API.

Create a key

GoalA key copied into your server's secrets.

  1. 1

    Open DevelopersAPI keys and click New key

  2. 2

    Pick the Agent

    Chat calls with the key reach this assistant. A console key reads its whole workspace.

  3. 3

    Give it a Name

    Name it after what uses it, such as Website backend or Order system. Without a name it shows as Unnamed key.

  4. 4

    Choose the Purpose

    For a chat key, also pick the Channel. For a console key, decide on scopes (below).

  5. 5

    Click Create key and copy the key

    The dialog Copy your key now shows the full key once. Store it in your server's secret store.

An events key can also be made on an assistant's ConfigureEventsConnect your app tab. The dashboard's search palette also has a Create API key action that opens this dialog.

The New API key dialog

New API key6 controls
AgentChoice
The assistant the key belongs to. Chat calls with this key reach this agent; a console key reads its workspace.
NameText
Your label for the key.
Default Unnamed key
PurposeChoice
What the key may do.
Options Chat (OpenAI-compatible API)Console (read the dashboard API)Send events (your app tells the assistant what happened)
ChannelChoice
Chat keys only. Conversations made with the key are filed under this channel in Conversations and reports.
Default APIOptions PhoneWebsiteAPIWhatsApp
Choose scopesSwitch
Console keys only. Leave this off to grant every read scope. Write scopes are only given when picked.
Default Off
Create keyButton
Makes the key and shows it once.

Console key scopes

A console key holds scopes. A route that needs a scope the key lacks answers 403 and names the missing scopes. With Choose scopes off, the key gets every read scope, including read:catalog. Write scopes are given only when you tick them.

ScopeReads or changes
read:agentThe assistant, its procedures and its workflow
read:telemetry, read:usageUsage and telemetry
read:conversationsConversations, transcripts, recordings, comments, notifications
read:channelsChannels, email connections and drafts, avatar screens
read:billingThe credit account, plans and usage
read:membersWorkspace members
read:guardrailsGuardrail rules and hits
read:callsOutbound calls
read:meetingsMeetings an assistant was sent to, with their summaries
read:leadsLeads and appointments
read:ticketsBoards and tickets
read:catalogCatalogs, items and requests
write:conversationsReply, change status, add comments
write:notificationsMark notifications read
write:leadsAdd leads, book and change appointments
write:callsPlace and cancel calls, call a lead
write:meetingsSend an assistant to a meeting, cancel it or make it leave
write:ticketsOpen, change, move and note tickets
write:channelsChange channel settings
write:members, write:billing, write:workspaceMembers, billing and workspace changes
write:catalogAdd and change catalog items
The routes behind each scope are on Read API.
  • A console key reads the whole workspace, so you need access to every assistant to create one.
  • Each scope maps to a permission. You cannot give a key a scope your own role does not hold: the dialog says the key reaches more than your role does. Leave those scopes out, or ask an owner or admin.

The key list

Columns6 controls
NameShown
Your label, or Unnamed key.
AgentShown
The assistant the key belongs to.
PurposeShown
A badge: Chat (grey), Console (blue) or Events (violet).
ChannelShown
Where its conversations are filed.
Last usedShown
Updated at most once a minute.
Default Never
CreatedShown
When it was made.

Only the start of a key is ever shown again: sk-agent- and its next eight characters. That is enough to tell keys apart, not to use one.

Revoke a key

GoalThe key stops working everywhere.

  1. 1

    Find the key in the list and click Revoke

  2. 2

    Confirm

    Anything using this key stops working at once. This can't be undone. The row stays, marked Revoked.

When a key is refused

StatusMessageWhy
401missing bearer tokenNo Authorization: Bearer header.
401invalid or revoked API keyThe key is wrong, revoked, or belongs to another assistant than the one in the path.
401API key is not a chat keyA console or events key was used on the Chat API.
401API key is not a console keyA chat or events key was used on a dashboard route.
401wrong_keyA key that is not an events key was used on /v1/events.
403API key missing scopes: [...]A console key without the scope the route needs.

Questions people ask

Keep going
API keys · HeyServo Docs