API Reference
Search stored answers, record feedback, import documentation, and manage agent work over HTTPS. Requests use your Deskcite instance, such as https://deskcite.example.com, on standard HTTPS port 443. Omit the port in HTTPS and WSS URLs.
Examples use a placeholder hostname and illustrative data. /similar and /ask return stored answer passages; they do not generate a new reply.
Authentication
Sign in with POST /auth/login using user, password, and a current six-digit otp. Send the returned access_token as Authorization: Bearer TOKEN on protected requests.
Session tokens and path-scoped routing grants have different authorization rules; grants must cover the requested path and cannot call the session endpoints. Public access is configured by path, rather than HTTP method. The supplied configuration exposes /deskcite, including dispatch, and the UI shell publicly; dedicated search, imports, source documents, and agent routes require credentials.
Refresh with a still-valid session at POST /auth/refresh; it retires the old bearer. POST /auth/logout revokes the current session. Do not replay authenticator-consuming requests with a used code.
export BASE='https://deskcite.example.com'
# Set TOKEN to the access_token returned by your login client.
export TOKEN='YOUR_ACCESS_TOKEN'Responses and errors
Most Deskcite JSON failures contain {"ok":false,"error":"…"}. Authentication failures may have an empty body or a different JSON shape. Source-document responses are file bytes; WebSocket events are live frames. Check HTTP status before parsing success fields.
| Status | Meaning |
|---|---|
| 200 / 201 | Completed read or write; 201 creates a Q&A pair. |
| 202 | Background work accepted or already running; indexing or embedding is not yet confirmed complete. |
| 400 | Invalid JSON or request fields. |
| 401 / 403 | Missing, expired, or insufficient credentials; source-folder restrictions may deny access separately. |
| 404 / 405 | No match, missing route or record, or unsupported method. |
| 409 / 429 | Schedule version conflict or throttled authentication attempts. |
| 500 / 502 / 503 | Service failure, invalid model proposal, or unavailable dependency. |
PUT is a compatibility alias for POST only on forwarded Q&A, search, and dispatch routes. Import, embedding, and agent actions use their documented methods. DELETE does not remove knowledge; recognized forwarded routes return 405 and unknown routes return 404.
POST/auth/loginSign in
Authenticate with username, password, and current otp. Save access_token for protected requests. Do not automatically replay requests that consume an authenticator code.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| user | string | required | Account username. |
| password | string | required | Account password. |
| otp | string | required | Current six-digit authenticator code. |
Responses
200 — Sign in
| Field | Type | Required | Description |
|---|---|---|---|
| access_token | string | required | New session bearer token. |
| token_type | string | required | Values: Bearer. |
| expires_in | integer | required | Seconds until expiry. |
| expires_at | integer | required | Expiry as Unix seconds. |
400 — The request body was malformed or a required field was missing/invalid.
401 — Credentials missing, expired, invalid, or not authorized for this path. The router can return an empty 401 body.
429 — Authentication attempts throttled.
503 — Required database, embedding, agent, or other backing service is unavailable; inspect the returned error and service health.
Example request
curl --fail-with-body -X POST "$BASE/auth/login" \
-H 'Content-Type: application/json' \
--data '{"user": "worker@example.com", "password": "YOUR_PASSWORD", "otp": "123456"}'POST/auth/refreshRefresh session
Send a still-valid session bearer. Returns a new bearer and retires the old one; reusing the old token fails. No JSON body is needed.
Responses
200 — Refresh session
| Field | Type | Required | Description |
|---|---|---|---|
| access_token | string | required | New session bearer token. |
| token_type | string | required | Values: Bearer. |
| expires_in | integer | required | Seconds until expiry. |
| expires_at | integer | required | Expiry as Unix seconds. |
400 — The request body was malformed or a required field was missing/invalid.
401 — Credentials missing, expired, invalid, or not authorized for this path. The router can return an empty 401 body.
429 — Authentication attempts throttled.
503 — Required database, embedding, agent, or other backing service is unavailable; inspect the returned error and service health.
Example request
curl --fail-with-body -X POST "$BASE/auth/refresh" \
-H "Authorization: Bearer $TOKEN"POST/auth/logoutEnd session
Revoke the current session bearer. No JSON body is needed.
Responses
200 — End session
| Field | Type | Required | Description |
|---|---|---|---|
| logged_out | boolean | required |
{
"logged_out": true
}400 — The request body was malformed or a required field was missing/invalid.
401 — Credentials missing, expired, invalid, or not authorized for this path. The router can return an empty 401 body.
429 — Authentication attempts throttled.
503 — Required database, embedding, agent, or other backing service is unavailable; inspect the returned error and service health.
Example request
curl --fail-with-body -X POST "$BASE/auth/logout" \
-H "Authorization: Bearer $TOKEN"GET/deskciteService status
Returns the total number of questions, answers, and questions that have been embedded. The UI polls this endpoint on load to display the status pill.
Responses
200 — Counts retrieved successfully.
| Field | Type | Required | Description |
|---|---|---|---|
| ok | boolean | required | |
| questions | integer | required | Total number of question records. |
| answers | integer | required | Total number of answer records. |
| embedded | integer | required | Number of questions that have been embedded. |
{
"ok": true,
"questions": 1420,
"answers": 1402,
"embedded": 1398
}503 — Required database, embedding, agent, or other backing service is unavailable; inspect the returned error and service health.
401 — Credentials missing, expired, invalid, or not authorized for this path. The router can return an empty 401 body.
Example request
curl --fail-with-body -X GET "$BASE/deskcite" \
-H "Authorization: Bearer $TOKEN"POST/deskciteDispatch by op
Dispatch status, similar, ask, rate, question, search, or search_graph via op. question with id fetches a pair; otherwise it creates one. The status code and body depend on the operation, including 201 for creation. The supplied configuration makes /deskcite public for every method; deployments can restrict it. Prefer dedicated routes for integrations.
PUT is also accepted as a compatibility alias on this route.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| op | string | required | Name of the operation to dispatch. Values: status, similar, ask, rate, question, search, search_graph. |
| text | string | optional | Alias for q. |
| question | string | optional | Question text for creation; alias for text in semantic query operations. |
| n | integer | optional | Number of results (for similar). Default: 8. Range: 1–100. |
| id | string | optional | Question UUID (for rate, question fetch). |
| vote | string | optional | Rating value (for rate). Values: up, down, clear. |
| answer | string | optional | Answer text (for question create). |
| path | string | optional | Source document path (for question create). |
| segment | integer | optional | Paragraph index within the document (for question create). Default: 0. |
| headings | string | optional | Section heading breadcrumb (for question create). |
| q | string | optional | Query term. |
| types | string | optional | Comma-separated content-type filter. |
| document | string | optional | Restrict to a specific document path. |
| mode | string | optional | Default: subgraph. |
| hop | integer | optional | Default: 1. |
Responses
200 — Operation completed. Shape depends on `op`.
| Field | Type | Required | Description |
|---|---|---|---|
| ok | boolean | required |
400 — The request body was malformed or a required field was missing/invalid.
404 — Resource does not exist.
503 — Required database, embedding, agent, or other backing service is unavailable; inspect the returned error and service health.
201 — Question and answer created.
| Field | Type | Required | Description |
|---|---|---|---|
| ok | boolean | required | |
| id | string | required | UUID of the newly created question record. |
| answer_id | string | required | UUID of the newly created answer record. |
401 — Credentials missing, expired, invalid, or not authorized for this path. The router can return an empty 401 body.
Example request
curl --fail-with-body -X POST "$BASE/deskcite" \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
--data '{"op": "status"}'POST/deskcite/questionCreate Q&A pair
Insert a question and paired answer. Required fields are question, answer, and path. This does not upload the source document or start embedding. Call POST /deskcite/embed afterwards and verify search availability. Repeating this request can create another record.
PUT is also accepted as a compatibility alias on this route.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| question | string | required | Required question text. Send question; text is not an alias for question creation. |
| answer | string | required | The paired answer text. |
| path | string | required | Source document path, used for grouping and display. |
| segment | integer | optional | Zero-based paragraph index within the document. Default: 0. |
| headings | string | optional | Concatenated section headings above this segment. Default: empty string. |
Responses
201 — Q&A pair created.
| Field | Type | Required | Description |
|---|---|---|---|
| ok | boolean | required | |
| id | string | required | UUID of the newly created question record. |
| answer_id | string | required | UUID of the newly created answer record. |
{
"ok": true,
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"answer_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901"
}400 — The request body was malformed or a required field was missing/invalid.
503 — Required database, embedding, agent, or other backing service is unavailable; inspect the returned error and service health.
401 — Credentials missing, expired, invalid, or not authorized for this path. The router can return an empty 401 body.
Example request
curl --fail-with-body -X POST "$BASE/deskcite/question" \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
--data '{"question": "What is the default timeout?", "answer": "The default request timeout is 30 seconds.", "path": "docs/configuration.pod", "segment": 4, "headings": "Configuration > Timeouts"}'GET/deskcite/question/{id}Fetch Q&A pair
Retrieves a single question and its paired answer by UUID.
Parameters
| Name | Location | Description |
|---|---|---|
| id | path | UUID of the question record. |
Responses
200 — Q&A pair found.
| Field | Type | Required | Description |
|---|---|---|---|
| ok | boolean | required | |
| id | string | required | |
| question | string | required | |
| path | string | required | |
| segment | integer | required | |
| headings | string / null | required | |
| answer | string / null | required |
{
"ok": true,
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"question": "What is the default timeout?",
"path": "docs/configuration.pod",
"segment": 4,
"headings": "Configuration > Timeouts",
"answer": "The default request timeout is 30 seconds."
}400 — The supplied `id` is not a valid UUID.
404 — Resource does not exist.
503 — Required database, embedding, agent, or other backing service is unavailable; inspect the returned error and service health.
401 — Credentials missing, expired, invalid, or not authorized for this path. The router can return an empty 401 body.
Example request
curl --fail-with-body -X GET "$BASE/deskcite/question/a1b2c3d4-e5f6-7890-abcd-ef1234567890" \
-H "Authorization: Bearer $TOKEN"GET/deskcite/documents/{path}Fetch a source document
Fetch uploaded or mirrored source bytes. Use the source path returned by search; do not prepend /deskcite again. Folder restrictions are enforced separately from search visibility. The path may contain folder segments; do not send . or .. segments. Responses use Content-Disposition: inline and Cache-Control: no-store.
Parameters
| Name | Location | Description |
|---|---|---|
| path | path | Relative source path, including optional folders, such as recovery.md or support/recovery.md. |
Responses
200 — Source bytes; Content-Type follows the file extension.
403 — The account is not allowed to read this document folder.
404 — Resource does not exist.
401 — Credentials missing, expired, invalid, or not authorized for this path. The router can return an empty 401 body.
503 — Required database, embedding, agent, or other backing service is unavailable; inspect the returned error and service health.
Example request
curl --fail-with-body -X GET "$BASE/deskcite/documents/recovery.md" \
-H "Authorization: Bearer $TOKEN"POST/deskcite/similarSemantic similarity search
Return up to n individual stored-answer rows ordered by feedback-adjusted distance, not generated text. text must be nonempty; question is accepted as its alias. n is an integer from 1 to 100 (default 8); out-of-range values return 400. Empty matches return 200 with rows: []. The embedding service starts on demand and the first call can take longer.
PUT is also accepted as a compatibility alias on this route.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| text | string | optional | Query text. ( |
| n | integer | optional | Maximum number of results to return. Default: 8. Range: 1–100. |
| question | string | optional | Alias for text. |
Responses
200 — Rows returned in distance order.
| Field | Type | Required | Description |
|---|---|---|---|
| ok | boolean | required | |
| rows | array | required |
{
"ok": true,
"rows": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"question": "How do I configure TLS?",
"path": "docs/security.pod",
"segment": 2,
"headings": "Security > TLS",
"distance": 0.08,
"answer": "Place your cert.pem and key.pem in the certs/ directory.",
"vote": null
}
]
}400 — The request body was malformed or a required field was missing/invalid.
503 — Required database, embedding, agent, or other backing service is unavailable; inspect the returned error and service health.
401 — Credentials missing, expired, invalid, or not authorized for this path. The router can return an empty 401 body.
Example request
curl --fail-with-body -X POST "$BASE/deskcite/similar" \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
--data '{"text": "How do I set up TLS certificates?", "n": 5}'POST/deskcite/askBest-match answer
Return the single nearest stored-answer row with ok: true, rather than a rows array. This does not generate a new answer. text must be nonempty; question is accepted as its alias. No match returns 404 with error: no matching answer.
PUT is also accepted as a compatibility alias on this route.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| text | string | optional | Question text. ( |
| question | string | optional | Alias for text. |
Responses
200 — Closest matching answer.
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | Question UUID. |
| question | string | required | The stored question text. |
| path | string | required | Source document path. |
| segment | integer | required | Paragraph index within the document. |
| headings | string / null | required | Section heading breadcrumb, or null. |
| distance | number | required | Feedback-adjusted distance; smaller values rank better. This is not a confidence probability. Down-votes divide matching-answer similarity by four before it is converted back to distance. |
| answer | string / null | required | Paired answer text, or null if none stored. |
| vote | string / null | required | Rating for this normalized query and question record, shared across users; null when no rating is stored. Values: up, down, null. |
| ok | boolean | required |
{
"ok": true,
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"question": "How do I configure TLS?",
"path": "docs/security.pod",
"segment": 2,
"headings": "Security > TLS",
"distance": 0.08,
"answer": "Place your cert.pem and key.pem in the certs/ directory.",
"vote": null
}400 — The request body was malformed or a required field was missing/invalid.
404 — No matching stored answer.
503 — Required database, embedding, agent, or other backing service is unavailable; inspect the returned error and service health.
401 — Credentials missing, expired, invalid, or not authorized for this path. The router can return an empty 401 body.
Example request
curl --fail-with-body -X POST "$BASE/deskcite/ask" \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
--data '{"text": "How do I configure TLS?"}'GET/deskcite/searchFull-text search
Full-text pipeline search over documents, sections, and images via
the erag backend. Returns a rows array of matching chunks. A blank
q returns an empty result immediately (no embedding required).
text and question are accepted as aliases for q. types is a
comma-separated filter (e.g. document,section). document pins the
search to a specific source document path.
Requires the erag service to be available; returns 503 when it is not.
Parameters
| Name | Location | Description |
|---|---|---|
| q | query | Search query. Aliases `text` and `question` are also accepted. |
| types | query | Comma-separated content type filter (document, section, image). |
| document | query | Restrict results to a specific document path. |
Responses
200 — Backend-dependent erag result: normally rows for search or graph for graph search; other results use result.
400 — The request body was malformed or a required field was missing/invalid.
503 — Required database, embedding, agent, or other backing service is unavailable; inspect the returned error and service health.
401 — Credentials missing, expired, invalid, or not authorized for this path. The router can return an empty 401 body.
Example request
curl --fail-with-body -X GET "$BASE/deskcite/search?q=recovery" \
-H "Authorization: Bearer $TOKEN"POST/deskcite/searchFull-text search (POST)
Same pipeline as GET, with a JSON body. Body fields override query-string fields with the same name. q accepts text and question as aliases. Empty q returns an empty pipeline result.
PUT is also accepted as a compatibility alias on this route.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| q | string | optional | Query text. |
| types | string | optional | Comma-separated content-type filter. |
| document | string | optional | Restrict to a specific document path. |
| text | string | optional | Alias for q. |
| question | string | optional | Alias for q. |
Responses
200 — Backend-dependent erag result: normally rows for search or graph for graph search; other results use result.
400 — The request body was malformed or a required field was missing/invalid.
503 — Required database, embedding, agent, or other backing service is unavailable; inspect the returned error and service health.
401 — Credentials missing, expired, invalid, or not authorized for this path. The router can return an empty 401 body.
Example request
curl --fail-with-body -X POST "$BASE/deskcite/search" \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
--data '{"q": "TLS certificate configuration", "types": "document,section"}'GET/deskcite/search/graphGraph search
Returns a subgraph of related documents centered on the query, using
the erag graph pipeline. mode defaults to subgraph; hop
controls how many hops to expand (default 1).
Parameters
| Name | Location | Description |
|---|---|---|
| q | query | Query term. |
| mode | query | Graph traversal mode. |
| hop | query | Number of hops to expand. |
Responses
200 — Backend-dependent erag result: normally rows for search or graph for graph search; other results use result.
503 — Required database, embedding, agent, or other backing service is unavailable; inspect the returned error and service health.
401 — Credentials missing, expired, invalid, or not authorized for this path. The router can return an empty 401 body.
Example request
curl --fail-with-body -X GET "$BASE/deskcite/search/graph?q=recovery" \
-H "Authorization: Bearer $TOKEN"POST/deskcite/search/graphGraph search (POST)
Same pipeline as GET, with a JSON body. Body fields override query-string fields with the same name. q accepts text and question as aliases. Empty q returns an empty pipeline result.
PUT is also accepted as a compatibility alias on this route.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| q | string | optional | Query term. |
| mode | string | optional | Default: subgraph. |
| hop | integer | optional | Default: 1. |
| text | string | optional | Alias for q. |
| question | string | optional | Alias for q. |
Responses
200 — Backend-dependent erag result: normally rows for search or graph for graph search; other results use result.
503 — Required database, embedding, agent, or other backing service is unavailable; inspect the returned error and service health.
401 — Credentials missing, expired, invalid, or not authorized for this path. The router can return an empty 401 body.
400 — The request body was malformed or a required field was missing/invalid.
Example request
curl --fail-with-body -X POST "$BASE/deskcite/search/graph" \
-H "Authorization: Bearer $TOKEN"POST/deskcite/rateRate an answer
Store up, down, or clear for the original normalized query text and question id. Ratings are shared across users. A down-vote penalizes matching answer text in future semantic searches; distinct query texts can add further penalties. Up or clear removes that query’s down-vote penalty rather than guaranteeing first place. Clearing returns vote: null. Rerun a search to see the result.
PUT is also accepted as a compatibility alias on this route.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | UUID of the question record being rated. |
| text | string | required | The query text that surfaced this result. Leading/trailing whitespace is stripped and collapsed before storage. |
| vote | string | required | up marks helpful; down divides matching-answer similarity by four in later semantic searches; clear removes the query-specific mark. The returned distance is adjusted from similarity rather than multiplied directly. Values: up, down, clear. |
Responses
200 — Rating stored.
| Field | Type | Required | Description |
|---|---|---|---|
| ok | boolean | required | |
| id | string | required | |
| vote | string / null | required | The stored vote, or null if cleared. Values: up, down, null. |
{
"ok": true,
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"vote": "up"
}400 — The request body was malformed or a required field was missing/invalid.
404 — No question found with that UUID.
503 — Required database, embedding, agent, or other backing service is unavailable; inspect the returned error and service health.
401 — Credentials missing, expired, invalid, or not authorized for this path. The router can return an empty 401 body.
Example request
curl --fail-with-body -X POST "$BASE/deskcite/rate" \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
--data '{"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "text": "How do I configure TLS?", "vote": "up"}'POST/deskcite/importImport a source
Submit a URL to mirror, or a file with name and content. Binary files such as PDF use encoding: base64. 202 acknowledges accepted work, not successful indexing. There is no durable job id or per-job polling endpoint. Follow import events and verify search availability; resubmission can repeat work.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| url | string | optional | URL to mirror and index. A nonempty URL takes precedence over the file form. |
| name | string | optional | Uploaded filename. |
| content | string | optional | File text, or base64 for binary input. |
| encoding | string | optional | Use base64 for binary input, such as PDF. Values: utf8, base64. Default: utf8. |
| folder | string | optional | Optional storage subfolder. Default: empty string. |
Responses
202 — Import a source
| Field | Type | Required | Description |
|---|---|---|---|
| ok | boolean | required | |
| status | string | required | Values: queued. |
| source | string | required | Submitted URL or filename; not a unique job id. |
{
"ok": true,
"status": "queued",
"source": "recovery.md"
}401 — Credentials missing, expired, invalid, or not authorized for this path. The router can return an empty 401 body.
400 — The request body was malformed or a required field was missing/invalid.
503 — Required database, embedding, agent, or other backing service is unavailable; inspect the returned error and service health.
Example request
curl --fail-with-body -X POST "$BASE/deskcite/import" \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
--data '{"name": "recovery.md", "content": "# Recovery\nFollow the account recovery procedure."}'POST/deskcite/embedEmbed pending questions
Queue one backfill pass for questions missing vectors. No body is needed. 202 returns queued when accepted or running if a pass is already active; neither means completion. Compare questions and embedded in GET /deskcite and search for the new records.
Responses
202 — Embed pending questions
| Field | Type | Required | Description |
|---|---|---|---|
| ok | boolean | required | |
| status | string | required | Values: queued, running. |
{
"ok": true,
"status": "queued"
}401 — Credentials missing, expired, invalid, or not authorized for this path. The router can return an empty 401 body.
400 — The request body was malformed or a required field was missing/invalid.
503 — Required database, embedding, agent, or other backing service is unavailable; inspect the returned error and service health.
Example request
curl --fail-with-body -X POST "$BASE/deskcite/embed" \
-H "Authorization: Bearer $TOKEN"GET/deskcite/agentsAgent snapshot
Return shared task counts, graph nodes, and activity. Active document imports are included in running counts. If agent persistence is unavailable, agent is false and its collections are empty; import state can still be reported.
Responses
200 — Agent snapshot
| Field | Type | Required | Description |
|---|---|---|---|
| agent | boolean | required | Whether agent persistence is available. |
| counts | object | required | |
| nodes | array | required | |
| activity | array | required |
401 — Credentials missing, expired, invalid, or not authorized for this path. The router can return an empty 401 body.
503 — Required database, embedding, agent, or other backing service is unavailable; inspect the returned error and service health.
Example request
curl --fail-with-body -X GET "$BASE/deskcite/agents" \
-H "Authorization: Bearer $TOKEN"GET/deskcite/agents/schedulesList schedules and runs
Return schedules, recent runs, timezone, calendar occurrences, and cron synchronization status. When the scheduler is unavailable, agent and cron_running are false and the returned collections are empty.
Responses
200 — List schedules and runs
| Field | Type | Required | Description |
|---|---|---|---|
| agent | boolean | required | |
| items | array | required | |
| runs | array | required | |
| occurrences | array | optional | |
| timezone | string | required | |
| cron_status | string | required | |
| cron_running | boolean | required |
401 — Credentials missing, expired, invalid, or not authorized for this path. The router can return an empty 401 body.
503 — Required database, embedding, agent, or other backing service is unavailable; inspect the returned error and service health.
Example request
curl --fail-with-body -X GET "$BASE/deskcite/agents/schedules" \
-H "Authorization: Bearer $TOKEN"POST/deskcite/agents/tasksCancel queued tasks
Only action: cancel_queued is supported. Cancels pending tasks; it does not stop already running imports. The result comes from agent persistence.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| action | string | required | Values: cancel_queued. |
Responses
200 — Cancel queued tasks
401 — Credentials missing, expired, invalid, or not authorized for this path. The router can return an empty 401 body.
400 — The request body was malformed or a required field was missing/invalid.
503 — Required database, embedding, agent, or other backing service is unavailable; inspect the returned error and service health.
Example request
curl --fail-with-body -X POST "$BASE/deskcite/agents/tasks" \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
--data '{"action": "cancel_queued"}'POST/deskcite/agents/scheduleManage a schedule
Actions: save, toggle, propose, calendar. save requires name, objective, kind, enabled, and cron or run_at. For edits, send id and current version; conflicts return 409. toggle takes id, version, and enabled; the app sends the complete schedule. Check cron_status after writes. propose accepts prompt and returns a timing proposal or clarifying question; review and save it separately. calendar accepts start/end Unix seconds with end greater than start and a maximum 43-day range. Responses depend on the action; proposals do not automatically enable schedules.
Request body
Save
| Field | Type | Required | Description |
|---|---|---|---|
| action | string | required | Values: save. |
| name | string | required | Schedule name. |
| objective | string | required | Goal text. |
| kind | string | required | Values: cron, once. |
| cron | string | optional | Five standard cron fields; required for kind cron. |
| run_at | string | optional | Future timestamp with timezone; required for kind once. |
| enabled | boolean | required | |
| id | string | optional | Existing schedule id when editing. |
| version | integer | optional | Current version when editing. |
Toggle
| Field | Type | Required | Description |
|---|---|---|---|
| action | string | required | Values: toggle. |
| id | string | required | |
| version | integer | required | |
| enabled | boolean | required |
Propose
| Field | Type | Required | Description |
|---|---|---|---|
| action | string | required | Values: propose. |
| prompt | string | required | Describe the desired timing. |
Calendar
| Field | Type | Required | Description |
|---|---|---|---|
| action | string | required | Values: calendar. |
| start | integer | required | Range start in Unix seconds. |
| end | integer | required | Greater than start; range at most 43 days. |
Responses
200 — Manage a schedule
409 — Schedule changed; reload the current version and retry.
502 — The model did not return a valid schedule proposal.
401 — Credentials missing, expired, invalid, or not authorized for this path. The router can return an empty 401 body.
400 — The request body was malformed or a required field was missing/invalid.
503 — Required database, embedding, agent, or other backing service is unavailable; inspect the returned error and service health.
Example request
curl --fail-with-body -X POST "$BASE/deskcite/agents/schedule" \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
--data '{"action": "save", "name": "Daily review", "objective": "Review new documentation for unresolved questions.", "kind": "cron", "cron": "0 9 * * 1-5", "enabled": false}'WSS/deskcite/eventsLive import events
Upgrade to wss://HOST/deskcite/events on port 443. Browser clients use new WebSocket(url, ["json", TOKEN]); the bearer is the second subprotocol value. Native clients can send Authorization: Bearer TOKEN and subprotocol json. Receive live import.start, import.progress, import.done, and import.error messages. No replay or durable job-id guarantee; correlate by source. Reconnect with valid credentials when required.
Responses
101 — WebSocket connection established; subsequent text frames carry import-event JSON.
401 — Credentials missing, expired, invalid, or not authorized for this path. The router can return an empty 401 body.
Event fields
| Field | Type | Required | Description |
|---|---|---|---|
| deskcite | boolean | optional | |
| events | boolean | optional | |
| type | string | required | Values: import.start, import.progress, import.done, import.error. |
| source | string | required | Submitted URL or filename; concurrent identical sources are ambiguous. |
| ts | integer | required | Event time in Unix milliseconds. |
| msg | string | optional | Optional progress, completion, or failure detail. |
const events = new WebSocket(
"wss://deskcite.example.com/deskcite/events",
["json", TOKEN]
);
events.onmessage = event => console.log(JSON.parse(event.data));