REST API
Read support data and manage Octocom configuration over HTTP, with scoped keys and a stable contract.
The REST API lets your own code read support data and manage Octocom configuration over plain HTTP. Use it when a stable contract suits the job better than an AI agent on MCP:
- A nightly export of conversations to your data warehouse
- A script that keeps your help articles in sync with another system
- A backend that pushes customer messages in from a channel you run
Each API key carries only the scopes you grant, so every integration gets exactly the access it needs.
Full reference
Every endpoint, with parameters, request and response schemas and a "try it" console, is documented at api-docs.octocom.ai. This page explains how the API works and covers the endpoints that need more context than the reference gives.
Base URL and specification
All endpoints are served under the /rest/v1 prefix:
https://api.octocom.ai/rest/v1The machine-readable OpenAPI 3 specification is at https://api.octocom.ai/openapi.json. Point your own code generator, Postman or client library at it.
Browse the API through Copilot or MCP
Agents can read the published API directly through three read-only documentation tools. In Copilot, discover the rest_api_documentation capability group:
list_rest_api_groups()returns every group, its description and operation count.list_rest_api_operations({ group: "Conversations" })returns endpoint methods, template paths and short summaries. FollownextOffsetuntil it isnull. Carry the first page'srevisioninto subsequent requests to detect changes during pagination; restart at offset 0 if the specification changes.get_rest_api_operation({ method: "POST", path: "/rest/v1/conversations/outbound-email" })returns the full operation contract, including optional parameters, defaults, schemas, examples, errors and authentication guidance.
The catalog is read from the public OpenAPI specification on each call. An operation lookup includes inherited path parameters, servers and declared security, and expands local schema references. Recursive references keep their definitions in referenceDefinitions; any external references are listed in unresolvedReferences. Large Copilot results may be saved to a file: read the saved result before implementing the request.
These tools read documentation only. They do not call API operations, provide credentials or change the caller's permissions. Check the full contract when using a Python helper: a helper may expose fewer options than its REST endpoint.
Authentication
Every request authenticates with an API key sent in the X-API-Key header. The only exceptions are the public Browser Sessions endpoint and temporary recording downloads.
X-API-Key: your_api_key_hereCreate and manage named keys in Settings -> Workspace -> API keys. Each key applies to your entire organization. Use one key per integration, with only the access it needs, so you can limit, rename, regenerate or delete it independently.
- New keys are shown once, when created or regenerated. Copy them to a secure secret store before closing the dialog. Your organization's original key is listed as Default, and it is the only key whose value can be shown again.
- Regenerating or deleting a key immediately invalidates its previous value; other keys keep working. Requests already authenticated may finish.
- Managing keys requires the Manage API keys permission, and you can't give a key more access than you have yourself.
- Rate limits are shared by all of the organization's keys. Octocom automations use a separate internal credential with their own rate limits, so deleting your keys does not interrupt Python actions or background jobs, and busy automations do not use up your integrations' budget.
Scopes
Each key has Full access or a list of scopes.
A key missing the scope an endpoint needs gets 403, with the scope in the response:
{
"error": "This API key is missing the required scope: conversations:read",
"requiredScope": "conversations:read"
}Each endpoint in the API reference lists its scope, and GET /rest/v1/scopes returns them all. When a scope is split into finer scopes, existing keys keep the access they already have.
| Scope | Allows |
|---|---|
conversations:read-recent | Read conversations created in the last 7 days, and any still open. Older closed conversations return 404 and are left out of lists, so a leaked key can't download your history. Use it for integrations that only follow new tickets |
conversations:read, conversations:write | Read all conversations, including history; reply, tag, assign, close, snooze and hand off |
customers:read, customers:write | Read and edit customers |
helpdesk:read, helpdesk:write | Tags, shared macros and views, assignment rules and capacity profiles, the spam filter and help desk settings such as Refine message instructions |
bot:read, bot:write | Bot configuration, bot rules and bot QA |
handoff:read, handoff:write | Handoff settings: live chat, response time, what the AI agent tells customers and what happens after a handoff. bot:write gives handoff:write; bot:read and channels:read give handoff:read. Also needed for the live chat fields on PATCH /rest/v1/web-chat-configs/:id |
workflows:read, workflows:write | Workflows and comment workflows |
knowledge:read, knowledge:write | Articles, documents and website sources |
automations:read, automations:write | Actions, condition providers, event handlers, recurring jobs, Python modules, HTTP endpoints and phone line routers, including their code. Reading one HTTP endpoint with its source, and reading phone line routers or their executions, needs automations:write. Also needed for any setting that holds code: automations:write to save web chat custom JavaScript, interaction button and search HTML templates or the Python prompt section, and automations:read to get the Python prompt section back from GET /rest/v1/system-prompt |
secrets:write | Create, replace and archive organization secrets. Patching fields inside a JSON secret (PATCH /rest/v1/secrets/:id/json) needs automations:write instead |
integrations:read, integrations:write | Connected integrations |
channels:read, channels:write | Email inboxes, web chat, phone numbers, SMS and social settings |
campaigns:write | Add campaign recipients |
products:read, products:write | Search products; URL matching |
storefront:read, storefront:write | Storefront search and interaction buttons |
metrics:read | Metric reports, chart data and metric alerts, including testing an alert |
reports:write | Create, edit and delete metric alerts |
human-qa:read, human-qa:write | Human QA scorecards, results and summaries. human-qa:read can also mark results reviewed; human-qa:write creates and edits scorecards and runs dry-run tests, which also need conversations:read |
users:read | Team members, teams and roles |
roles:write | Create, edit and delete custom roles |
Things to know about scopes:
- Credential-like metadata. Conversation metadata whose key looks like a credential (it contains
secret,token,sessionand the like, see passing tokens and other secrets) comes back as"value": null, "isSecret": trueto keys without Full access. Full access keys and Python actions read the value. - Code access is close to full access. A key with
automations:writecan run code with full access to your organization, so treat it like Full access. Thellm,organization-storeandsheetsendpoints need a Full access key. - Role management is bounded. A key with
roles:writecan only give a role scopes it holds itself and that an API key can hold (apiKeyGrantableinGET /rest/v1/scopes), even with Full access. It also can't edit or delete a role that holds other permissions. Grant role-only permissions, such as managing API keys or team members, or using Copilot or MCP, from Settings -> Workspace -> Users -> Roles or through MCP.
A first request
List conversations (oldest first by default):
curl https://api.octocom.ai/rest/v1/conversations \
-H "X-API-Key: $OCTOCOM_API_KEY"List endpoints are paginated and filterable. For example, fetch the second page of currently closed conversations that were created in a given window:
curl -G https://api.octocom.ai/rest/v1/conversations \
-H "X-API-Key: $OCTOCOM_API_KEY" \
--data-urlencode "status=closed" \
--data-urlencode "startDate=2026-01-01T00:00:00Z" \
--data-urlencode "endDate=2026-01-31T23:59:59Z" \
--data-urlencode "page=2"Conversations can also be filtered by handedOff state and by a metadataKey / metadataValue pair (for example, to find the conversation tied to a specific Zendesk ticket). See the reference for the full set of parameters on each endpoint.
To find whether a customer has contacted support, filter directly by their email address. Add businessSlug when the organization contains several businesses, and use imported=all if migrated help desk history should count:
curl -G https://api.octocom.ai/rest/v1/conversations \
-H "X-API-Key: $OCTOCOM_API_KEY" \
--data-urlencode "customerEmail=customer@example.com" \
--data-urlencode "businessSlug=your-business" \
--data-urlencode "imported=all"Conversation list items include the associated customer, derived status, closedAt and rating. GET /rest/v1/conversations/{id} exposes the same rating as { "score": 5, "comment": "..." }, or null when the customer has not submitted one.
Conventions
Pagination
List endpoints accept a 1-based page query parameter. Some lists also take a limit; the reference gives each endpoint's default and maximum. Numbered pages are not a snapshot: for data that changes while you page, see incremental polling.
Errors
The API uses standard HTTP status codes:
| Status | Meaning |
|---|---|
200 | Success |
400 | Malformed request, for example an unreadable, oversized or unsupported upload |
401 | Invalid or missing API key |
403 | The API key doesn't have the scope this endpoint needs |
404 | Resource not found |
429 | Rate limit exceeded |
500 | Server error |
Some endpoints return other codes, such as 201 and 202 for created and accepted messages, 409 for a conflicting or in-progress write, or 503 for a temporary failure. Each section below and the reference list them.
Rate limits
Requests are counted per organization in fixed 60-second windows. Each kind of caller has its own budget, so a busy automation cannot block your integrations and a slow integration cannot block the AI agent:
| Budget | Who | Requests per minute |
|---|---|---|
| Integrations | All of your API keys together | 1,000 |
| Conversation automations | Python actions, condition providers, prompt sections, sidebar widgets and actions, custom HTTP endpoints and phone line routers | 2,000 |
| Background automations | Recurring jobs and event handlers together | 1,000, and at most 300 for any one of them |
Some heavy endpoints also have their own cap per organization, shared by every caller: GET /rest/v1/conversations (300 a minute), GET /rest/v1/metric-charts/{chartId}/data (60 a minute), and the paid dry runs POST /rest/v1/bot-qa/test and POST /rest/v1/human-qa/test (30 a minute each). Endpoints with further limits of their own, such as LLM, bulk detail, import, recordings and product search, describe them in their sections.
- Headers. Successful responses carry
X-RateLimit-Limit,X-RateLimit-RemainingandX-RateLimit-Reset(seconds until the window resets) for whichever of these limits has the least room left. - Over a limit, the API returns
429withRetry-Afterin seconds. Wait that long before retrying. Rejected requests, including403responses for a missing scope, do not count against the budget, but retrying immediately in a loop only gets more429s. - Spread bursts. Pace large batches over the minute instead of sending them in parallel, and use bulk endpoints where they exist.
Contact us if your integration needs a higher ceiling.
Retries and duplicates
- Endpoints that accept an
externalId(pushing messages, importing history) are safe to retry: a repeatedexternalIdreturns the original result instead of creating a copy. - Endpoints that send a real email or text message (outbound email, outbound SMS) do not accept an idempotency key. Don't blindly repeat them after an ambiguous timeout.
- After a
429or503, honorRetry-Afterand back off with jitter.
What you can access
The API covers conversations and customers, help desk and AI agent configuration, automations and their code, channels, products and storefront search, analytics, and the settings of several integrations. Most configuration resources support create, read, update and archive, and workflows, articles and bot rules also have version history and restore. The reference and list_rest_api_groups list every group and operation.
| Area | Groups in the reference | Highlights |
|---|---|---|
| Conversations and customers | Conversations, Customers, Custom Data, Tags, Views, Macros, Bot Conversations | List and read conversations with full message history, AI classifications and notes. Add and remove tags (filter by tag), read and write internal notes, add events, set metadata, send outbound email and SMS, and import history. Start a conversation with the AI agent and send it messages, for automated testing or embedding. |
| Your own channel | Conversations | Two-way messaging for a channel you run: push customer messages in and receive every reply on a webhook. See below. |
| Help desk | Assignment, Help desk settings, Spam filter, CSAT, Handoff, Human QA, Users, Teams | Assignment rules and capacity profiles, help desk and handoff settings, CSAT, the spam filter, Human QA scorecards and results, team members, teams and roles. |
| AI agent | Workflows, Comment Workflows, Bot Rules, Articles, Documents, Website Sources, Writing Style, System Prompt, Follow-ups, Bot QA | Manage workflows, bot rules and knowledge with version history and restore, and the follow-ups sent when an email conversation goes quiet. Upload documents and check their indexing (Knowledge documents). Read and change Bot QA settings and checks, dry-run checks and list violations. |
| Automations | Custom Actions, Condition Providers, Event Handlers, Recurring Jobs, Python Modules, Custom HTTP Endpoints, Phone Line Routers, Secrets, Organization Store, Sidebar widgets | Manage automation code and settings, test and audit phone line routers, and read and write organization store entries. |
| Channels | Email inboxes, Web Chat, Phone numbers and SMS, Social sender rules, Campaigns | Email inbox settings such as signatures and response delays, web chat configurations, phone and SMS numbers, and recipients for phone campaigns. |
| Products and storefront | Products, Storefront Search, Product Sync, Browser Sessions | Product search by text, voice, photo or similar product, storefront search settings, product sync, and recording purchases against a browser session for sale attribution. The Browser Sessions endpoint needs no API key and is rate limited by IP. |
| Data and reporting | Metrics, Custom Data, Google Sheets | Metrics report data and alerts, AI-classified data extracted from conversations, and rows in connected Google Sheets. |
| Integrations | Freshdesk, Commslayer, Whop, Stripe, CheckoutChamp, Podium, Notion | Connect, configure, check and disconnect these integrations. |
| Organization | Businesses | List the businesses in your organization. Use their slugs when calling business-scoped endpoints. |
Conversations
Conversation listing and bulk details
GET /rest/v1/conversations accepts limit=1..200 (default 50), page (default 1), sortBy=createdAt|updatedAt (default createdAt) and sortOrder=asc|desc (default asc). The UUID breaks timestamp ties consistently. startDate / endDate are inclusive creation-time bounds. updatedSince / updatedBefore are inclusive change-tracking bounds. List items and details include updatedAt; a conversation without a stored update timestamp uses its creation timestamp. updatedAt tracks internal changes, not the time of the last customer message.
List results can lag writes by a few seconds. Returned fields, single details and bulk details always reflect live data.
For incremental polling, use an upper bound slightly behind the present time, keep the same bounds and page size while paging, and overlap the next window. Upsert by UUID, deduplicate repeated results, and reconcile periodically: numbered pages are not a snapshot, and changes to related records are not an exhaustive change feed.
POST /rest/v1/conversations/bulk takes { "ids": ["conversation-uuid", "..."] } with 1 to 200 UUIDs and returns { "data": [...], "unavailableIds": [...] }. Each detail has the same fields as GET /rest/v1/conversations/{id}. Repeated IDs appear once, in request order. Missing IDs, IDs from another organization and conversations your organization or key cannot access all appear in unavailableIds, without a reason.
Bulk details count as one request against your rate limit and additionally allow 2,000 requested IDs per 60-second window per organization, including duplicate and unavailable IDs. Prefer them to fetching conversations one by one. Rejected batches do not consume the bulk-ID budget. A bulk request returns 429 with Retry-After: 60 when that budget is exhausted or its limiter is unavailable. Retry with backoff and avoid parallel bursts.
Finding conversations by tag
GET /rest/v1/conversations?tag=escalated-web returns only conversations carrying a tag with that exact title. Use it instead of paging every open conversation to find the handful you tagged.
curl -H "X-API-Key: $OCTOCOM_API_KEY" \
"https://api.octocom.ai/rest/v1/conversations?tag=escalated-web&status=open"Tags are written with POST /rest/v1/conversations/tags and removed with DELETE /rest/v1/conversations/tags, both taking { "conversationId": "...", "tag": "..." }. Removing only unlinks the tag from that conversation; the tag itself stays available to your organization and on any other conversation.
Removing a tag the conversation does not have returns 404, so a removal that did nothing is never reported as success.
A tag-driven queue should remove its tag as part of processing. Without that, the same conversations come back on every poll.
To be notified as tags change rather than polling for them, subscribe an event handler or a webhook to the tag_modified event.
Internal notes
Notes are visible to your agents in the Octocom dashboard and are never shown to the customer.
| Endpoint | What it does |
|---|---|
POST /rest/v1/conversations/{id}/notes | Add a note ({ "text": "..." }) |
GET /rest/v1/conversations/{id}/notes | List every note, newest first |
{id} accepts either the conversation UUID or its public ID.
Notes created this way are attributed to api rather than to a user, and appear in the timeline labelled as such, so an agent can tell them from one a colleague typed. Each returned note carries authorType (user, api or automation) and authorName.
From Python, use add_conversation_note and get_conversation_notes instead of calling these directly.
Conversation recordings
Use GET /rest/v1/conversations/{id}/recording with your X-API-Key to retrieve recording availability for a conversation UUID:
{
"data": {
"conversationId": "22222222-2222-4222-8222-222222222222",
"status": "ready",
"downloadUrl": "https://api.octocom.ai/rest/v1/recording-downloads?token=TEMPORARY_TOKEN",
"expiresAt": "2026-10-16T12:15:00.000Z"
}
}Status is processing, ready or unavailable. The URL and expiry are null unless ready. Keep the conversation ID and request a fresh URL when needed; links expire after 15 minutes. Anyone holding a link can download that conversation's recording without an API key, so keep links private.
The download returns a WAV file combining the saved call recordings in call order, including segments after a transfer. It rechecks access and recording availability. Missing recordings stay processing during an active call and for up to ten minutes after it ends; after that, the available segments are served, or the status becomes unavailable if there are none. Scrubbed recordings are excluded. If the recording cannot be fetched from the phone provider, the download returns 502.
Downloads allow 120 requests a minute per organization, up to 64 MiB of source audio, with a 30-second total fetch deadline. Over the limit, downloads return 429 with Retry-After: 60. Up to 4 downloads per organization can run at once; more also return 429. Download one recording at a time and wait for Retry-After before retrying. An expired or invalid link returns 404; request a new one through the authenticated endpoint.
Ticket activity events
Ticket activity records are separate from webhook and automation trigger types. Conversation detail responses (REST and MCP) keep the envelope { id, event, createdAt, metadata }. Treat metadata according to event; new general-purpose records use event: "event" and versioned metadata:
{
"id": "00000000-0000-4000-8000-000000000001",
"event": "event",
"createdAt": "2026-10-17T09:05:00Z",
"metadata": {
"version": 1,
"text": "Snoozed until Oct 19, 10:00",
"details": "Resumes Oct 19, 2026 10:00 UTC (UTC)",
"initiator": {
"type": "user",
"id": "00000000-0000-4000-8000-000000000002",
"name": "Maria Smith"
}
}
}Version 1 requires text and initiator; subtext and details are optional plain text. Initiator types are user, customer, system, integration and unknown. Known initiators have a stable id and a snapshot of the display name (name); unknown has only a name. System identifiers describe their source, such as snooze-scheduler; they are not user IDs. Historical actors are not inferred from the current assignee.
REST integrations store the API key's name at the time of the event, its stable key ID, and initiator.source: "rest-api". Renaming or rotating a key does not rewrite earlier events. MCP ticket actions store the OAuth client as the integration, with source: "mcp" and a snapshot of the connected user's ID and name in onBehalfOf, for example:
{
"type": "integration",
"id": "mcp_example_client",
"name": "Support assistant",
"source": "mcp",
"onBehalfOf": { "id": "example-user", "name": "Maria Smith" }
}source and onBehalfOf are optional version 1 fields. Records without them remain valid. If the client has no registered name, MCP events use MCP.
raw records contain text in metadata. Other earlier types, such as close, snooze and merge, keep their original metadata. Clients must handle mixed histories, unknown event types and future metadata versions without failing the whole response. IDs and timestamps are unchanged. If an unknown version has readable metadata.text, clients can show that text without assuming the rest of the version's structure.
To create an event:
POST /rest/v1/conversations/events
X-API-Key: YOUR_API_KEY
Content-Type: application/json{
"conversationId": "exampleTicket",
"event": "Refund processed",
"subtext": "Order #1234",
"details": "The payment provider confirmed the refund."
}event in this request is the text (1 to 1,000 characters), not the stored type. subtext is limited to 1,000 characters and details to 12,000 characters. The server determines the initiator from authentication; clients cannot supply another user's identity. The response is { "success": true, "message": "Event created successfully", "eventId": "..." }.
Starting an email conversation for the bot
POST /rest/v1/conversations/outbound-email sends the opening text as a bot message. Set handedOff to false to let the AI agent answer customer replies. closeAfterSend defaults to true: the conversation is closed after the send (or after queueing, for asynchronous providers), and a customer reply reopens it:
{
"businessSlug": "your-business",
"to": "customer@example.com",
"customerName": "Customer",
"subject": "An update on your order",
"text": "Your order has shipped. Reply if you need help.",
"handedOff": false,
"closeAfterSend": true,
"tags": ["gift_campaign", "prevent_notif_of_received_request"]
}- Sending inbox.
inboxId(fromGET /rest/v1/email-inboxes) sends from a specific inbox of that business, for example a brand's German support address. Without it, the business's primary inbox is used. A chosen inbox must be connected and able to send, otherwise the request fails with400and nothing is created. An inbox that belongs to another business returns404. - Volume limit. Outbound email counts against an organization-wide limit of 2,500 recipients per UTC hour and 10,000 per UTC day, shared with MCP
send_outbound_emails, review outreach and the help desk. Over the limit, the request returns429and nothing is sent; retry in the next hour or day. - Who handles replies. Omitting
handedOffhands the conversation to your team and closes it after sending; customer replies reopen it for your agents. - Keeping it open. Use
closeAfterSend: falsewhen the conversation should stay open. This option is independent ofhandedOff, which controls who handles replies. Closing prevents inactivity follow-ups while the conversation is closed; normal follow-up rules resume after the customer replies and the AI agent answers. - Tags.
tagsare added to the Octocom conversation and, for Zendesk, to the external ticket at creation. Use a stable campaign tag to find the same sequence in both systems.prevent_notif_of_received_requestin the example is a tag a Zendesk account might use to suppress one of its own triggers, not a universal Zendesk setting.
For Zendesk, the business needs an enabled email integration and a bot agent. The opening message creates a Zendesk ticket with a public comment authored by that agent, assigned to the bot and scoped to the configured brand and required tag. If discovery uses an inbox allowlist, the first allowed address that isn't blocked is used as the ticket's support address. Zendesk's requester-notification triggers must be enabled to deliver the email. Octocom records the ticket and message IDs, so replies from Zendesk join the original thread. Your handoff, exclusion and assignment rules still apply.
This endpoint sends a real email and does not accept an idempotency key; avoid blindly repeating requests after an ambiguous timeout. For bulk sends from an AI agent, the MCP tool send_outbound_emails sends up to 100 emails per call with the same behavior, and skips recipients already reached under the same batch tag, so a repeated call only sends what is missing.
Starting an SMS conversation
POST /rest/v1/conversations/outbound-sms texts a customer from one of a business's SMS numbers and creates the conversation. The customer's reply threads into it. The text is sent first, so a refused number creates nothing and returns 400 with a code such as INVALID_RECIPIENT or PROVIDER_REJECTED:
{
"businessSlug": "your-business",
"to": "+12025550187",
"text": "Your order has shipped. Reply here if you need help.",
"from": "+18884407931",
"handedOff": false,
"tags": ["shipping_update"]
}from must be one of the business's Twilio SMS numbers with receiving turned on; omit it to use the first. A to number without a country code is read as being in the sender's country. Unlike outbound email, the conversation stays open by default (closeAfterSend: false), because a reply to a closed SMS conversation starts a new one.
This endpoint sends a real text and does not accept an idempotency key; avoid blindly repeating requests after an ambiguous timeout.
Two-way messaging over HTTP
If you own the channel the customer is on (your own WhatsApp number through your own provider, an in-house app, or a system Octocom has no connector for), you can run the whole conversation over HTTP. You push the customer's messages in, and every reply comes back on a webhook.
Two endpoints write, and GET /rest/v1/conversations/{id} reads.
POST /rest/v1/conversations starts a thread:
curl -X POST https://api.octocom.ai/rest/v1/conversations \
-H "X-API-Key: $OCTOCOM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"businessSlug": "your-business",
"customer": { "name": "Maria Gonzalez", "phone": "+52 55 1234 5678" },
"messages": [
{ "sender": "bot", "content": "Hi Maria, your order #A-33915 has shipped...", "timestamp": "2026-08-18T08:55:10Z" },
{ "sender": "customer", "content": "When will it arrive?", "timestamp": "2026-08-18T09:12:44Z" }
],
"externalId": "your-msg-8891",
"tags": ["whatsapp"],
"metadata": { "orderNumber": "A-33915" }
}'It answers 201 immediately with conversationId, publicId and messageIds. You never wait for the AI agent; its reply arrives on your webhook.
POST /rest/v1/conversations/{id}/messages appends every customer message after the first, and answers 202 with the stored messageId and whether a human currently owns the conversation.
Four things to know:
- Seed the message the customer is replying to. When someone answers a transactional message you sent from your own system, their reply often makes no sense alone: "when will it arrive?" needs the order confirmation for context. Include that original message in
messageswith"sender": "bot"so the AI agent can see what is being answered. Seeded messages are context only: they never trigger a reply and are never sent anywhere. Seeding is optional, but it noticeably improves answers and gives your agents the full thread after a handoff. The last entry inmessagesmust be from the customer. - Tag conversations to route them.
tagsandmetadataare accepted at creation and are what webhook filters match on, so one integration's traffic can be routed to its own endpoint without inspecting payloads on your side. - Supply
externalIdand retries are free. It is your own ID for the message you are pushing. Replaying one returns the IDs from the first call and stores nothing, so a retry after a timeout can't create a duplicate. - Handoff is transparent. A handed-off conversation keeps accepting messages exactly as before, and replies keep arriving on the same webhook; only
message.senderchanges frombottoagent. You don't need to detect it or do anything differently.
The webhook is the intended way to receive replies, so you should not need to poll. GET /rest/v1/conversations/{id} lets you verify state, recover a missed delivery and debug while building. For attachments in both directions, see Webhooks.
Importing conversation history
POST /rest/v1/conversations/import brings conversations that happened somewhere else into Octocom: ticket history you're migrating from another help desk, or support handled in a system of your own that you want searchable alongside everything else. See the reference for the request format, and Migrate from another help desk for planning a migration.
- Batch size. Send up to 200 conversations per batch, with at most 5,000 messages plus internal notes in total and a 10 MiB JSON body.
- Rate. Imports allow 60 requests a minute per organization, plus budgets of 6,000 conversations and 30,000 messages and notes a minute, per organization and across the service. One batch per organization runs at a time, and tickets within a batch are processed in order. These are safety ceilings, not a promised processing rate. Start with small batches and increase gradually while checking latency and per-item results.
- Retries. Honor
Retry-Afteron429or503, back off with jitter, and keep each ticket'sexternalIdunchanged when retrying. Successful tickets in a partial batch are skipped as duplicates on retry, so keep the import resumable using per-item results. - Attachments. Add
files({url, name}) to a message to bring over its attachments, such as photos a customer sent. We download and store them, so they stay viewable after you close the old help desk. URLs must open without auth headers or redirects (signed links work). A batch can carry at most 10 files in total, and it gets 60 seconds of downloading, so send tickets with attachments in small batches. If a file can't be downloaded, the ticket is still imported without it: the message shows[Attachment not imported: name]and the result'swarningssay why. Files can't be added to a ticket after it's imported, so check your links work before you send. If the batch's 60 seconds ran out before a ticket's downloads started, or our storage failed, that ticket comes back as an error with nothing saved; resend it with the sameexternalId.
Two things to know before you use it:
Imported conversations are archive records, not live tickets. The AI agent never answers them, they're never routed into an agent queue, and they're read-only in the dashboard (an open one can only be closed). When the customer writes again, for example by replying to an old email, the message starts a new conversation that the AI agent and your team handle normally. Imported conversations are also excluded from bot quality scoring and automation metrics, so migrating years of history won't distort your reporting. If you need a thread your agents can keep working, don't import it: resolve it in your old system and let the customer's next reply open a normal Octocom conversation.
They're hidden from GET /rest/v1/conversations by default. Pass imported=yes to list only imported conversations, or imported=all for both. This applies whether or not you use the import endpoint yourself.
Every timestamp you supply is stored as given, so history keeps its real dates. Give each record an externalId from the source system and retries are safe: re-importing the same one returns status: "duplicate" instead of creating a second copy. Batches are applied per item rather than all-or-nothing, so read the per-item results rather than relying on the status code alone.
Product search
If Storefront search is set up for a business, the same search pipeline is available over REST: for a storefront you render server-side, a mobile app, or anywhere the browser SDK doesn't fit. Six POST endpoints, each taking the business's businessSlug:
| Endpoint | What it does | Rate limit |
|---|---|---|
/products/search | Full search for a typed query. | 60/min |
/products/search/suggest | Search-as-you-type panel: query completions, a few top hits, and category and brand facets. | 600/min |
/products/search/panel | Full search answered in the suggest panel's shape: results and facets, count and refinements. | 60/min |
/products/search/voice | Transcribe a recorded spoken query and search for it, in one request. | 30/min |
/products/search/image | Search by photo. | 30/min |
/products/search/similar | "More like this" for a product page. | 300/min |
/panel is /search and /suggest in one request. It runs the complete pipeline, so its ranking is /search's, and returns the same fields /suggest does: products, categories, brands, totalCount, suggestions, plus relaxed. Use it for a submitted query when you render the surrounding elements (a facet rail, a result count, "narrow your search" chips) yourself. Calling /search and /suggest together instead costs an extra search and produces chips that describe a differently ranked result set. /panel costs the same as /search; it is not a substitute for /suggest on each keystroke.
totalCount is the number of products matching the query at all, not the length of products, which is capped by topK. It is consistent with the page: 0 when low-confidence results were hidden, never more than a relevance cut kept, and null when it can't be counted reliably.
Every ranking endpoint answers with the same results array of { id, score, product }, where product is the unchanged product object as ingested from your store feed. You render it with the fields you already have; Octocom doesn't impose a product schema. Rate limits are per organization, and the business must belong to the organization of the API key.
A typed search:
curl https://api.octocom.ai/rest/v1/products/search \
-H "X-API-Key: $OCTOCOM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"businessSlug":"my-store","query":"black leather office chair","topK":20}'The same query with the panel data, for a results page that shows facets and a count alongside:
curl https://api.octocom.ai/rest/v1/products/search/panel \
-H "X-API-Key: $OCTOCOM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"businessSlug":"my-store","query":"black leather office chair","topK":20}'{
"data": {
"products": [
{
"id": "...",
"score": 0.82,
"product": { "...": "your feed's product" }
}
],
"suggestions": [
{ "text": "black leather office chair swivel", "role": "attribute" }
],
"categories": [
{ "text": "Office Chairs", "url": "https://...", "count": 34 }
],
"brands": [],
"totalCount": 41,
"relaxed": false
}
}Facet chips are only returned for values your feed gives a navigable URL for, so categories and brands come back empty for feeds that carry names but no links. That vocabulary still reaches you through suggestions, which need no URL.
Voice
Send one short recording containing a single spoken query. This is not a streaming endpoint: detect the end of speech on the client, then post the clip. The transcript goes through the same pipeline as a typed query, so you get the transcript and its results in one round trip.
Audio goes in the audio field, base64-encoded (a data: URL works too), up to 1 MB decoded: about 15 seconds, far more than a search query needs. audio/webm, ogg, mp4, mpeg, wav, aac and flac are accepted.
curl https://api.octocom.ai/rest/v1/products/search/voice \
-H "X-API-Key: $OCTOCOM_API_KEY" \
-H "Content-Type: application/json" \
-d "$(jq -n --arg audio "$(base64 -i query.webm)" \
'{businessSlug: "my-store", audio: $audio, mimeType: "audio/webm"}')"{
"data": {
"transcript": "black leather office chair",
"noSpeech": false,
"language": "en",
"results": [{ "id": "SKU-12345", "score": 0.83, "product": { "…": "…" } }],
"relaxed": false
}
}noSpeech: truemeans the recording carried nothing recognizable. It is a normal outcome, answered as200with no results. Tell the shopper "didn't catch that" rather than "no products match".- Language is detected among a small set of candidates rather than freely, which is much more accurate on a three-word utterance. Omit
languageto use the business's configured voice languages; pass one code ("el") to state it, or a comma-separated list ("lt,en,ru") to detect among them. The language actually heard comes back in the response. - Recognition is biased toward your catalog's own vocabulary, so brand and product names come through correctly.
- Pass
"mode": "transcribe"to get only the transcript and run the search yourself later, for a dictate-and-review flow where the shopper edits before submitting. - This endpoint doesn't depend on the dashboard's Voice search switch. That switch controls what shoppers get on your storefront; this endpoint is for your own authenticated backend.
Image
The photo is read by a vision model whose understanding drives retrieval directly. Send base64 in the image field (or a data: URL), up to 6 MB decoded, as image/jpeg, png, webp or gif. Downscale large photos to around 1024 px on the long edge first: it costs nothing in quality and removes most of the upload latency.
curl https://api.octocom.ai/rest/v1/products/search/image \
-H "X-API-Key: $OCTOCOM_API_KEY" \
-H "Content-Type: application/json" \
-d "$(jq -n --arg image "$(base64 -i chair.jpg)" \
'{businessSlug: "my-store", image: $image, mimeType: "image/jpeg", query: "in blue"}')"The optional query refines the photo ("in blue", "cheaper") rather than replacing it. The response adds saw, what the model read off the photo:
{ "data": { "results": [], "relaxed": false, "saw": ["office chair"] } }Show saw to the shopper ("Showing results for: office chair"). A misread photo then reads as a misread instead of looking like an empty catalog. This endpoint can't start retrieving until the photo is understood, so it is the slowest of the search endpoints.
If the model cannot read the photo in time, the search still answers: it uses the photo's nearest catalog images, or your query text when there are none, or returns empty results with confidence: "uncertain". confidence is "partial" when none of the results was recognized as the photographed product, so show them as similar-looking products rather than as the item itself. A 503 means a temporary failure; retry it.
saw is the item type read off the photo, not the query that was run. Retrieval also uses the color, material, size and setting the model read, which is what distinguishes the photographed product from the rest of its category. The full derived query is shown in the dashboard's Storefront Search preview if you need to debug a result.
Similar products
A "you may also like" row. Identify the product in one of two ways:
productId: the index ID, which is theidthe other search endpoints return. It is not necessarily your platform's product ID or SKU. On Shopify, for example, it is a hash of the product's GID, notproduct.id.productUrl: the product page URL, matched the same way the AI agent finds the product a shopper is viewing. This is the simplest option on a product page. If you send both, the URL is tried only when the ID isn't found.
curl https://api.octocom.ai/rest/v1/products/search/similar \
-H "X-API-Key: $OCTOCOM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"businessSlug":"my-store","productUrl":"https://my-store.com/products/aera-office-chair","topK":8}'{
"data": {
"results": [{ "id": "b41c09e2", "score": 0.71, "product": { "…": "…" } }],
"source": { "id": "7d3f5a10", "name": "Aera Office Chair" }
}
}source.id is the resolved index ID, so you can cache it and send it as productId next time. Results never include the source product, and are reranked using its own indexed type and category, which keeps, for example, a phone's cases out of its neighbors. source is null when neither the ID nor the URL matches a product in the catalog index; that is different from a product with no neighbors, and usually worth handling differently. This endpoint makes no model or embedding call, so it is the cheapest of the search endpoints and safe to call on every product page view.
Metrics report data
Pull the numbers behind your custom Metrics reports into your own BI tool, data warehouse or spreadsheet. Build the report once on the Metrics page (or ask Copilot to), then fetch each chart's rows on a schedule.
GET /rest/v1/metric-reportslists your reports, each with its charts. Note theidof every chart you want.GET /rest/v1/metric-charts/{chartId}/dataruns one chart and returns its rows.
curl -H "X-API-Key: $OCTOCOM_API_KEY" \
"https://api.octocom.ai/rest/v1/metric-charts/$CHART_ID/data?from=2026-10-01T00:00:00Z&to=2026-11-01T00:00:00Z&tz=Europe/Vilnius&bucket=week"The data endpoint takes the same inputs as the Metrics toolbar, all optional:
| Parameter | Default | Meaning |
|---|---|---|
from, to | the last 30 days | Period as ISO 8601 datetimes; from is inclusive, to exclusive |
tz | UTC | IANA timezone for day/week/month boundaries |
bucket | day | hour, day, week or month, for time series charts |
businessSlug | every business | Repeat for several businesses: businessSlug=shop&businessSlug=outlet |
filter[key] | no filter | A report custom filter value; repeat to select several values |
A chart only reacts to the parameters its SQL uses; each chart's variables list shows which. Rows come back with camelCased column names, plus chartConfig describing how the dashboard draws them.
- Shared reports only. API keys act for the organization, so personal reports stay private to their owner. Share a report to export it.
- Built-in tabs such as Overview are not saved reports and are not available here.
- Caching. Results are cached for up to 5 minutes, so polling more often returns the same rows with
cached: true. Uncached runs share your organization's query capacity with the dashboard and return429while it stays saturated. - Completeness.
rowLimitReached: truemeans the result hit the row limit and may be incomplete. Aggregate the chart or narrow the period.
Metric alerts
An alert watches one chart of a shared report and publishes a metric_alert event to your Python event handlers and webhooks when a series starts or stops meeting its condition. The alert decides when; your handler decides what happens. See Metric alerts for the rules, the payload and examples.
| Endpoint | Scope | What it does |
|---|---|---|
GET /rest/v1/metric-alerts | metrics:read | List alerts; filter with chartId or reportId |
GET /rest/v1/metric-alerts/{alertId} | metrics:read | One alert with its status |
GET /rest/v1/metric-alerts/{alertId}/events | metrics:read | Recent checks that published an event |
POST /rest/v1/metric-alerts/test | metrics:read | Replay a saved or unsaved alert over recent periods |
POST /rest/v1/metric-alerts | reports:write | Create an alert |
PATCH /rest/v1/metric-alerts/{alertId} | reports:write | Change an alert; omitted fields are unchanged |
DELETE /rest/v1/metric-alerts/{alertId} | reports:write | Delete an alert and its history |
curl -X POST -H "X-API-Key: $OCTOCOM_API_KEY" -H "Content-Type: application/json" \
https://api.octocom.ai/rest/v1/metric-alerts \
-d '{"chartId": "'$CHART_ID'", "name": "Topic spikes", "valueColumn": "conversations",
"splitBy": "topic", "period": "week", "timezone": "Europe/Vilnius",
"condition": {"type": "change", "direction": "increase", "percent": 25, "absolute": 10, "minBaseline": 20}}'REST API or MCP
Octocom offers two programmatic interfaces, and they complement each other:
- REST API: a fixed, versioned HTTP contract. Best for backend integrations, data pipelines, scheduled jobs, dashboards and anything you want to script deterministically.
- MCP: the same capabilities and more, exposed to AI agents such as Claude and ChatGPT, so an agent can configure, debug and test your setup from plain-language instructions. Best for hands-on, exploratory and "do this for me" work.
If you're writing code, start with the REST API. If you're driving an AI agent, use MCP. To receive events as they happen, add webhooks.
Need access or help?
Create API keys in Settings -> Workspace -> API keys. If anything in the reference is unclear, or your integration needs an operation the API does not offer, contact us. Requests from integrators shape what we add next.