Sending

Every Mailcandor API error and how to fix it

Short answer

Every Mailcandor API error has the same JSON shape: {"error": {"type", "message", "field"}}. The type is a stable code to handle in your code, the message says in plain words what to do, and field, when present, names the input at fault. Errors use 400, 401, 402, 403, 404, 409, 422 and 429. This page lists every type, its cause and the fix.

Last checked 16 November 2026

The error shape

{
  "error": {
    "type": "domain_not_verified",
    "message": "acme.com is not verified yet. Publish its DNS records, then check DNS.",
    "field": "from"
  }
}
  • type: a stable code. Branch on this.
  • message: what went wrong and what to do. Safe to log and show to developers as it is.
  • field: the input at fault, when one input caused it. In a batch it is prefixed with the position, such as 3.subject.

Authentication (401, 403)

Status Type Cause Fix
401 missing_api_key No Authorization header Send Authorization: Bearer mc_live_....
401 invalid_api_key Unknown or revoked key Check the key with GET /v1/whoami; create a new one if revoked.
403 restricted_api_key A sending-only key called a full-access endpoint, or a domain-limited key sent from another domain Use a full-access key, or the right domain.
403 forbidden The action is not allowed for this key or team, for example managing keys with a key whose creator is no longer an admin or developer Use a key made by a current admin or developer.

Domains and sending rights (403, 409)

Status Type Cause Fix
403 domain_not_found The from domain is not on your team Add it under Domains.
403 domain_not_verified The from domain is added but not verified Publish its records, press Check DNS now.
403 sandbox_recipient Your team has not verified a domain, and the recipient is not a team member; or a broadcast was sent from the sandbox Verify a domain. See Sandbox explained.
403 sending_paused Sending is paused after a review Open Reviews, read the reason and reply.
409 domain_taken Another team already has this domain Remove it there, or contact us if it is yours.

Request problems (400, 422)

Status Type Cause Fix
422 missing_required_field A required field is empty, or a template variable without a fallback is missing Add the field named in field.
422 validation_error A value is wrong: bad address, over 50 recipients, bad scheduled_at, batch over 100, and similar Read message and field.
422 invalid_attachment Missing filename, bad base64, over 40 MB, or a path instead of content See Attachments.
400 invalid_idempotency_key Idempotency-Key is empty or over 256 characters Send 1 to 256 characters.

Conflicts and state (404, 409)

Status Type Cause Fix
404 not_found No such item on your team Check the id and the team the key belongs to.
409 invalid_idempotent_request Same Idempotency-Key, different body Use a new key for a new email.
409 concurrent_idempotent_requests A retry arrived while the first request with that key was still running Wait a moment and retry.
409 invalid_state The item is not in a state that allows this, such as rescheduling an email that already went out, or editing a sent broadcast Read the status in message.
409 already_exists The contact is already in this audience Update it with PATCH instead.

Limits and billing (402, 429)

Status Type Cause Fix
429 rate_limit_exceeded Over your team’s requests per second Wait retry-after (1 second). Use batch sends.
429 daily_quota_exceeded Starter’s 100 emails for the day (UTC) are used Wait for midnight UTC, or change plan.
429 monthly_quota_exceeded Starter’s 3,000 emails for the month are used Change plan under Billing.
402 card_required A paid plan needs a card Add a card under Billing.
402 card_declined The card was declined Use another card.

Errors without this shape

  • 404 with {"message": "Not Found"}: the URL does not match any endpoint. Check the path starts with /v1/ and ids are full UUIDs.
  • 5xx: something failed on our side. Retry with an Idempotency-Key, and check status.mailcandor.com.
  • Compatible endpoints: POST /v3/mail/send answers SendGrid-style {"errors": [{"message", "field"}]}, and the Postmark endpoints answer with Postmark’s ErrorCode and Message, so existing SDKs understand them.

Handling errors in code

const res = await fetch('https://api.mailcandor.com/v1/emails', { method: 'POST', headers, body });
if (!res.ok) {
  const { error } = await res.json().catch(() => ({ error: { type: 'http_' + res.status, message: res.statusText } }));
  if (error.type === 'rate_limit_exceeded') { /* wait 1s and retry */ }
  else if (error.type === 'domain_not_verified') { /* alert: DNS problem */ }
  else throw new Error(`${error.type}: ${error.message}${error.field ? ` (${error.field})` : ''}`);
}

Full reference: docs.mailcandor.com.

Questions

Should my code check the type or the message?

The type. Messages are written for people and can be improved over time; types stay the same.

Which errors are safe to retry?

429 rate_limit_exceeded and 409 concurrent_idempotent_requests after a short wait, and any 5xx or timeout. Retry with an Idempotency-Key so nothing sends twice.

I got a 404 with only a message field. Why?

The URL is wrong, so no endpoint answered. Check the path, and that ids are full UUIDs.

Related

Send with someone on your side.

Unlimited domains on every plan, a person before any block, and 3,000 emails a month free. Tell us what you send and we set you up within one business day.