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.

StatusMeaning
200 / 201Completed read or write; 201 creates a Q&A pair.
202Background work accepted or already running; indexing or embedding is not yet confirmed complete.
400Invalid JSON or request fields.
401 / 403Missing, expired, or insufficient credentials; source-folder restrictions may deny access separately.
404 / 405No match, missing route or record, or unsupported method.
409 / 429Schedule version conflict or throttled authentication attempts.
500 / 502 / 503Service 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

FieldTypeRequiredDescription
userstringrequired

Account username.

passwordstringrequired

Account password.

otpstringrequired

Current six-digit authenticator code.

Responses

200400401429503

200 — Sign in

FieldTypeRequiredDescription
access_tokenstringrequired

New session bearer token.

token_typestringrequired

Values: Bearer.

expires_inintegerrequired

Seconds until expiry.

expires_atintegerrequired

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

200400401429503

200 — Refresh session

FieldTypeRequiredDescription
access_tokenstringrequired

New session bearer token.

token_typestringrequired

Values: Bearer.

expires_inintegerrequired

Seconds until expiry.

expires_atintegerrequired

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

200400401429503

200 — End session

FieldTypeRequiredDescription
logged_outbooleanrequired
{
  "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

200503401

200 — Counts retrieved successfully.

FieldTypeRequiredDescription
okbooleanrequired
questionsintegerrequired

Total number of question records.

answersintegerrequired

Total number of answer records.

embeddedintegerrequired

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

FieldTypeRequiredDescription
opstringrequired

Name of the operation to dispatch. Values: status, similar, ask, rate, question, search, search_graph.

textstringoptional

Alias for q.

questionstringoptional

Question text for creation; alias for text in semantic query operations.

nintegeroptional

Number of results (for similar). Default: 8. Range: 1–100.

idstringoptional

Question UUID (for rate, question fetch).

votestringoptional

Rating value (for rate). Values: up, down, clear.

answerstringoptional

Answer text (for question create).

pathstringoptional

Source document path (for question create).

segmentintegeroptional

Paragraph index within the document (for question create). Default: 0.

headingsstringoptional

Section heading breadcrumb (for question create).

qstringoptional

Query term.

typesstringoptional

Comma-separated content-type filter.

documentstringoptional

Restrict to a specific document path.

modestringoptional

Default: subgraph.

hopintegeroptional

Default: 1.

Responses

200400404503201401

200 — Operation completed. Shape depends on `op`.

FieldTypeRequiredDescription
okbooleanrequired

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.

FieldTypeRequiredDescription
okbooleanrequired
idstringrequired

UUID of the newly created question record.

answer_idstringrequired

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

FieldTypeRequiredDescription
questionstringrequired

Required question text. Send question; text is not an alias for question creation.

answerstringrequired

The paired answer text.

pathstringrequired

Source document path, used for grouping and display.

segmentintegeroptional

Zero-based paragraph index within the document. Default: 0.

headingsstringoptional

Concatenated section headings above this segment. Default: empty string.

Responses

201400503401

201 — Q&A pair created.

FieldTypeRequiredDescription
okbooleanrequired
idstringrequired

UUID of the newly created question record.

answer_idstringrequired

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

NameLocationDescription
idpathUUID of the question record.

Responses

200400404503401

200 — Q&A pair found.

FieldTypeRequiredDescription
okbooleanrequired
idstringrequired
questionstringrequired
pathstringrequired
segmentintegerrequired
headingsstring / nullrequired
answerstring / nullrequired
{
  "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

NameLocationDescription
pathpathRelative source path, including optional folders, such as recovery.md or support/recovery.md.

Responses

200403404401503

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

FieldTypeRequiredDescription
textstringoptional

Query text. (question is also accepted.)

nintegeroptional

Maximum number of results to return. Default: 8. Range: 1–100.

questionstringoptional

Alias for text.

Responses

200400503401

200 — Rows returned in distance order.

FieldTypeRequiredDescription
okbooleanrequired
rowsarrayrequired
{
  "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

FieldTypeRequiredDescription
textstringoptional

Question text. (question is also accepted.)

questionstringoptional

Alias for text.

Responses

200400404503401

200 — Closest matching answer.

FieldTypeRequiredDescription
idstringrequired

Question UUID.

questionstringrequired

The stored question text.

pathstringrequired

Source document path.

segmentintegerrequired

Paragraph index within the document.

headingsstring / nullrequired

Section heading breadcrumb, or null.

distancenumberrequired

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.

answerstring / nullrequired

Paired answer text, or null if none stored.

votestring / nullrequired

Rating for this normalized query and question record, shared across users; null when no rating is stored. Values: up, down, null.

okbooleanrequired
{
  "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?"}'

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

NameLocationDescription
qquerySearch query. Aliases `text` and `question` are also accepted.
typesqueryComma-separated content type filter (document, section, image).
documentqueryRestrict results to a specific document path.

Responses

200400503401

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

FieldTypeRequiredDescription
qstringoptional

Query text. text and question are also accepted.

typesstringoptional

Comma-separated content-type filter.

documentstringoptional

Restrict to a specific document path.

textstringoptional

Alias for q.

questionstringoptional

Alias for q.

Responses

200400503401

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

NameLocationDescription
qqueryQuery term.
modequeryGraph traversal mode.
hopqueryNumber of hops to expand.

Responses

200503401

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

FieldTypeRequiredDescription
qstringoptional

Query term.

modestringoptional

Default: subgraph.

hopintegeroptional

Default: 1.

textstringoptional

Alias for q.

questionstringoptional

Alias for q.

Responses

200503401400

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

FieldTypeRequiredDescription
idstringrequired

UUID of the question record being rated.

textstringrequired

The query text that surfaced this result. Leading/trailing whitespace is stripped and collapsed before storage.

votestringrequired

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

200400404503401

200 — Rating stored.

FieldTypeRequiredDescription
okbooleanrequired
idstringrequired
votestring / nullrequired

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

FieldTypeRequiredDescription
urlstringoptional

URL to mirror and index. A nonempty URL takes precedence over the file form.

namestringoptional

Uploaded filename.

contentstringoptional

File text, or base64 for binary input.

encodingstringoptional

Use base64 for binary input, such as PDF. Values: utf8, base64. Default: utf8.

folderstringoptional

Optional storage subfolder. Default: empty string.

Responses

202401400503

202 — Import a source

FieldTypeRequiredDescription
okbooleanrequired
statusstringrequired

Values: queued.

sourcestringrequired

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

202401400503

202 — Embed pending questions

FieldTypeRequiredDescription
okbooleanrequired
statusstringrequired

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

200401503

200 — Agent snapshot

FieldTypeRequiredDescription
agentbooleanrequired

Whether agent persistence is available.

countsobjectrequired
nodesarrayrequired
activityarrayrequired

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

200401503

200 — List schedules and runs

FieldTypeRequiredDescription
agentbooleanrequired
itemsarrayrequired
runsarrayrequired
occurrencesarrayoptional
timezonestringrequired
cron_statusstringrequired
cron_runningbooleanrequired

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

FieldTypeRequiredDescription
actionstringrequired

Values: cancel_queued.

Responses

200401400503

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

FieldTypeRequiredDescription
actionstringrequired

Values: save.

namestringrequired

Schedule name.

objectivestringrequired

Goal text.

kindstringrequired

Values: cron, once.

cronstringoptional

Five standard cron fields; required for kind cron.

run_atstringoptional

Future timestamp with timezone; required for kind once.

enabledbooleanrequired
idstringoptional

Existing schedule id when editing.

versionintegeroptional

Current version when editing.

Toggle

FieldTypeRequiredDescription
actionstringrequired

Values: toggle.

idstringrequired
versionintegerrequired
enabledbooleanrequired

Propose

FieldTypeRequiredDescription
actionstringrequired

Values: propose.

promptstringrequired

Describe the desired timing.

Calendar

FieldTypeRequiredDescription
actionstringrequired

Values: calendar.

startintegerrequired

Range start in Unix seconds.

endintegerrequired

Greater than start; range at most 43 days.

Responses

200409502401400503

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

101401

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

FieldTypeRequiredDescription
deskcitebooleanoptional
eventsbooleanoptional
typestringrequired

Values: import.start, import.progress, import.done, import.error.

sourcestringrequired

Submitted URL or filename; concurrent identical sources are ambiguous.

tsintegerrequired

Event time in Unix milliseconds.

msgstringoptional

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));