Skip to main content

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. Send query 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 optional title 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
Distinguish a 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’s tool, 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
Approve:
cURL
Node.js
200
The approval window expires five minutes after the gate was raised — a 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-language description 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 with id, 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
Replay messages:
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

A 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

A 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

A 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

The 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

Rotate the session or return control to the operator; do not re-fire immediately.

60-second retry matrix


Search the Orbit knowledge base

GET /api/v1/orby/kb/search
Hybrid search over the Orbit product-docs index. Pass query (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/status
Super-admin only. Returns a 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. Operator-session auth only — API-key-authenticated requests are rejected.

List the operator’s Orby threads

GET /api/v1/orby/threads
Returns up to the 50 most recent Orby conversation threads for the authenticated operator (the dashboard ‘Past chats’ panel), each with id, 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}/messages
Replays a thread’s persisted message log (oldest-first) so the dashboard can re-render conversation history on reload. Returns each message’s id, 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.
string
required
—

Get a pending Orby tool action

GET /api/v1/orby/tool-actions/{id}
Polls the status of a pending Orby tool action (the confirmation card polls this after approve to surface the result and cost). Returns the action’s 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.
string
required
—

Start or continue an Orby assistant turn (SSE stream)

POST /api/v1/orby/assistant
Runs one Orby operator-assistant 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. Operator-session auth only — API-key-authenticated requests are rejected.
string
required
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.
string
Existing thread to continue — omit to start a new one (or mint it ahead of time via POST /orby/threads).
object
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-setting
“Where do I configure X” helper — resolves a natural-language description 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.
string
required
Natural-language task description (1–500 chars) — e.g. ‘stop messages during quiet hours’.
number
Max matches to return (default 10, max 20).

Trigger an Orby knowledge-base reindex

POST /api/v1/orby/kb/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.

Create an Orby thread

POST /api/v1/orby/threads
Pre-allocates a new Orby conversation thread before the first user message (the FE pre-allocation flow). Accepts an optional title 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.
string
Optional initial thread title (auto-titled from the first message when omitted).
object
Optional dashboard context recorded as the thread’s start page.

Approve a pending Orby tool action

POST /api/v1/orby/tool-actions/{id}/approve
Approves and executes a pending Orby tool action that paused a turn on a confirmation gate (the tool_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.
string
required
—

Reject a pending Orby tool action

POST /api/v1/orby/tool-actions/{id}/reject
Cancels a pending Orby tool action raised by a confirmation gate, marking it cancelled without executing it. Same ownership rules as approve. Returns the action id and status. Operator-session auth only — API-key-authenticated requests are rejected.
string
required
—