Skip to the content

Read API

Read your conversations, leads, appointments, tickets, catalogs and usage from your own systems with a console key, and with write scopes reply, book and open tickets too.

Where
Workspace menuDeployDevelopersAPI keys
Permission
Needs Manage keys and webhooks
Time
6 min read
Markdown
01 / 04Ask for one page. List the conversations waiting for a team member, two at a time.
  1. Ask for one page. List the conversations waiting for a team member, two at a time.
  2. A page of the dashboard's data. The same JSON the dashboard reads: a total and the items on this page.
  3. Try to reply. Replying needs write:conversations, which a key gets only when you tick it.
  4. 403 names the missing scope. Make a key with that write scope ticked, then try again.

What it is

The Read API is a set of the dashboard's own routes that also accept a console key, so a reporting job, a CRM sync or a back-office tool can use them without anyone signing in. The answers are the same JSON the dashboard reads.

  • Authenticate with Authorization: Bearer sk-agent-…, using a key whose purpose is Console. Chat and events keys are refused.
  • Assistant routes start /api/agents/{agent_id}/, and agent_id must be the key's own assistant.
  • Each route needs a scope. A key without it gets 403 with the missing scopes named. See Console key scopes.
  • Changes made with a key, such as a ticket moved, show as made by API.
  • The base is your dashboard's address; examples use https://app.heyservo.ai.

A first request

curl "https://app.heyservo.ai/api/agents/AGENT_ID/conversations?limit=25&offset=0" \
  -H "Authorization: Bearer YOUR_API_KEY"
Lists the newest conversations of one assistant, 25 at a time.

Paging

List routes for conversations and leads take limit (1 to 100, 25 by default) and offset (from 0), and answer {"total": N, "items": [...]}. Keep raising offset by the number of items until you reach total.

Filters on GET /conversations6 controls
channelList
One or more channels, for example whatsapp, web, voice, api. Repeat the parameter for several.
statusList
One or more statuses. Repeat for several.
outcome, sentimentList
Filter by the outcome and sentiment found after the conversation.
qText
Searches the contact's name and number and the text of every message.
has_leadSwitch
Only conversations with, or without, a lead.
guardrailChoice
Conversations where a guardrail was hit, or that a guardrail ended.
Options hitended
Filters on GET /leads6 controls
daysNumber
How far back to look. 0 means all time.
Default 90
channelText
One channel.
scoreChoice
The lead's score.
Options hotwarmcoldnot_a_lead
has_email, has_phoneSwitch
Only leads with, or without, an email or a phone.
qText
Free-text search.
sourceChoice
Where the lead came from.
Options conversationmanual
Fields of a conversation in the list9 controls
id, channel, statusShown
The conversation, where it happened and where it stands.
created_at, last_message_atTime
When it started and when the last message came.
contact_id, contact_name, contact_phoneShown
Who it is with.
outcome, sentimentShown
Found after the conversation ends.
first_message, last_message_preview, message_countShown
A preview of the conversation.
guardrail_hits, ended_reasonShown
Guardrail hits, and why it ended.
leadShown
Whether a lead exists and how good it is, without the lead's contact details. Read those from the leads routes with read:leads.
total_credits, reply_credits, call_credits, task_credits, replies, callsShown
What the conversation used: credits in all, by AI replies, by calls and by other AI work, then the number of AI replies charged and of calls.
comment_count, latest_commentShown
Team comments.

Routes and the scope each needs

Every path in this section starts with /api/agents/{agent_id} unless it says otherwise.

The assistant

Method and pathScope
GET (the path itself)read:agent
GET /procedures, /procedures/catalog, /procedures/stats, /procedures/{id}, /procedures/{id}/versions, /procedures/{id}/versions/{version}read:agent
GET /workflow, /workflow/catalog, /workflow/stats, /workflow/versions, /workflow/versions/{version}read:agent
GET /guardrails/rules, /guardrails/events, /guardrails/events/export.csv, /guardrails/summaryread:guardrails

Conversations and notifications

