API Docs & Quickstart

The SyncX public API (/v1) lets you read and manage chat sessions, capture leads, index knowledge-base content, trigger workflow automations, and queue outbound voice-agent calls from your own systems — all scoped to your company via a single API key.

Authentication Scopes Response & error format Idempotency Rate limiting Endpoints Disposition callbacks Quickstart

Authentication

Every request must include an X-API-Key header. Create a key from Admin → API Keys in your dashboard once you're signed in, and grant it only the scopes your integration needs.

X-API-Key: sk_live_xxxxxxxxxxxxxxxxxxxx

A missing or invalid key is rejected with 401 Unauthorized. A key that lacks the scope a route requires is rejected with 403 Forbidden. All routes below are mounted under https://api.mindsyncx.ai/v1/... — the gateway routes each /v1/{domain} path to the service that owns it (chat/leads → chatbot, kb → knowledge base, workflows/executions → orchestrator), so you only ever talk to one base URL.

Scopes

Each API key is issued with one or more scopes. Requests fail with 403 Forbidden if the key lacks the scope a route requires. The special * wildcard scope grants full access. Grant the minimum your integration needs — most read-only dashboards only need chat:read.

ScopeGrants
chat:readRead chat sessions, messages, and conversation history.
chat:writeStart conversations and send chat messages (tag/escalate sessions).
kb:readRead knowledge bases and query indexed documents.
kb:writeCreate, update, and delete knowledge-base documents.
workflows:readRead workflow definitions and execution status.
workflows:executeTrigger workflow / agent-pipeline executions.
calls:readPoll voice-agent call status and disposition.
calls:writeQueue outbound voice-agent calls.
leads:readRead captured leads.
leads:writeCapture and update leads.
analytics:readRead usage and analytics data.
*Wildcard — grants every scope above.

Response & error format

Every /v1 endpoint returns a consistent JSON envelope, whether it succeeds or fails.

Success envelope

The payload is always under a top-level data field, with optional out-of-band meta (pagination cursors, totals):

{
  "data": { },
  "meta": { }
}

List endpoints page their results and return the page contract inside data (items, page, limit, total, has_next) — see the quickstart examples below.

Error envelope

Errors use a stable, machine-readable code clients can branch on, a human-readable message, and optional details / request_id for debugging and cross-service correlation:

{
  "code": "not_found",
  "message": "Human-readable description.",
  "details": null,
  "request_id": "req_01H..."
}
StatusCodeMeaning
400bad_requestMalformed request body or path parameter.
401unauthorizedMissing or invalid X-API-Key.
403forbidden / insufficient_scopeKey lacks the scope this route requires.
404not_foundNo such resource for this company (cross-tenant access is indistinguishable from missing).
429rate_limitedPer-key rate limit exceeded; check Retry-After.
500internal_errorUnexpected server error.

Idempotency

Write endpoints (POST / PUT) accept an optional Idempotency-Key header. Send a unique value (e.g. a UUID) per logical operation. If a request with the same Idempotency-Key is retried — after a timeout or a network failure — the original response is replayed and the operation is not executed a second time.

Idempotency-Key: 8f14e45f-ceea-4d92-9c1a-2b5f3a7e1c00

Rate limiting

Requests are rate limited per API key (not per IP), so one tenant's integration can never exhaust another's budget. When a key exceeds its allowance the API responds with 429 Too Many Requests and a Retry-After header — back off and retry after that window.

Endpoints

All endpoints are mounted under /v1 and return the { data, meta } envelope above.

Chat sessions chatbot

Method & pathDescriptionScope
GET/v1/chat/sessions List chat sessions, most recent first (paginated, optional status filter) chat:read
GET/v1/chat/sessions/{id} Get one session, including its full message transcript chat:read
POST/v1/chat/sessions/{id}/tag Attach tags to a chat session chat:write
POST/v1/chat/sessions/{id}/escalate Escalate a session for human follow-up chat:write

Leads chatbot

Method & pathDescriptionScope
POST/v1/leads Create a lead from your own system (PII encrypted at rest) leads:write
PUT/v1/leads/{id} Update an existing lead leads:write

Knowledge base knowledge-base

Method & pathDescriptionScope
GET/v1/kb/items List knowledge-base items, newest first (paginated, optional status filter) kb:read
GET/v1/kb/items/{id} Get a single knowledge-base item kb:read
POST/v1/kb/items Create a text or url item (indexed asynchronously) kb:write
POST/v1/kb/items/{id}/reindex Re-trigger processing of an item kb:write
GET/v1/kb/items/{id}/status Get an item's processing status, chunk count, and any error kb:read
GET/v1/kb/usage Get current storage/document usage against your plan limits kb:read

Workflows agent-orchestrator

