Docs home/📘 API reference

API reference

Base https://ai.syctra.com/api/v1 · every endpoint needs Authorization: Bearer <token> unless marked public. See API & native integration for authentication, errors, limits and security.

Runs — talk to an agent

POST /chat

Starts a durable run and returns immediately.

FieldTypeDefaultDescription
messagestringRequired. What you ask the agent
app_namestring"main"Target agent. Any catalogue key (interactive, data_copilot, contract_review_dz, slide_master, finance_master…) or custom_<id> for one of your own
session_iduuidnewContinue an existing thread. Omit to start one
attachmentsstring[]Upload ids from POST /uploads
kb_idsstring[]Knowledge bases the agent may search during the run
kb_enhanceboolfalseLLM-rewrite RAG answers (slower, richer)
planboolfalsePlan mode: the agent writes a step plan and executes it, emitting plan / plan_step
modelstringaccount defaultModel catalogue key — see GET /models
reasoningboolfalseLonger deliberation before answering
data_workspace_iduuidData Lab workspace the agent should work on
client_tzstringUTCIANA timezone, e.g. "Africa/Algiers"
idempotency_keystringReplay-safe: the same key returns the same run
{ "run_id": "…", "session_id": "…", "cursor": 0, "resumed": false,
  "status": "running", "queue_seq": 0 }

status is running, or queued when the session is busy (the run starts automatically when the one before it finishes), or blocked.

MethodPathPurpose
POST/tasksSame as /chat but explicitly detached — for background jobs
GET/runs/{run_id}/eventsSSE stream of the run (below)
POST/runs/{run_id}/respondAnswer a question the agent asked (user_choice, quiz, approval)
POST/runs/{run_id}/cancelStop a running run
GET/sessions/{id}/queueInspect the session's pending queue
POST/sessions/{id}/queue/resumeResume a queue paused by a failure

GET /runs/{run_id}/events — the stream

text/event-stream. Each event carries id (a monotonic seq), event (its type) and data (JSON). Resumable: reconnect with Last-Event-ID: <seq> or ?after=<seq> and everything after that cursor is replayed from durable storage — no work is lost and nothing is billed twice.

GroupEvents
Answertoken (text fragment) · usage (token counts) · done · error
Toolstool_call · tool_result · sandbox_stdout
Planplan (ordered steps) · plan_step (index + status)
Documentsdocument_start · document_delta · document_end (carries artifact_id)
Deliverablesartifact · file (PDF/DOCX/PPTX/XLSX) · image · slides · webpage · chart · sheet
Researchsources (web results) · graph (knowledge graph) · browser (computer-use screenshots) · maps
Human in the loopuser_choice · choice_answer · quiz · approval (action awaiting your confirmation)
Communicationemail_draft · email_sent · social · call
Legal studiosdossier · timeline · doc_summary · findings · contract · clause · contract_compare · consultation · legal_issues · ref_check · deadline · watch_synthesis · watch_change · watch_diff
Recruitmentcandidate · iv_job · iv_candidate · iv_questions · iv_grid · iv_answers · iv_ask · iv_plan
Businessprospect · cerfa · exhibition · finance · site_map · site_pack

Consume token, done and error for a plain text answer; the rest are structured cards you can render or ignore. Unknown event types must be skipped, not treated as errors — new ones are added over time.

MethodPathPurpose
GET/modelsModel catalogue available to your account
GET/sessionsList conversations
GET/sessions/{id}One session + its recent events
PATCH DELETE/sessions/{id}Rename / delete
GET/sessions/{id}/messagesFull message history
GET/sessions/{id}/artifactsEverything the session produced
POST/sessions/{id}/branchFork the conversation at a point
POST/sessions/{id}/truncateCut the conversation back to a message
GET POST/sessions/{id}/versionsArtifact version history / restore
GET/sessions/search?q=Full-text search across your conversations

Files

MethodPathPurpose
POST/uploads{filename, content_base64, mime, session_id?}{upload_id}. Parsed automatically (OCR, vision, transcription). Up to 200 MB per file
GET/uploads/{id}Parsing status and extracted text
GET/uploads/{id}/rawThe original bytes
POST/artifactsCreate an artifact from your own content
GET/artifacts/{id}Download a produced file
POST/exportRender Markdown/HTML to PDF, DOCX or PPTX
POST/export-textPlain-text export

Attach an upload to a run by passing its id in attachments. Accepted: PDF, Office, images, audio, video, CSV/Excel, ZIP (recursively expanded).

Knowledge bases (RAG)

