Resend API errors: validation_error, 403 and 429 explained
Resend returns errors as JSON with name, message and statusCode, and the name tells you more than the status. validation_error alone covers bad fields (400), an invalid API key (400 or 401), an unverified from domain and the resend.dev testing limit (both 403). 401 restricted_api_key means a sending-only key called another endpoint, and 429 is rate_limit_exceeded (10 requests per second per team by default) or a daily or monthly quota. A 403 with error code 1010 usually means the User-Agent header is missing.
The error object
Every error body has the same three fields. This one is from Resend's pagination docs:
{
"name": "validation_error",
"statusCode": 422,
"message": "The pagination limit must be a number between 1 and 100. See https://resend.com/docs/pagination for more information."
}Branch on name, then read message: the same name appears with several statuses and many different messages. The official Node SDK doesn't throw for API errors; resend.emails.send() returns { data, error }, so check error on every call. With curl, use -i to see the status and rate-limit headers:
curl -i https://api.resend.com/emails \
-H "Authorization: Bearer $RESEND_API_KEY" \
-H "User-Agent: my-app/1.0" \
-H "Content-Type: application/json" \
-d '{"from": "Acme <[email protected]>", "to": ["[email protected]"],
"subject": "Your receipt", "text": "Thanks!"}'Resend error codes
| Status | name | Message | Fix |
|---|---|---|---|
| 400 | validation_error | An error was found with one or more fields in the request. | The message names the field |
| 400 / 401 | validation_error | API key is invalid | Create a new key; this one doesn't exist, was deleted or isn't active |
| 400 | invalid_idempotency_key | Idempotency keys, if present, must have between 1 and 256 characters. | Shorten the key |
| 401 | missing_api_key | Missing API Key | Send Authorization: Bearer re_… |
| 401 | restricted_api_key | This API key is restricted to only send emails. | Use a full_access key for anything but sending |
| 403 | restricted_api_key | API key is not active | Check the key on the API Keys page |
| 403 | suspended_api_key | This API key is suspended | Contact Resend support |
| 403 | validation_error | Testing limit, unverified domain, domain already registered (below) | See the 403 section |
| 404 | not_found | The requested endpoint does not exist. | Check the URL |
| 405 | method_not_allowed | Method is not allowed for the requested path. | Check the HTTP method |
| 409 | invalid_idempotent_request | Same idempotency key within 24 hours, different body | Use a new key, or resend the identical body |
| 409 | concurrent_idempotent_requests | There is another request in progress with the same idempotency key. | Retry later |
| 422 | missing_required_field | The request body is missing one or more required fields. | The message lists them |
| 422 | invalid_attachment | Attachment must have either a `content` or `path`. | Give each attachment content or a URL path |
| 422 | invalid_parameter | For example, the parameter must be a valid UUID | Check the id you passed |
| 429 | rate_limit_exceeded | Too many requests | Slow down; see below |
| 429 | daily_quota_exceeded | You have exceeded your daily email sending quota. | Wait for midnight UTC or upgrade |
| 429 | monthly_quota_exceeded | You have exceeded your monthly email sending quota. | Upgrade, or turn on pay-as-you-go on a paid plan |
| 500 | application_error | An unexpected error occurred. | Retry later |
| 503 | service_unavailable | API is temporarily unavailable | Retry later |
The list also has errors for receiving (email_above_quota), OAuth scopes (invalid_permission), inboxes, Forge domains and DNS checks (dns_lookup_failed); the errors page has them all.
validation_error: one name, several problems
Because validation_error covers so much, the status code and message decide what to do:
- 400 with a field message: a bad value in your request, such as a malformed address or a
limitoutside 1–100. - 400 or 401
API key is invalid: the key doesn't exist, was deleted or isn't active. Read endpoints answer 400 for this, the sending endpoints 401, so don't treat 400 as "my payload is wrong" without reading the message. - 403
You can only send testing emails to your own email address: you're sending from[email protected]to someone other than yourself. Verify your own domain and send from it. - 403
The example.com domain is not verified. Please, add and verify your domain.: thefromdomain isn't a verified domain in this team. See Resend domain not verified. - 403
You have reached your contacts quota. Please upgrade your plan to send more emails.: broadcasts only, when you have more contacts than your Marketing plan allows.
Resend 403: work out which one you have
- Error code 1010 with a valid key: Resend's docs say a missing
User-Agentheader is the likely cause. Every request needs one; SDKs and most HTTP clients send it, but some serverless runtimes and hand-rolled clients don't. AddUser-Agent: my-app/1.0. validation_errorabout testing emails or an unverified domain: a sending domain problem (above).restricted_api_key"API key is not active" orsuspended_api_key: the key itself; check the API Keys page. For key types, see Resend API key permissions.
Resend rate limit and quotas: three different 429s
rate_limit_exceeded is about speed: by default 10 requests per second per team, shared by all your API keys. daily_quota_exceeded and monthly_quota_exceeded are about volume, and both sent and received emails count. The daily quota applies only to the Free plan and resets at midnight UTC, not on a rolling 24 hours.
Every response tells you where you stand (example values):
ratelimit-limit: 10
ratelimit-remaining: 0
ratelimit-reset: 1
retry-after: 1
x-resend-monthly-quota: 2841ratelimit-reset and retry-after are in seconds; x-resend-daily-quota appears only on the Free plan. On a 429, wait retry-after seconds before the next call and send through a queue rather than in parallel bursts. For many emails at once, the batch endpoint sends up to 100 in one request. The dashboard's Logs page can be filtered to 429 responses to show when it happened.
A 429 means the API refused that request. Quota limits can also surface on emails as failed, with a reason such as reached_daily_quota in the email.failed webhook; see Resend email statuses.
Questions
What does Resend error code 1010 mean?
A 403 with code 1010 despite a valid API key usually means the request had no User-Agent header. Add one, for example User-Agent: my-app/1.0.
What is Resend's API rate limit?
10 requests per second per team by default, shared across all API keys. Resend can raise it for trusted senders on request, and the current limit is on the Settings Usage page.
Why does Resend return 422?
A required field or parameter is missing (missing_required_field, missing_required_parameter), an attachment has neither content nor path (invalid_attachment), or a parameter has the wrong format (invalid_parameter). The message names what's wrong.
Why does Resend say "API key is invalid" with a 400?
Read endpoints return 400 validation_error for a key that doesn't exist or was deleted, while sending endpoints return 401. Create a new key on the API Keys page.
Related
- Resend domain not verified: records, pending and failedResend verifies a domain from the resend._domainkey DKIM record and SPF records on send. What pending and failed mean, and the usual DNS fixes.
- Resend API key: create one and pick the right permissionResend API keys are full_access or sending_access. Sending keys only send and get 401 restricted_api_key on reads, so reading data needs full access.
- Resend email statuses: delivered, bounced, delayedWhat each Resend last_event means: sent, delivered, delivery_delayed, bounced, complained, failed, suppressed and more, with the matching webhook events.
- Resend webhooks: event types, payload and verificationResend posts JSON for email.sent, delivered, bounced, complained and more, signed with Svix headers. Event list, payload, signature check and retries.
- Resend suppressed email: why, and how to remove itResend marks an email suppressed when the recipient is on your team's suppression list after a hard bounce or complaint. How to check why, and remove them.
- SendGrid API error codes: 400, 401, 403, 413, 429SendGrid Mail Send answers 202 on success and an errors array otherwise. What 400, 401, 403, 406, 413, 429 and 500 mean, with the exact messages and fixes.