Method and pathScope
GET /conversations, /conversations/export.csv, /conversations/{cid}read:conversations
GET /conversations/{cid}/recording, /conversations/{cid}/recording/audio, /conversations/{cid}/stats, /conversations/{cid}/messages/{seq}/audio, /conversations/{cid}/messages/{seq}/attachments/{idx}, /conversations/{cid}/commentsread:conversations
POST /conversations/{cid}/reply, /conversations/{cid}/reply-voice, /conversations/{cid}/status, /conversations/{cid}/commentswrite:conversations
PATCH, DELETE /conversations/{cid}/comments/{comment_id}write:conversations
GET /notificationsread:conversations
PATCH /notifications/{id}/read, POST /notifications/read-allwrite:notifications

POST /conversations/{cid}/reply takes {"message": "…"} (1 to 4,000 characters) and sends it to the customer over the conversation's own channel, as the team. Each request is a new message, unless you send an Idempotency-Key header: a retry with the same key is not sent twice.

curl -X POST "https://app.heyservo.ai/api/agents/AGENT_ID/conversations/CONVERSATION_ID/reply" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: crm-note-5521" \
  -d '{"message": "Hi Omar, Amina here. I will call you in 10 minutes."}'

Leads and appointments

Method and pathScope
GET /leads, /leads/stats, /leads/{id}, /conversations/{cid}/leadread:leads
POST /leadswrite:leads
POST /leads/{id}/callwrite:calls
GET /appointments, /appointments/stats, /appointments/field-suggestions, /appointments/slots, /appointments/{id}, /conversations/{cid}/appointmentsread:leads
POST /appointments, PATCH, DELETE /appointments/{id}, POST /appointments/{id}/remind, POST /conversations/{cid}/appointments/scanwrite:leads

Calls

Method and pathScope
GET /voice/outbound, /voice/calls, /voice/calls/{job_id}read:calls
POST /voice/calls, DELETE /voice/calls/{job_id}write:calls

Meetings

Method and pathScope
GET /meetings/overview, /meetings (which: upcoming, live or past), /meetings/{job_id}read:meetings
POST /meetings, DELETE /meetings/{job_id}write:meetings

POST /voice/calls also takes extension: keys pressed two seconds after the call is answered, to reach someone behind an office phone menu (for example "204"). It is ignored while keypad is not switched on for your workspace. See Keypad on calls.

Boards and tickets

Method and pathScope
GET /boards, /tickets, /tickets/{ref}, /conversations/{cid}/ticketsread:tickets
POST /tickets, PATCH /tickets/{id}, POST /tickets/{id}/move, POST /tickets/{id}/noteswrite:tickets

Boards must be on for the workspace; otherwise these answer 404 boards_off. Changing a board's setup needs a person signed in. See Boards.

Catalog

Method and pathScope
GET /catalogs, /catalog/items, /catalog/items/{id}, /catalog/lines, /conversations/{cid}/catalog-linesread:catalog
PUT /catalog/items (add or update), PATCH /catalog/items/{ref}write:catalog

Channels

Method and pathScope
GET /channels, /email-connections, /email-drafts, /avatar, POST /email-scope-suggestionsread:channels
PUT /channels/web, POST /channels/web/rotate; email connections and drafts; avatar links; the WhatsApp booking picker and templates accountwrite:channels

Usage

Method and pathScope
GET /usage, /usage/llm, /usage/speech, /usage/embeddingsread:telemetry
GET /telemetry/summary, /telemetry/timeseries, /telemetry/export.csvread:telemetry

Workspace routes

These act on the workspace of the key's assistant and do not start with /api/agents/{agent_id}.

Method and pathScope
GET /api/billing/account, /api/billing/credit-usage, /api/billing/plans, /api/billing/limits, /api/billing/packs and the other billing readsread:billing
Payment methods and checkoutwrite:billing
/api/workspaces/{workspace_id}/members… readsread:members
/api/workspaces/{workspace_id}/members… changeswrite:members

Errors

Errors come back as {"detail": …}.

StatusMessageMeaning
401missing bearer tokenNo key sent.
401invalid or revoked API keyThe key is wrong or revoked, or the path names another assistant.
401API key is not a console keyA chat or events key.
403API key missing scopes: [...]Create a key with those scopes.
404agent not foundThe assistant no longer exists.
404boards_offTicket routes while Boards are off for the workspace.

Questions people ask

Keep going
Read API · HeyServo Docs