Method & pathDescriptionScope
GET/v1/workflows List workflows, most recent first (paginated, optional status filter) workflows:read
POST/v1/workflows/{id}/trigger Start an asynchronous execution of a workflow workflows:execute
GET/v1/executions/{id} Get an execution's current status and node-level detail workflows:read

Voice calls agent-orchestrator

Method & pathDescriptionScope
POST/v1/calls/outbound Queue an outbound voice-agent call calls:write
GET/v1/calls/{id} Poll a call's status and, once it ends, its structured disposition calls:read

POST /v1/calls/outbound takes to_phone, an agent_profile_id (created in your dashboard — voice, persona, and prompt bundle), an optional free-form context object injected into the agent's prompt (e.g. lead name, campaign), an optional callback_url the disposition is POSTed to when the call ends, and an optional workflow_id to run automation afterward. It accepts Idempotency-Key like other write endpoints and returns 202 Accepted immediately — call execution is asynchronous, so poll GET /v1/calls/{id} (or wait for the callback) for the result.

context is capped at 8 KB and must not contain special-category personal data (GDPR Art. 9 — health, religion, sexual orientation, etc.): it is injected directly into the agent's prompt and persisted on the call record.

Call-specific error codes, on top of the standard envelope above: 400 invalid_agent_profile_id, 400 invalid_workflow_id, 400 unsafe_callback_url (the URL failed our SSRF guard — non-http(s) schemes and private/loopback/link-local targets are always rejected), and 422 context_too_large.

Disposition callbacks

When a call ends, if you supplied a callback_url, SyncX POSTs the call's CallDisposition JSON there — signed, so you can verify it actually came from us. Delivery retries with backoff on failure or timeout.

X-SyncX-Timestamp: 1752483600
X-SyncX-Signature: sha256=6f1a9c3e2b0d7a4f8c1e5b9d3a7f2c6e0b4d8a1f5c9e3b7d2a6f0c4e8b1d5a9f

Verify by recomputing the signature over the raw request body bytes (re-serializing parsed JSON changes the bytes and breaks the check) and comparing in constant time. Reject a timestamp more than 300 seconds old — the timestamp is inside the signed material precisely so a captured payload cannot be replayed indefinitely.

signed_payload = f"{timestamp}.".encode() + raw_body
expected = hmac.new(secret.encode(), signed_payload, hashlib.sha256).hexdigest()
hmac.compare_digest(f"sha256={expected}", received_signature_header)

Quickstart

Five real requests to get you moving — each shows the request and an example response in the envelope shape above.

List your chat sessions

Request
curl https://api.mindsyncx.ai/v1/chat/sessions \
  -H "X-API-Key: sk_live_xxxxxxxxxxxxxxxxxxxx"
Response
{
  "data": [
    {
      "id": "665f1c2a9b3e4a1d2c3b4a5e",
      "session_id": "sess_a1b2c3",
      "company_id": "665e0000000000000000000a",
      "status": "active",
      "tags": ["vip"],
      "created_at": "2026-07-14T10:15:00Z"
    }
  ],
  "meta": { "page": 1, "limit": 20, "total": 1, "has_next": false }
}

Create a lead

Request
curl -X POST https://api.mindsyncx.ai/v1/leads \
  -H "X-API-Key: sk_live_xxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 8f14e45f-ceea-4d92-9c1a-2b5f3a7e1c00" \
  -d '{
    "name": "Ada Lovelace",
    "email": "ada@example.com",
    "phone": "+1-555-0100",
    "notes": "Interested in the Pro plan."
  }'
Response — 201 Created
{
  "data": {
    "id": "665f1c2a9b3e4a1d2c3b4a60",
    "company_id": "665e0000000000000000000a",
    "name": "Ada Lovelace",
    "email": "ada@example.com",
    "phone": "+1-555-0100",
    "status": "new",
    "source": "api",
    "notes": "Interested in the Pro plan.",
    "created_at": "2026-07-14T10:15:00Z",
    "updated_at": "2026-07-14T10:15:00Z"
  }
}

List knowledge-base items

Request
curl https://api.mindsyncx.ai/v1/kb/items?limit=20 \
  -H "X-API-Key: sk_live_xxxxxxxxxxxxxxxxxxxx"
Response
{
  "data": {
    "items": [
      {
        "id": "665f1c2e9a3b4c1d2e3f4a5b",
        "company_id": "acme",
        "title": "Onboarding guide",
        "type": "url",
        "url": "https://docs.example.com/onboarding",
        "processing_status": "processed",
        "processed_at": "2026-07-14T10:32:11+00:00",
        "chunk_count": 12,
        "error_message": null,
        "created_at": "2026-07-14T10:30:00+00:00",
        "updated_at": "2026-07-14T10:32:11+00:00"
      }
    ],
    "page": 1,
    "limit": 20,
    "total": 1,
    "has_next": false
  }
}

Create (upload) a knowledge-base item

