open, waiting or closed. You can list cases, read one with its messages,
reply as a person, take a case over from the agent, give it back, assign it, route it and close it.
All routes are under https://api.impellabs.tech/api/v1. Send Authorization: Bearer imp_... on each request. See
Authentication and Conventions for tokens, errors and ids. The full list
of fields for each route is in the API reference.
Who can see a conversation
A token acts as the person who made it. That person sees only the cases they may read:- Cases on a channel they connected.
- Cases on a channel that is shared with them, with their department, or with everyone.
- Cases assigned to them, taken over by them, or routed to their department.
404 with There is no conversation like that. The same answer is
used when the case does not exist, so a response never tells you that a hidden case is there.
List conversations
GET /cases
The reply holds
results (50 at most), next_offset (null at the end) and counts, the number of cases in each
status under the other filters.
answering says who answers now: who is agent, person or nobody, with a reason. Each case also carries thread_of, threads, taken_over, handoff,
summary, department, closed_at, close_reason and last_inbound_at.
Times are stored in UTC and written in ISO 8601 with an offset.
Read one conversation
GET /cases/{case_id} returns the case and a page of its messages, oldest first. Use limit (up to 200, 50 by
default). To read older messages, send before with the next value of the last page.
messages and next. Each message has id, direction (in, out or app),
author, kind, text, emoji, media, data, reply_to, member_id, agent_id, run_id, case_id,
channel and at. The case also has reply_waits: the approval that holds a drafted reply, or null.
Send a message
POST /cases/{case_id}/messages sends a message to the customer as the person who owns the token. It also takes the
case over, so the agent stops answering until you give the case back.
Send at least one of
text, template or file_ids.
201: the first message, with all sent messages in messages.
Take over, hand back, assign, route
Each action below is aPOST to /cases/{case_id}/<action>. Each returns the updated case.
GET /cases/routing-options lists where a case can go: { "options": [ { "kind", "id", "name" } ] } with kind
department or agent.
Start a conversation
POST /cases with { "contact_id", "channel_id" } opens a conversation with a contact, or returns the open one on
that channel. It answers 201 for a new case and 200 for an existing case. It sends no message. Send the first
message with POST /cases/{case_id}/messages; on a channel with a closed window, use a template.
Settings, handoff rules and saved replies
These routes configure how conversations run for the workspace. They are in the API reference:GETandPATCH /cases/settings: the quiet-close time and the time a handoff waits before the agent tells the customer a person will follow up.GETandPOST /cases/handoff-rules, andPATCHandDELETE /cases/handoff-rules/{rule_id}: who takes a customer the agent hands on.GETandPOST /cases/saved-replies,PATCHandDELETE /cases/saved-replies/{reply_id}, andPOST /cases/saved-replies/{reply_id}/use: lines your team sends often.