Me Send DocsDashboard

Errors and rate limits

Error format

Every error has the same body, and the HTTP status matches statusCode:

{ "statusCode": 422, "name": "missing_required_field", "message": "Missing `to` field." }

Branch on name, not on the message text. The SDK returns it as error.name.

StatusnameMeaning
400validation_errorThe body is not valid JSON, a field is invalid, or the API key is unknown (outside the send endpoints).
400invalid_idempotency_keyThe Idempotency-Key is empty or longer than 256 characters.
400invalid_regionA domain region that is not one of the four supported.
401missing_api_keyNo Authorization: Bearer header.
401validation_errorThe API key is unknown, on POST /emails or POST /emails/batch.
401restricted_api_keyThe key's permission does not allow this call (a sending-only key outside the send endpoints, or a support key that tries to send).
403validation_errorThe from domain is not verified, or the key is limited to another domain.
403suspendedSending is suspended for the project or the domain.
404not_foundThe resource does not exist in your project, or the route does not exist.
405method_not_allowedThe path exists but not with this method.
409invalid_idempotent_requestAn idempotency key was reused with a different body.
409concurrent_idempotent_requestsThe first request with this key is still running, or its outcome is not yet known.
409validation_errorA conflict, such as a domain name that is already taken.
422missing_required_fieldA required field is missing.
422validation_errorA field is present but not acceptable.
422invalid_attachmentAn attachment lacks base64 content or a filename.
429rate_limit_exceededThe project's hourly sending cap is reached.
429daily_quota_exceededThe project's daily sending cap is reached.
500application_errorThe provider did not accept the message, or something failed on our side.

Retrying

A 5xx means the outcome is uncertain, so retry, with the same Idempotency-Key on a send. Me Send never answers 5xx after a provider has accepted a message. A 4xx will not succeed on retry unless you change the request, except 429 and a 409 concurrent_idempotent_requests, which clear with time.

Rate limits

There is no per-request throttle and no X-RateLimit header. Limits are sending caps for the project, counted over a rolling window:

CapWindowDefault
HourlyThe last 60 minutes200 emails
DailyThe last 24 hours1,000 emails

The operator of your project can change them. A send that would take the project over a cap answers 429 and carries a Retry-After header with the seconds until enough of the window has passed. A batch is checked as a whole before any of it is sent. Scheduled emails count when they are sent; test mode sends never count. Mail to the simulated test addresses is also counted like any other send.

Inbound mail has its own cap (500 messages an hour by default); senders retry later when it is reached.

const response = await fetch('https://api.mesend.co/emails', { method: 'POST', headers, body });
if (response.status === 429) {
  const wait = Number(response.headers.get('Retry-After') ?? 60);
  await new Promise((resolve) => setTimeout(resolve, wait * 1000));
}

Pagination

List endpoints take limit (1 to 100, default 20) and an after id for the next page, and answer { "object": "list", "has_more": true, "data": [...] }. Some also take before. A limit that is not an integer is a 400.