MethodPathPurpose
POST GET/kbCreate / list knowledge bases
PATCH DELETE/kb/{id}Rename / delete
GET POST/kb/{id}/documentsList / add documents (ingestion is asynchronous)
POST/kb/query/streamQuery, streamed (below)
GET PUT/kb/{id}/configRetrieval profile (legal / enterprise / timeline / generic), FTS language, budgets. PUT rewrites every field — send the full object
GET/kb/{id}/chunks · /entities · /graphInspect the index, extracted entities, knowledge graph
GET/kb/{id}/file/{doc_id} · /image/{image_id}Source document / extracted image
POST GET/kb/{id}/conversationsMulti-turn RAG threads
GET/kb/{id}/conversations/{cid}/messagesThread history
GET POST DELETE/kb/{id}/connectorsSync from external sources; /kb/connectors/catalog lists them
POST GET DELETE/kb/{id}/sharePublish a public query link
GET/kb/pricingPer-query cost model
curl -N -X POST https://ai.syctra.com/api/v1/kb/query/stream \
  -H "Authorization: Bearer $TOKEN" -H 'content-type: application/json' -d '{
    "kb_id": "…", "q": "Which termination clauses apply after 12 months?",
    "mode": "full", "cite": true, "enhance": false, "agent": false, "top_k": 20
  }'
FieldValuesDescription
modeauto · quick · full · deep · graph_local · graph_globalRetrieval depth. auto picks from the question
citeboolInline [N] citations plus source ids
enhanceboolLLM-rewrite the answer
agentboolDecompose multi-part questions before retrieving
doc_idstringRestrict retrieval to a single document
conversation_iduuidContinue a multi-turn thread

Custom agents

MethodPathPurpose
GET/agent-toolsThe capability catalogue you can toggle on an agent
GET POST/agents/customList / create
GET PUT DELETE/agents/custom/{id}Read / update / delete
POST/agents/custom/personaDistil a persona from uploaded writing samples
GET/marketplace · /marketplace/{id}Published agents
POST/marketplace/{id}/install · /publish · /unpublishInstall / publish / withdraw
{
  "name": "Tender analyst", "emoji": "📑",
  "description": "Reads tender files and produces a go / no-go note",
  "instruction": "You are a public-procurement analyst…",
  "tool_keys": ["web", "deep_research", "documents", "knowledge_base", "database"],
  "model": "standard", "visibility": "private",
  "examples": ["Analyse this tender"], "tags": ["procurement"]
}

Capability keys: knowledge_base · web · deep_research · agent_team · computer_use · algerian_law · documents · slides · charts · images · webpage · code · quiz · email · planning · scraping · prospecting · linkedin · meta · obsidian · knowledge_graph · scheduling · workspace_files · data_engineering · database · n8n · stripe · paypal · notion · github · gitlab · elevenlabs · microsoft · atlassian · slack · s3 · apify · mcp_remote.

Run it like any other agent: POST /chat with "app_name": "custom_<id>".

Scheduler

MethodPathPurpose
GET POST/cronList / create a scheduled run
PATCH DELETE/cron/{id}Pause, edit, delete
POST/cron/{id}/runTrigger once, now
{ "name": "Monday competitor watch", "cron_expr": "0 8 * * 1",
  "timezone": "Africa/Algiers", "prompt": "Summarise last week's moves by…",
  "app_name": "main", "delivery_email": "team@acme.com" }

Standard 5-field cron. delivery_email mails the final answer; leave empty for none.

Data Lab

MethodPathPurpose
GET POST/data/workspacesList / create a persistent DuckDB workspace
PATCH DELETE/data/workspaces/{id}Rename / delete
POST/data/workspaces/{id}/ingestLoad Excel/CSV — messy sheets, multi-row headers, several tables per sheet
GET/data/workspaces/{id}/tables · /filesInspect the schema and sources
POST/data/workspaces/{id}/queryRun SQL against the workspace
DELETE/data/workspaces/{id}/tables/{table}Drop a table

Agent swarm

MethodPathPurpose
GET/swarm/api/teams · /catalogue · /healthAvailable teams and engine status
POST/swarm/api/runStart a multi-agent run
GET/swarm/api/run/{id}/streamSSE progress
POST/swarm/api/run/{id}/cancelStop it
GET/swarm/api/dossiers · /{id} · /{id}/file/{name}Produced dossiers and their files
POST/swarm/api/convert · /template/inspectConvert output / inspect a deck template

Documents & projects

MethodPathPurpose
GET/docspaceFolder tree + documents
POST PATCH DELETE/folders, /folders/{id}Manage folders
POST PATCH DELETE/documents, /documents/{id}Manage documents
GET/documents/{id}/contentRead content
POST/documents/{id}/attachAttach a document to a conversation
POST/docspace/import-zipBulk import
GET POST/projects, /projects/{id}Workspaces grouping conversations and files
POST GET DELETE/projects/{id}/membersProject access

Sharing (public links)

