Get your API key
API reference

Realtime

The Realtime endpoints.

Auth: API key · Base URL: https://api.mailkite.dev

Endpoints

Each row expands to its request and response schema. The address bar follows along, so any endpoint can be linked to directly.

POST /v1/realtime/token Mint a short-lived, single-use token that authorises one Realtime API connection. For browsers: EventSource cannot set headers, so this is what a page passes as ?token= instead of putting an API key in a URL. Inherits the calling credential's scope, expires in five minutes, and burns on first use. The stream itself is GET /v1/realtime — a subscription, not a request/response call, so it is contracted in sdks/spec/realtime.json rather than here.

Mint a short-lived, single-use token that authorises one Realtime API connection. For browsers: EventSource cannot set headers, so this is what a page passes as ?token= instead of putting an API key in a URL. Inherits the calling credential's scope, expires in five minutes, and burns on first use. The stream itself is GET /v1/realtime — a subscription, not a request/response call, so it is contracted in sdks/spec/realtime.json rather than here.

Response body

realtime-token-response.json

Part of the Realtime API (sdks/spec/realtime.json). A short-lived, single-use token that authorises exactly one Realtime connection. Exists because EventSource cannot set headers: without it a browser would have to put a long-lived API key in a query string, where proxies log it and browser history keeps it. Inherits the scope of the credential that minted it and can never exceed it.

FieldTypeNotes
token req stringThe value to pass as ?token= on the Realtime connection. Burns on first use.
expiresAt req integerWhen the token stops being accepted, in Unix epoch milliseconds (UTC).
expiresAtIso req string (ISO 8601)The same instant as an ISO 8601 string.