Use this file to discover all available pages before exploring further.
The Datamailer client API lives under /api and lets client applications sync contacts, manage subscriptions, send transactional email, and query contact history. Every endpoint under /api requires a Bearer API key issued to an active client. Keys are created in the operator UI and are scoped to the issuing client’s organization.
The base URL is configured by the PUBLIC_BASE_URL environment variable. When DATAMAILER_API_DOCS_BASE_URL is set it takes precedence for in-app documentation examples. The default for local development is:
http://localhost:8000
Override the URL at runtime when running examples against a staging or production environment:
All curl examples in this reference default to http://localhost:8000. Set DATAMAILER_URL to a different base URL to test against any other environment without editing the commands.
Datamailer ships a browsable API reference for staff users at /api-docs/. It renders endpoint documentation, copy-pasteable curl examples pre-filled with local demo keys, and request and response bodies. The machine-readable OpenAPI spec is available at /api-docs/openapi.json.Both routes require staff login at /admin/login/.
The local demo data fixtures create stable named API keys that work immediately after seeding. Use these for local development and in-app API exploration:
Create or update contacts, check status, manage tags, update verification, validation, and suppression state, and retrieve scoped contact history.
Method
Path
POST
/api/contacts
GET
/api/contacts/status
PATCH
/api/contacts/{id}/verification
PATCH
/api/contacts/{id}/validation
PATCH
/api/contacts/{id}/suppression
PUT
/api/contacts/{id}/tags
POST
/api/contacts/{id}/tags/{slug}
DELETE
/api/contacts/{id}/tags/{slug}
GET
/api/contacts/{id}/history
Subscriptions
Subscribe a contact to a client scope, or unsubscribe at client, audience, or global scope.
Method
Path
POST
/api/subscriptions/subscribe
POST
/api/subscriptions/unsubscribe
Import & Export
Bulk-import contacts as JSON or CSV, and export the full contact list as JSON or CSV. Imports are idempotent by normalized email within an audience and client scope.
Method
Path
POST
/api/contacts/imports
POST
/api/contacts/imports/csv
GET
/api/contacts
GET
/api/contacts.csv
Transactional
Send a transactional email from a named template. Idempotency keys prevent duplicate sends. Hard bounces and complaints block delivery.