orbit.test · mail.orbit.test · Local lab · merged demo project
Developer · documentation
API reference
The intended v1 HTTP contract for transactional email. Paths, fields and errors are a design draft; no server implements them.
Endpoints
Planned endpoints for the first developer release.
| Method | Path | Purpose | Scope |
|---|---|---|---|
| POST | /v1/emails | Accept a transactional message for processing. | emails:send |
| GET | /v1/emails/{id} | Read the current state of an accepted job. | emails:read-events |
| GET | /v1/emails | List jobs with cursor pagination and filters. | emails:read-events |
| GET | /v1/emails/{id}/events | Read the ordered delivery event stream. | emails:read-events |
| POST | /v1/emails/batch | Accept up to the documented batch limit. | emails:send |
| GET | /v1/templates | List template metadata for the project. | templates:read |
| POST | /v1/webhooks | Create an HTTPS event destination. | webhooks:manage |
Accepted is not delivered
202 means the request was durably recorded for processing. It does not mean the recipient server accepted the message.Request conventions
Idempotency-Key is required for POST requests that create a job. Reuse with a different body is a conflict.
Authorization is a Bearer project key. Never place it in a URL or client bundle.
Timestamps are RFC 3339 with an explicit offset.
Errors use a stable code plus a human-readable message and request ID.
Examples
Hand-written examples of the intended wire format.
POST /v1/emails HTTP/1.1
Host: api.cognova.test
Authorization: Bearer cnv_live_…
Idempotency-Key: req_orbit_001
Content-Type: application/json
{
"from": "hello@orbit.test",
"to": ["maya@personal.test"],
"cc": [],
"subject": "Your Orbit workspace is ready",
"template": "welcome",
"variables": { "first_name": "Maya" },
"metadata": { "order_id": "ord_1042" }
}Scopes
Scopes are enforced per key, not inferred from a role label.
emails:sendSubmit transactional messages and inspect their jobs.
emails:read-eventsRead message state and delivery event metadata.
templates:readRead template metadata and rendered previews.
templates:writeCreate and edit template drafts.
webhooks:manageCreate endpoints and replay deliveries.
contacts:readRead contact and consent metadata.
analytics:readRead aggregate delivery and usage metrics.
Error handling
Branch on the stable error code, not the message text. Retry only transient failures and respect the stated window.
Do not retry a validation error or an idempotency conflict without changing the request.
Read the error catalogueEvent delivery
Poll the job or subscribe to signed webhooks. Delivery is at least once, so consumers must deduplicate by event ID.
Verify webhook signaturesNo OpenAPI file is published