Skip to main content

API Overview

Syntropy provides HTTP APIs for event ingestion, project configuration, customer data, chat automation, knowledge base / RAG, transactional email, and hosted databases.

Base URL

https://syntropy.chat/api

Or your self-hosted instance:

https://your-domain.com/api

Authentication

Public ingest API

/api/ingest uses your Project ID (DSN) in the request body:

{
"projectId": "your-project-id",
...
}

Project API routes (/api/{accountId}/...)

Endpoints under /api/{accountId}/... are for server-to-server use by connected products. They accept a project API key via Authorization: Bearer <key> or x-api-key. The /api/{accountId}/chat route additionally allows unauthenticated browser requests from allowlisted origins (for embedded chat widgets).

Organization-scoped APIs

Organization/project management endpoints require either:

  • an authenticated dashboard user session, or
  • a project API key with required scopes

Session requests are authorized only when:

  1. The user is logged in
  2. The user belongs to the target organization
  3. The project belongs to that organization

API key requests are authorized by:

  1. key validity (not revoked/expired)
  2. organization and project binding
  3. required scope checks for the endpoint

Endpoints

EndpointMethodDescription
/api/{accountId}/chatPOSTRun a chat turn (browser embed or server-to-server with chat:invoke scope)
/api/{accountId}/kb/docsPOSTRegister a document for KB ingestion
/api/{accountId}/kb/docs/{documentId}GETPoll document ingestion status
/api/{accountId}/kb/queryPOSTQuery the knowledge base — returns answer + citations
/api/ingestPOSTIngest events (errors, pageviews, custom)
/api/organizations/{organizationId}/projects/{projectId}/source-mapsGET, POSTUpload and list source maps
/api/organizations/{organizationId}/projects/{projectId}/api-keysGET, POSTCreate/list project API keys
/api/organizations/{organizationId}/projects/{projectId}/api-keys/{keyId}DELETERevoke project API key
/api/organizations/{organizationId}/projects/{projectId}/chat-schemasGET, POSTManage structured chat schemas
/api/organizations/{organizationId}/projects/{projectId}/chat-schemas/{schemaId}GET, PATCH, DELETEManage one structured chat schema
/api/organizations/{organizationId}/projects/{projectId}/customersGET, POSTList and upsert customer profiles
/api/organizations/{organizationId}/projects/{projectId}/customers/import/csvPOSTImport customers from CSV (Customer.io-style exports)
/api/organizations/{organizationId}/projects/{projectId}/customers/eventsPOSTIngest customer-scoped custom events
/api/organizations/{organizationId}/projects/{projectId}/customers/segmentsGET, POSTList and materialize customer segments
/api/organizations/{organizationId}/projects/{projectId}/customers/segments/previewPOSTPreview segment matches without persisting
/api/organizations/{organizationId}/projects/{projectId}/customers/eligibilityPOSTEvaluate channel/topic eligibility for a customer
/api/organizations/{organizationId}/projects/{projectId}/customers/{customerId}/devicesGET, POSTList/register customer devices
/api/organizations/{organizationId}/projects/{projectId}/queue/jobsGET, POSTList and enqueue worker jobs
/api/organizations/{organizationId}/projects/{projectId}/queue/jobs/{jobId}GETRead one queue job with lifecycle history
/api/organizations/{organizationId}/projects/{projectId}/queue/jobs/eventsGETPoll lifecycle events across project queue jobs
/api/organizations/{organizationId}/projects/{projectId}/queue/jobs/streamGET (SSE)Subscribe to live lifecycle events
/api/v1/emails/sendPOSTSend transactional email (email:send scope, secret key)
/api/organizations/{organizationId}/projects/{projectId}/databasesGET, POSTList and provision hosted databases
/api/organizations/{organizationId}/projects/{projectId}/databases/{databaseId}GET, DELETERead or delete a hosted database
/api/organizations/{organizationId}/projects/{projectId}/databases/{databaseId}/connection-stringGETRetrieve live connection string (requires databases:read)
/api/organizations/{organizationId}/projects/{projectId}/databases/{databaseId}/credentialsGET, POSTList credentials or trigger a rotation
/api/organizations/{organizationId}/projects/{projectId}/chat-triggersGET, POSTList and create chat triggers
/api/organizations/{organizationId}/projects/{projectId}/chat-triggers/{triggerId}GET, PATCH, DELETERead, update, or delete a chat trigger

For typed client usage from SDKs, see SDK API Client.

Shared Infrastructure Modules

  • @eclosion-tech/syntropy-blob-storage for S3-compatible blob operations and UploadThing-style upload routes.
  • See Blob Storage Module for integration details.
  • @eclosion-tech/syntropy-queue for shared queue envelopes, worker runtime, and task lifecycle monitoring.
  • See Queue Worker SDK for integration details.
  • See Transactional email for the send API, templating, and mail provider configuration.

Rate Limits

TierEvents/minuteSource Maps/day
Free1,00010
Team10,000100
Business100,0001,000

Response Format

All responses are JSON:

{
"success": true,
"eventIds": ["uuid-1", "uuid-2"],
"sessionId": "session-uuid"
}

Error responses:

{
"success": false,
"error": "Invalid project ID",
"details": [...]
}

CORS

The ingestion endpoint supports CORS for browser requests:

Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST, OPTIONS
Access-Control-Allow-Headers: Content-Type