Orby API
Orby endpoints exposed by the Devotel CPaaS API Base path:/api/v1/orby
Endpoint count: 11
title: “Worked sequences — Orby assistant chains” description: “End-to-end request and response envelopes for the eight Orby operations most integrations run — search, threads, assistant turns, tool-action approval, settings lookup, thread replay, reindex, and index status.”
Worked sequences — Orby assistant chains
Eight operations cover the Orby surface most integrations actually run: grounding search, thread pre-allocation, streamed assistant turns, the tool-action approval gate, the “where do I configure X” settings lookup, thread replay on reload, knowledge-base reindex, and index health. Each sequence below shows the body you send and the body the API returns. All Orby routes are operator-session only: authenticate with a dashboard Bearer token (Authorization: Bearer $ORBIT_OPERATOR_JWT), not
an X-API-Key. Key-authenticated requests are rejected with
403 ORBY_SESSION_REQUIRED. Reindex and index status additionally require
the super-admin role.
1. Search the Orbit knowledge base
Hybrid search over the Orbit product-docs index. Sendquery and an
optional limit (default 10, max 50). Returns ranked data.results,
each with doc_id, title, section, category, url, snippet,
score, and last_updated_at. While the index is cold or reindexing the
endpoint degrades to an empty result set with a kb_outage_hint instead
of erroring.
cURL
Node.js
200
2. Create an Orby thread
Pre-allocates a new Orby conversation thread before the first user message (the dashboard pre-allocation flow). Accepts an optionaltitle
and page context; returns the new thread’s id, title, and
created_at / updated_at timestamps.
cURL
Node.js
200
3. Start an Orby assistant turn (SSE stream)
Runs one Orby turn and streams the result as Server-Sent Events (text/event-stream): router, status, token, tool_start,
tool_pending, tool_end, refusal, clarify, response, and
error frames. Send { message, thread_id?, page? } — omit
thread_id to start a new thread. Rate-limited to 60 turns/min per
operator.
cURL
Node.js
SSE 200
tool_pending event (paused on a confirmation gate —
approve it with POST /api/v1/orby/tool-actions/{id}/approve) from
token deltas (the answer, safe to render in UI). The response frame
closes the turn with turn_id + thread_id; feed thread_id back on
the next turn to continue the thread.
4. Get a pending Orby tool action and approve it
Poll the pending action the turn paused on. Returns the action’stool,
args, cost_estimate_cents, status, result, error_code /
error_message, and created_at / expires_at / executed_at /
cancelled_at timestamps. A pending row past its five-minute window is
lazily flipped to cancelled.
Poll:
cURL
Node.js
200
cURL
Node.js
200
409 returns error.details.id plus the current status when the row
is already terminal.
5. Find the dashboard setting for a described task
“Where do I configure X” helper — resolves a natural-languagedescription to the dashboard settings that control it. Returns ranked
data.matches, each with setting_path, dashboard_url, label,
description, doc_url, snippet, and score. Degrades to an empty
result with a kb_outage_hint while the knowledge base is initialising.
cURL
Node.js
200
6. List the operator’s Orby threads and a thread’s messages
List up to the 50 most recent threads (the dashboard Past-chats panel) — each withid, title, metadata, and created_at / updated_at /
archived_at timestamps — then replay one thread’s persisted message log
(oldest-first) so the dashboard can re-render history on reload.
List threads:
cURL
Node.js
200
cURL
Node.js
200
7. Trigger an Orby knowledge-base reindex
Super-admin only. Triggers a manual reindex of the Orbit docs corpus. Runs inline when the docs source is mounted on the pod, otherwise schedules the reindex for the background worker. Returns{ scheduled, ran_inline, error }. Operator-session auth only —
API-key-authenticated requests are rejected. Tenant knowledge bases use
the same trigger-then-poll contract with job handles — see the
knowledge-bases endpoints
refresh and sync samples, which share this page’s queued →
succeeded status vocabulary.
cURL
Node.js
200
8. Read index status
Super-admin only. Health snapshot of the Orby docs index: collection name and shape, total and stale chunk counts, last reindex timestamp, current version, and in-process cache statistics.cURL
Node.js
200
Errors worth branching on
These failures cover the assistant turn (POST /api/v1/orby/assistant), the heartbeat of every copilot chat. Each block below is a full{ error, meta } envelope as the API returns it, and the matrix at the
bottom answers retry vs surface. For the platform-wide decision table
these branches plug into, see the
error handling guide.
401 — Unauthorized
401 on this page is the session token failing before the route ran —
it never means the resource is wrong. Re-mint the dashboard session or
rotate the scoped token; retrying the same request changes nothing.
403 — Forbidden
403 on Orby usually means the request arrived with an X-API-Key
instead of a session Bearer token — Orby routes are operator-session
only. Super-admin-only routes (/kb/reindex, /kb/status) also return
403 with INSUFFICIENT_PERMISSIONS for non-admin roles.
422 — Schema
422 means the payload did not match the request schema — branch on
error.details.field and open a new thread and re-fire the same prompt
against the fresh thread id instead of blind-retrying the same body.
429 — Rate
Retry-After header and error.details.retry_after are both set on
every 429 — resend the SAME request after the lower of the two.
402 — Feature gate
60-second retry matrix
Search the Orbit knowledge base
GET /api/v1/orby/kb/searchquery (required) plus an optional limit (default 10, max 50) and a section/category filter. Returns ranked results, each with doc_id, title, section, category, url, snippet, score, and last_updated_at. While the index is cold or reindexing the endpoint degrades to an empty result set with a kb_outage_hint instead of erroring. Available to any authenticated operator role. Operator-session auth only — API-key-authenticated requests are rejected.
Get Orby knowledge-base index status
GET /api/v1/orby/kb/statusList the operator’s Orby threads
GET /api/v1/orby/threadsid, title, metadata, and created_at / updated_at / archived_at timestamps. Operator-session auth only — API-key-authenticated requests are rejected.
List an Orby thread’s messages
GET /api/v1/orby/threads/{id}/messagesid, role, content, and created_at; responds 404 if the thread is not owned by the caller. Operator-session auth only — API-key-authenticated requests are rejected.
Get a pending Orby tool action
GET /api/v1/orby/tool-actions/{id}tool, args, cost_estimate_cents, status, result, error_code / error_message, and created_at / expires_at / executed_at / cancelled_at. A pending row past its 5-minute window is lazily flipped to cancelled. Operator-session auth only — API-key-authenticated requests are rejected.
Start or continue an Orby assistant turn (SSE stream)
POST /api/v1/orby/assistanttext/event-stream): router, status, token, tool_start, tool_pending, tool_end, refusal, clarify, response, and error frames. Send { message, thread_id?, page? } — omit thread_id to start a new thread. Rate-limited to 60 turns/min per operator. Operator-session auth only — API-key-authenticated requests are rejected.
The operator’s prompt (1–8000 chars). On a thread with an open confirmation gate, a bare
confirm / cancel resolves the pending tool action without an LLM round-trip.Existing thread to continue — omit to start a new one (or mint it ahead of time via POST /orby/threads).
Optional dashboard context (
{ page, contextRef, contextLabel }) — lets Orby route page-specific questions.Find the dashboard setting for a described task
POST /api/v1/orby/kb/find-settingdescription to the dashboard settings that control it. Returns ranked matches, each with setting_path, dashboard_url, label, description, doc_url, snippet, and score. Degrades to an empty result with a kb_outage_hint while the knowledge base is initialising. Available to any authenticated operator role. Operator-session auth only — API-key-authenticated requests are rejected.
Natural-language task description (1–500 chars) — e.g. ‘stop messages during quiet hours’.
Trigger an Orby knowledge-base reindex
POST /api/v1/orby/kb/reindex{ scheduled, ran_inline, error }. Operator-session auth only — API-key-authenticated requests are rejected.
Create an Orby thread
POST /api/v1/orby/threadstitle and page context and returns the new thread’s id, title, and created_at / updated_at timestamps. Operator-session auth only — API-key-authenticated requests are rejected.
Approve a pending Orby tool action
POST /api/v1/orby/tool-actions/{id}/approvetool_pending SSE event). Ownership is enforced on the original operator and organization, and the persisted arguments are re-validated and re-authorized before execution. Returns the pending action id, terminal status, and the executor result. The approval window expires 5 minutes after the gate was raised. Operator-session auth only — API-key-authenticated requests are rejected.
Reject a pending Orby tool action
POST /api/v1/orby/tool-actions/{id}/rejectcancelled without executing it. Same ownership rules as approve. Returns the action id and status. Operator-session auth only — API-key-authenticated requests are rejected.