API reference
API reference
Every public route of the native API, with examples in curl and TypeScript.
The native API lives under /v1. This reference is generated from the same openapi.json that the typed client is built from, so it always matches what the API serves.
Conventions#
- Base URL: your API origin, shown at Settings, Setup, "For your developer". Examples use
$SAPAGAN_URL. - Auth:
Authorization: Bearer <key>. Each operation lists the key kinds that may call it. See API keys. - Bodies: JSON, with
Content-Type: application/json. Times are ISO 8601 with an offset. - Errors:
{ "error": { "code", "message", "details" } }. See Errors and limits. - Idempotency: send
Idempotency-Keyon aPOSTyou may retry. - Not found: a resource the key cannot see is
404, never403.
What is left out#
This reference lists routes an API key can call. Routes only the console can call (operator login, the operator and platform consoles, view-as-store, and the console-only parts of Setup such as API keys and push credentials) are internal and not listed.
Groups
- IngestSend profiles, events, devices and store relationships in one call, and report push opens from apps.
- CustomersRead, write, export and delete one person by their external id.
- ConsentConsent topics of the workspace and each person's choices.
- PeopleSearch people and read the workspace's totals.
- SegmentsSaved audiences built from conditions, with live counts.
- BroadcastsOne-off campaigns: write, submit for approval, schedule, test and read results.
- TransactionalSend one message to one person now, and read what happened to it.
- JourneysAutomated flows started by events or segments, and the templates they start from.
- Push templatesReusable push messages with Liquid, and their previews.
- EmailEmail settings, layouts, templates, suppressions and deliverability.
- In-appIn-app templates and settings, and the two calls the app SDK makes.
- ApprovalThe review queue and what reviewers decided.
- Sending controlsKill switches, their audit trail and the workspace's test people.
- StoresMarketplace workspaces only. Stores, their policies, health, audiences, flows and reports. Own-brand workspaces answer 404.
- BillingMarketplace workspaces only. Store plans, top-ups, the ledger and statements.