Public API reference
HTTP reference for the embed SDK, health probes, and public preset catalog. Authenticated dashboard APIs require a Clerk session.
Base URL
All paths are relative to your TuringArte deployment origin, e.g. https://app.turingarte.com or http://localhost:3000.
Authentication
Public embed endpoints use a publishable key (pk_live_… or test-prefixed keys when enabled). Pass it in one of:
- Header
x-publishable-key: pk_live_… - Header
Authorization: Bearer pk_live_… - JSON body field
key(chat/session) or query?key=(config GET)
Browser calls also send Origin. Keys may restrict allowed origins. CORS preflight is supported via OPTIONS on public routes.
Not for LLM keys
Error shape
{
"error": "Human readable message",
"code": "unauthorized"
}Common codes:
unauthorized— missing/invalid keyforbidden/forbidden_originvalidation— bad inputrate_limited— withRetry-Afterfeature_disabled— kill switchnot_found/inactivedb_unavailable/internal
Embed chat APIs
/api/public/configReturns public employee branding for the widget (name, greeting). Requires employeeId and publishable key.
curl -s "$ORIGIN/api/public/config?employeeId=EMP_UUID&key=pk_live_xxx" \
-H "Origin: https://yoursite.com"{
"employeeId": "…",
"name": "Support",
"greeting": "Hi — how can I help?",
"businessName": "Acme",
"branding": {
"primaryColor": "#7c3aed",
"footer": "Powered by TuringArte"
}
}/api/public/chat/sessionCreate or resume an open embed conversation for a visitor. Body JSON:
{
"employeeId": "EMP_UUID",
"visitorId": "optional-stable-id",
"conversationId": "optional-existing-id",
"key": "pk_live_…"
}{
"conversationId": "…",
"visitorId": "…",
"resumed": false
}/api/public/chatSend a user message and receive the agent reply. Employee must be active. Rate limited (~30 req/min per key+IP). Max message length 4000 characters.
{
"employeeId": "EMP_UUID",
"message": "What are your support hours?",
"conversationId": "optional",
"visitorId": "optional",
"key": "pk_live_…"
}curl -s -X POST "$ORIGIN/api/public/chat" \
-H "Content-Type: application/json" \
-H "x-publishable-key: pk_live_xxx" \
-H "Origin: https://yoursite.com" \
-d '{
"employeeId": "EMP_UUID",
"message": "What are your support hours?"
}'{
"conversationId": "…",
"reply": "We're available weekdays 9–5 ET…",
"model": "gpt-4o-mini",
"usedKnowledge": true,
"tools": []
}Rate limits
- Chat: ~30 requests / minute / key prefix + IP
- Session & config: similar sliding windows (see responses for
429)
Catalog & health
/api/presetsPublic preset catalog (no secrets). Same data as the Create Employee UI / agent catalog docs.
{
"presets": [
{
"id": "customer-support",
"name": "Customer Support",
"description": "…",
"version": "1.0.0",
"status": "ga",
"defaultTools": ["email_alert", "…"],
"defaultChannels": ["chat_embed", "…"],
"suggestedKnoloTopics": ["…"],
"createAsDraftOnly": false
}
]
}/api/healthShallow health for uptime checks. Add ?deep=1 to probe database, encryption config, voice bridge, Sentry, and feature flags. Returns 503 when degraded.
curl -s "$ORIGIN/api/health?deep=1" | jqHuman UI: /status
Dashboard (session) APIs
Routes under /api/employees, /api/knowledge, /api/me, etc. require a signed-in Clerk user with organization context. They power the dashboard UI and are not intended for third-party browser embeds. A dedicated server-to-server agent API is on the roadmap.
Webhooks (platform)
POST /api/webhooks/clerk— user/org syncPOST /api/webhooks/twilio/sms— inbound SMSPOST /api/webhooks/twilio/voice— voice entryPOST /api/webhooks/calcom— calendar events
These verify provider signatures and are for platform configuration — not general partner use.
Upcoming API surface
- Server SDK / secret keys — create sessions and run chat from your backend without Clerk browser cookies
- Streaming chat — SSE or chunked replies for the widget
- Employee CRUD API — provision agents for multi-tenant SaaS partners
- Webhook out — notify your systems on conversation events and tool results
- OpenAPI document — machine-readable schema export
Static SDK assets
GET /sdk/v1/loader.jsGET /sdk/v1/widget.js
Integration guide: Embed SDK.