Direct file upload isn't exposed on this public route — send raw text, or a url pointing at a file you've hosted out-of-band. New items are created pending and indexed asynchronously.

Request
curl -X POST https://api.mindsyncx.ai/v1/kb/items \
  -H "X-API-Key: sk_live_xxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 3c2a9e0a-5b3d-4f1e-8a2b-1d4e7c9f0a11" \
  -d '{
    "type": "text",
    "title": "Refund policy",
    "content": "Refunds are issued within 14 days of purchase..."
  }'
Response — 201 Created
{
  "data": {
    "id": "665f1c2e9a3b4c1d2e3f4a5c",
    "company_id": "acme",
    "title": "Refund policy",
    "type": "text",
    "url": null,
    "processing_status": "pending",
    "processed_at": null,
    "chunk_count": 0,
    "error_message": null,
    "created_at": "2026-07-16T09:00:00+00:00",
    "updated_at": "2026-07-16T09:00:00+00:00"
  }
}

Trigger a workflow

Request
curl -X POST https://api.mindsyncx.ai/v1/workflows/6630f1a2b3c4d5e6f7a8b9c0/trigger \
  -H "X-API-Key: sk_live_xxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 0e2b7f4a-6c1d-4a9e-9f3b-5a8d2c1e7b44" \
  -d '{
    "trigger_data": { "lead_id": "665f1c2a9b3e4a1d2c3b4a60" }
  }'
Response — 201 Created
{
  "data": {
    "execution_id": "6630f9c1b3c4d5e6f7a8b9d4",
    "status": "pending"
  }
}

Poll the execution to see it complete:

Request
curl https://api.mindsyncx.ai/v1/executions/6630f9c1b3c4d5e6f7a8b9d4 \
  -H "X-API-Key: sk_live_xxxxxxxxxxxxxxxxxxxx"
Response
{
  "data": {
    "id": "6630f9c1b3c4d5e6f7a8b9d4",
    "workflow_id": "6630f1a2b3c4d5e6f7a8b9c0",
    "company_id": "507f1f77bcf86cd799439011",
    "status": "completed",
    "started_at": "2026-01-01T00:00:00+00:00",
    "completed_at": "2026-01-01T00:00:05+00:00",
    "node_executions": [],
    "trigger_data": { "lead_id": "665f1c2a9b3e4a1d2c3b4a60" },
    "error": null
  }
}

Queue an outbound voice-agent call

Request
curl -X POST https://api.mindsyncx.ai/v1/calls/outbound \
  -H "X-API-Key: sk_live_xxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 4b6a2e10-8f2c-4c1a-9d3b-2f6e8a1c9d02" \
  -d '{
    "to_phone": "+15551230000",
    "agent_profile_id": "6630a1b2c3d4e5f6a7b8c9d0",
    "context": { "leadName": "Ada Lovelace", "campaignId": "spring-2026" },
    "callback_url": "https://yourapp.example.com/webhooks/syncx-call"
  }'
Response — 202 Accepted
{
  "data": {
    "call_id": "6630f9c1b3c4d5e6f7a8b9e1",
    "status": "queued"
  }
}

Poll the call for its status and, once it ends, the disposition:

Request
curl https://api.mindsyncx.ai/v1/calls/6630f9c1b3c4d5e6f7a8b9e1 \
  -H "X-API-Key: sk_live_xxxxxxxxxxxxxxxxxxxx"
Response
{
  "data": {
    "call_id": "6630f9c1b3c4d5e6f7a8b9e1",
    "company_id": "665e0000000000000000000a",
    "status": "completed",
    "direction": "outbound",
    "to_phone": "+15551230000",
    "agent_profile_id": "6630a1b2c3d4e5f6a7b8c9d0",
    "workflow_id": null,
    "context": { "leadName": "Ada Lovelace", "campaignId": "spring-2026" },
    "created_at": "2026-07-14T10:15:00Z",
    "started_at": "2026-07-14T10:15:04Z",
    "ended_at": "2026-07-14T10:19:25Z",
    "duration_seconds": 261,
    "error": null,
    "disposition": {
      "callId": "6630f9c1b3c4d5e6f7a8b9e1",
      "companyId": "665e0000000000000000000a",
      "direction": "outbound",
      "customerName": "Ada Lovelace",
      "phone": "+15551230000",
      "intent": "Sales",
      "status": "SALES_LEAD",
      "summary": "Interested in the Pro plan, requested a callback next week.",
      "sentiment": "Positive",
      "requiresHuman": true,
      "priority": "High",
      "transferredTo": null,
      "recordingUrl": "https://cdn.mindsyncx.ai/recordings/abc123.mp3",
      "transcript": "...",
      "context": { "campaignId": "spring-2026" },
      "durationSeconds": 261
    }
  }
}

Don't have an API key yet? Start a free trial — every Starter plan can generate keys immediately, no card required.