A REST API that speaks production.
Every endpoint Saaya exposes — agents, knowledge bases, sessions, campaigns, webhooks. Cursor-paginated, idempotent, and shape-stable.
Base URL
https://api.saaya.ai
Auth
Bearer token in the Authorization header.
Org context
Pass X-Organization-Id to scope the call.
curl https://api.saaya.ai/api/v1/agents \
-H "Authorization: Bearer $SAAYA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Maya — Pipeline Concierge",
"prompt": "You qualify inbound interest...",
"voice": { "provider": "elevenlabs", "voiceId": "rachel" },
"llm": { "provider": "anthropic", "model": "claude-opus-4-7" }
}'{
"success": true,
"data": {
"id": "agt_2N3rH...",
"name": "Maya — Pipeline Concierge",
"version": "v1"
},
"message": null,
"meta": null
}Eight resources. One consistent shape.
Agents
Create, version, publish, and roll back conversational agents.
- POST /api/v1/agents
- GET /api/v1/agents/:id
- PATCH /api/v1/agents/:id
- POST /api/v1/agents/:id/publish
- POST /api/v1/agents/:id/rollback
Knowledge Bases
Ingest sources, query with citations, manage embeddings.
- POST /api/v1/knowledge-bases
- POST /api/v1/knowledge-bases/:id/ingest
- POST /api/v1/knowledge-bases/:id/query
- DELETE /api/v1/knowledge-bases/:id
Sessions
Place test calls, fetch transcripts, replay tool calls.
- POST /api/v1/sessions
- GET /api/v1/sessions/:id
- GET /api/v1/sessions/:id/transcript
- GET /api/v1/sessions/:id/replay
Campaigns
Bulk dispatch, scheduling, fallback channel cascades.
- POST /api/v1/campaigns
- POST /api/v1/campaigns/:id/start
- POST /api/v1/campaigns/:id/pause
- GET /api/v1/campaigns/:id/stats
Audience / Leads
Manage the contact list each campaign fans out across.
- POST /api/v1/leads
- POST /api/v1/leads/bulk
- GET /api/v1/leads/:id
- PATCH /api/v1/leads/:id
Webhooks
Subscribe to session, campaign, and agent lifecycle events.
- POST /api/v1/webhooks
- GET /api/v1/webhooks
- DELETE /api/v1/webhooks/:id
- POST /api/v1/webhooks/:id/rotate-secret
Workspace & Members
Org settings, RBAC, member invites, billing scope.
- GET /api/v1/workspaces/me
- POST /api/v1/workspaces/:id/invite
- PATCH /api/v1/workspaces/:id/members/:memberId
API Keys
Issue, scope, and rotate keys. Tied to RBAC roles.
- POST /api/v1/api-keys
- GET /api/v1/api-keys
- DELETE /api/v1/api-keys/:id
Resilience built into the wire.
Idempotency keys
Pass Idempotency-Key on any create to make retries safe. Saaya replays the response byte-for-byte for 24 hours.
Cursor pagination
List endpoints return meta.next_cursor. Stable across writes — you'll never lose or duplicate a row.
Versioning strategy
Major version is locked into the URL path. Additive changes ship inside the version. Breaking changes get 12 months of overlap.
Saaya tells you when things happen.
Events Saaya emits
- session.started
- session.ended
- session.transferred
- agent.published
- agent.rolled_back
- campaign.started
- campaign.completed
- lead.responded
- kb.ingest.completed
Signature & retries
Every payload is signed with HMAC-SHA256 using your webhook secret. Saaya retries non-2xx responses with exponential backoff for up to 24 hours, then dead-letters.
Full event referenceCommon questions
Workspace Settings → API Keys. Keys are scoped to a single workspace and respect the RBAC role you bind them to. Rotate freely — old keys are revoked instantly.
Build against a stable API.
Generate a key, install the SDK, and the first POST returns an agent ID. The contract holds.