Skip to main content
Events go in on one host and messages go out from the other. Each route takes an API key in the Authorization header and acts in the key’s own workspace. The JavaScript SDK makes the event calls for you; call the routes yourself from a language that has no SDK.

Keys

A public key (mq_live_) can only write events, so it is safe in a web page or an app. A secret key (mq_sec_) stays on your server and does what its scopes allow; you choose them when you make the key. A secret key made with no scopes has contacts:read only.
Never put a secret key in a web page, an app or a repository. Anyone who holds it can read your contacts, delete them or send email from your workspace, as far as its scopes allow.

Which key each route takes

Events sent with a secret key are marked as sent by your server. Once such a call sets email, phone or emailOptIn, a public-key call can no longer change that value, but it can still fill one that is empty.

Identity token

A call to /v1/identify, /v1/track or /v1/batch that names a userId can carry a token your server signed for that person. Set it up in Identity verification.
The token is a JWT signed with ES256 by a key of your workspace, named in its header’s kid. Its sub is the userId and its exp is at most 24 hours ahead. One token covers one request, so every item of a batch that names a userId must name the token’s sub. A call that names only an anonymousId needs no token, and neither does a secret key on /v1/batch. The reasons of a 401 are token_required, token_expired, invalid_signature, sub_mismatch, no_matching_key and exp_required; see Errors.

Send an event once

Give each event a messageId of 1 to 64 characters. A retry with the same messageId within 24 hours is stored once. A call without one gets an id from the gateway, and a retry of it is stored again.

Send a message once

POST /v1/public/messages takes an optional Idempotency-Key header: letters, digits and _ . : -, at most 100 characters. A retry with the same key within 7 days sends the message once and answers with the same messageId. The first body sent with a key is the one that counts.

Event time

An event is stored with the time the gateway received it, unless you send both timestamp (when the event happened) and sentAt (when the request left your client). With both, and timestamp earlier than sentAt, Maqetin stores the time of receipt minus the gap between them, so a wrong client clock cancels out. A timestamp alone is not used. A timestamp more than 366 days before sentAt is a 400. Send times as ISO 8601 date-times, such as 2026-12-03T09:30:00.000Z.

Rate limits

Over a limit, the answer is 429 with a Retry-After header in seconds: wait that long, then retry with the same messageId or Idempotency-Key.

Size limits

Answers

An accepted call is 202 with the number of events taken:
A refusal holds error, and for a body problem at: up to 10 places in the body, as JSON pointers. A name you chose is shown as *. No value from the body is repeated.
Errors lists every status and code.

Retries

Retry after a 5xx, a 429 or a network error, waiting for Retry-After when the answer has one. Keep the same messageId or Idempotency-Key, so a retry never stores an event twice or sends a message twice. Do not retry any other 4xx as it is: the same request gets the same answer. The one exception is a 401 for an identity token: retry with a new token.