MethodPathPurpose
POST GET DELETE/sessions/{id}/sharePublish a conversation
GET/shared/{slug}Public read of a shared conversation
GET/shared/{slug}/artifacts/{id}Public artifact from a shared conversation
GET POST/shared/{slug}/commentsPublic comment thread
POST/shared/{slug}/cloneCopy a shared conversation into your account
POST GET DELETE/docshareShare documents / folders
GET/shared-doc/{slug}Public shared document
GET/shared-kb/{slug} · POST /shared-kb/{slug}/query/streamPublic knowledge-base link, queries billed to the owner

Public links are unlisted URLs, not authentication. Anything you publish is readable by anyone holding the link — and queries against a shared knowledge base are billed to you. Revoke with the matching DELETE.

Embeddable widget

Create a widget under Integrations → Widget, then paste one line into your site:

<script src="https://ai.syctra.com/embed.js" data-key="pk_live_…" async></script>

Optional data-position="bottom-left" | "bottom-right". The widget calls a separate public API under /embed-api — the public key is not an API key and cannot read your account:

MethodPathPurpose
GET/embed-api/config/{public_key}Public widget configuration
POST/embed-api/chatPublic visitor message
GET/embed-api/runs/{run_id}/eventsPublic answer stream
GET/embed-api/history/{public_key}/{visitor_id}Public visitor history
GET POST PATCH DELETE/embed-widgetsOwner CRUD (authenticated)

The /embed-api/* and /scim/v2/* paths are served at the host root, not under /api/v1 — e.g. https://ai.syctra.com/embed-api/chat.

Only agents allow-listed for public use can be attached to a widget, visitor traffic is rate limited per widget, and every conversation is billed to the owning organisation. Restrict the allowed origins on the widget before publishing it.

Teams, organisation & provisioning

MethodPathPurpose
GET/enterprise · /enterprise/analytics · /enterprise/retentionOrganisation, usage, retention policy
POST DELETE/enterprise/teams, /teams/{id}Manage teams
POST DELETE/enterprise/teams/{id}/members…Membership
POST DELETE/enterprise/teams/{id}/grantsWhich agents a team may use
POST/enterprise/teams/{id}/invite · /invites/revoke · /invites/resendInvitations
GET POST/invite/{token}, /invite/{token}/acceptPublic invitation acceptance
GET PUT DELETE/enterprise/ssoSAML / OIDC single sign-on
POST/enterprise/scim-tokenMint a SCIM provisioning token
GET/me/caps · /me/teams · POST /me/active-teamThe caller's rights and teams
GET POST DELETE/teams, /groups, /share-targetsLightweight teams, groups, sharing targets

SCIM 2.0 is served at https://ai.syctra.com/scim/v2 with its own token (not an API key): GET|POST /Users, GET|PUT|PATCH|DELETE /Users/{id}, GET /Groups.

Account, notifications & privacy

MethodPathPurpose
GET PATCH/auth/meProfile
POST/auth/change-password · /auth/logoutCredentials / sign out
GET/balanceCredit balance
GET POST/notifications, /notifications/readIn-app notification feed
PUT/me/notify-email · /me/low-balance-pctNotification preferences
GET POST/push/vapid-key, /push/subscribeWeb-push subscriptions
GET DELETE PUT/memory, /memory/{id}, /memory/settingsLong-term memory: read, delete, opt out
GET/account/exportGDPR — export everything you own
DELETE/accountGDPR — delete the account and its data
GET POST/approvals, /approvals/{id}/decideApprove or refuse a gated action
GET PUT/approval-settingsWhich capabilities require human approval

Other surfaces

MethodPathPurpose
GET POST DELETE/deadlines…Legal deadline agenda
POST GET DELETE/meetings…Meeting transcription and minutes
POST GET DELETE/dubbings…, GET /dubbing/languagesVideo / audio dubbing jobs
POST GET DELETE/email-compose, /email-templatesComposed e-mails and templates
POST/email/sendSend an e-mail through the platform
GET POST DELETE/promptsSaved prompts
POST/feedback · /message-feedbackProduct and per-answer feedback
GET/healthz · /readyz · /metricsPublic liveness, readiness, Prometheus metrics

Notes for integrators

  • There are no outbound webhooks yet. Track long work by holding the SSE stream open, or by polling GET /sessions/{id} — a run survives your disconnection either way.
  • Poll politely. Prefer SSE; if you must poll, use the cursor you already hold.
  • Store the cursor. Persisting the last seq you processed makes your integration crash-safe.
  • Pin the agent. app_name decides behaviour, cost and available tools — set it explicitly instead of relying on the main default.
  • Handle 402 and 429 first. They are the two errors a healthy integration meets in production; everything else usually means a bug in the payload.