Skip to main content

Send API: the key is checked first, and X-RateLimit-Reset is always seconds

Three fixes so the API behaves the way these docs say it does.

  • The key is checked before the body. POST /v1/send without a sending credential now answers 401 with code: "api_key_required", and a malformed, unknown or revoked key answers 401 with code: "invalid_api_key". Before, a request with no usable key got a 422 VALIDATION_ERROR about its payload, which pointed you at the wrong problem. A Motor Block key belongs in Authorization: ApiKey mk_live_... or X-Api-Key, not Bearer. If your code branches on the 422 for an unauthenticated call, branch on the 401 instead.
  • X-RateLimit-Reset is always seconds until the window resets. Requests without a credential used to receive a Unix timestamp in that header. If you worked around that, read it as a number of seconds now.
  • A successful send returns HTTP 200 with acceptanceStatus: "queued". The API has always done this. Our MCP server's instructions and two docs pages said 202; they now match. Accepted is still not delivered: read the message status for the outcome.

Documentation changed