Errors
A request that fails says so with an HTTP status and a code your program can branch on.
The answer of a failed request
The status is 4xx or 5xx, and the body is one error object.
{ "error": { "type": "conflict_error", "code": "domain_taken", "message": "This workspace already has that domain.", "requestId": "req_5f2c81d09ab3" }}codeis what went wrong. Branch on it: it stays the same when the wording changes.messagesays it in words, for a person. A wrong input names the field.typeis the family the code belongs to.requestIdnames the request. It is also in thex-request-idheader.
Kinds of errors
Every error is one of these kinds, and the kind decides the status. Where nothing more exact can be said, the kind is the code itself, as with unauthorized, forbidden, not_found and validation_error.
- Code
unauthorized- Status
- 401
- Meaning
- No key was sent, or the key is wrong or was revoked.
- Code
forbidden- Status
- 403
- Meaning
- The key or the person is known but may not do this.
- Code
not_found- Status
- 404
- Meaning
- Nothing has that id in this workspace.
- Code
validation_error- Status
- 422
- Meaning
- The input is wrong. The message names the field.
- Code
conflict- Status
- 409
- Meaning
- The request cannot be done as things stand, for example because a name is taken.
- Code
limit_reached- Status
- 403
- Meaning
- The plan of the workspace does not allow more of this.
- Code
unavailable- Status
- 503
- Meaning
- A service the method needs is not connected, or it did not answer.
- Code
internal_error- Status
- 500
- Meaning
- Something failed on the server. The request id in the answer finds it in the logs.
- Code
rate_limited- Status
- 429
- Meaning
- Too much was asked in a short time. Try again later.
What to try again
- A
503means a service behind the API did not answer, or is not connected. When the message says it is safe to try again, nothing was sent or charged. - A
429andidempotency_busypass by themselves. Wait a little and repeat. - A
422,403,404or any other409will fail the same way again. Change the request first. - When a send fails without an answer at all, repeat it with the same idempotency key. Sending email explains how.
Every code
These are the codes a method can answer with beyond the kinds above.
- Code
domain_invalid- Status
- 422
- Meaning
- Give a domain name such as mail.example.com, without a protocol or a path.
- Code
domain_taken- Status
- 409
- Meaning
- This workspace already has that domain.
- Code
domain_no_provider- Status
- 409
- Meaning
- No sending provider is connected yet, so this domain has no records to check.
- Code
email_no_body- Status
- 422
- Meaning
- Give the email a text body, an HTML body, or both.
- Code
email_domain_missing- Status
- 422
- Meaning
- The from address must be on a domain this workspace has added and verified.
- Code
audience_missing- Status
- 422
- Meaning
- There is no audience with that id in this workspace.
- Code
broadcast_sent- Status
- 409
- Meaning
- This broadcast has already been sent.
- Code
broadcast_past- Status
- 422
- Meaning
- The time to send at must be in the future.
- Code
alias_taken- Status
- 409
- Meaning
- This workspace already has a template with that alias.
- Code
webhook_url- Status
- 422
- Meaning
- Give a public https address, such as https://example.com/hooks/mail.
- Code
member_taken- Status
- 409
- Meaning
- That person is already in this workspace.
- Code
owner_stays- Status
- 409
- Meaning
- The owner of a workspace cannot be removed.
- Code
workspace_name- Status
- 409
- Meaning
- Send the name of the workspace as confirm, exactly as it is written, to close it.
- Code
workspace_paid- Status
- 409
- Meaning
- This workspace is on a paid plan. Cancel the plan on the billing page, then close it.
- Code
owner_role- Status
- 409
- Meaning
- The owner keeps that role until ownership is handed over.
- Code
domain_limit- Status
- 403
- Meaning
- This workspace has every domain its plan allows. Remove one, or move to a larger plan.
- Code
member_limit- Status
- 403
- Meaning
- Every seat on this plan is taken. Remove someone, or move to a larger plan.
- Code
automation_not_active- Status
- 409
- Meaning
- Only an active automation can be paused.
- Code
automation_active- Status
- 409
- Meaning
- This automation is already active.
- Code
body_invalid- Status
- 422
- Meaning
- The body of the request is not valid JSON.
- Code
range_invalid- Status
- 422
- Meaning
- A custom range needs from and to as dates, such as 2026-11-01, with from on or before to.
- Code
origin_refused- Status
- 403
- Meaning
- A signed-in browser may only change things from the dashboard itself.
- Code
sign_in_off- Status
- 409
- Meaning
- Signing in is not set up on this server yet.
- Code
server_owner_only- Status
- 403
- Meaning
- Only the owner of this server, signed in, can change its settings.
- Code
not_self_hosted- Status
- 409
- Meaning
- These settings exist only on a server a team hosts itself.
- Code
platform_not_linked- Status
- 503
- Meaning
- This workspace is still being connected to the sending platform. Try again shortly.
- Code
platform_unreachable- Status
- 503
- Meaning
- The sending platform did not answer. Nothing was sent, so it is safe to try again.
- Code
send_refused- Status
- 422
- Meaning
- The sending platform refused this message.
- Code
domain_not_verified- Status
- 422
- Meaning
- Verify the domain of the from address before sending from it.
- Code
domain_refused- Status
- 409
- Meaning
- The sending platform refused this domain. It may belong to another account.
- Code
contact_taken- Status
- 409
- Meaning
- That address is already a contact here. Add that contact to an audience instead.
- Code
contact_limit- Status
- 403
- Meaning
- This workspace has every contact its plan allows. Remove some, or move to a larger plan.
- Code
email_limit- Status
- 403
- Meaning
- This workspace has sent every email its plan allows this month. Sending starts again on the first of the month, or move to a larger plan.
- Code
broadcast_empty- Status
- 409
- Meaning
- Nobody is subscribed to the audience of this broadcast, so there is no one to send it to.
- Code
unsubscribe_invalid- Status
- 404
- Meaning
- This unsubscribe link is not valid any more.
- Code
billing_off- Status
- 409
- Meaning
- Payments are not connected yet, so plans cannot be changed here.
- Code
plan_unsold- Status
- 422
- Meaning
- That plan cannot be bought here.
- Code
billing_unreachable- Status
- 503
- Meaning
- The payment service did not answer. Nothing was charged, so it is safe to try again.
- Code
ask_off- Status
- 409
- Meaning
- Ask is not connected to a model yet, so nothing was looked up or changed.
- Code
ask_unreachable- Status
- 503
- Meaning
- The assistant did not answer. Nothing was changed, so it is safe to ask again.
- Code
ask_busy- Status
- 429
- Meaning
- This workspace has asked a lot in the last hour. Try again in a little while.
- Code
ask_change_unknown- Status
- 422
- Meaning
- That is not a change the assistant can carry out.
- Code
email_no_subject- Status
- 422
- Meaning
- An email needs a subject, its own or the one of its template.
- Code
email_no_sender- Status
- 422
- Meaning
- An email needs a sender in
from, its own or the one of its template.
- Code
email_recipients_many- Status
- 422
- Meaning
- An email goes to at most 50 addresses, counting to, cc and bcc together.
- Code
email_not_scheduled- Status
- 409
- Meaning
- Only an email that is still scheduled can be cancelled or moved.
- Code
email_schedule_past- Status
- 422
- Meaning
- The time to send at has to be in the future.
- Code
email_schedule_far- Status
- 422
- Meaning
- An email can be scheduled at most 30 days ahead.
- Code
template_missing- Status
- 422
- Meaning
- There is no published template with that id or alias.
- Code
template_variable_missing- Status
- 422
- Meaning
- The template needs a value for each of its variables. Missing:
- Code
template_designed- Status
- 422
- Meaning
- This template is built from blocks, so its html and its text are made from its design. Send design to change it, or design: null to turn it into an HTML template.
- Code
template_written- Status
- 422
- Meaning
- This template is written as HTML, so it has no blocks to change. Send templates.update with a design to turn it into a template built from blocks.
- Code
broadcast_designed- Status
- 422
- Meaning
- This broadcast is built from blocks, so its html and its text are made from its design. Send design to change it, or design: null to turn it into a broadcast written as HTML.
- Code
attachments_too_large- Status
- 422
- Meaning
- The attachments of one email can be 10 MB together at most.
- Code
idempotency_busy- Status
- 409
- Meaning
- A request with this idempotency key is still being handled. Try again in a moment.
- Code
idempotency_mismatch- Status
- 409
- Meaning
- This idempotency key was already used with a different request.
- Code
email_change_refused- Status
- 409
- Meaning
- The sending platform would not change this email.
- Code
suppression_refused- Status
- 422
- Meaning
- The sending platform would not change the suppression list.
- Code
suppression_missing- Status
- 404
- Meaning
- That address is not on the suppression list.
- Code
key_domain- Status
- 403
- Meaning
- This API key may only send from the domain it was made for.
- Code
key_domain_access- Status
- 422
- Meaning
- Only a key with sending access can be limited to one domain.
- Code
key_unknown- Status
- 422
- Meaning
- Resend does not know this key. Copy it again from where your program keeps it.
- Code
key_enrolled- Status
- 409
- Meaning
- This key is already enrolled.
- Code
key_wider- Status
- 422
- Meaning
- This key can only send email at Resend, so it cannot have full access here.
- Code
key_test_access- Status
- 422
- Meaning
- A test key only sends, so it cannot have full access. Leave
accessassending.
- Code
sandbox_mixed- Status
- 422
- Meaning
- A test address cannot share an email with a real address. Send them as two emails, or use a test key.
- Code
sandbox_address- Status
- 422
- Meaning
- There is no test address with that name. The test addresses are:
- Code
sandbox_limit- Status
- 403
- Meaning
- This workspace has sent every test email it may send this month. Test emails start again on the first of the month.
- Code
source_unreachable- Status
- 503
- Meaning
- Resend did not answer. Nothing was changed, so it is safe to try again.
- Code
chat_personal- Status
- 403
- Meaning
- Chats belong to a signed-in person. An API key has none.
- Code
automation_incomplete- Status
- 422
- Meaning
- The automation cannot be published yet.
- Code
automation_unpublished- Status
- 409
- Meaning
- Publish the automation before you start it.
- Code
automation_off- Status
- 409
- Meaning
- Nobody can enter an automation that is not active.
- Code
automation_large- Status
- 422
- Meaning
- The flow is too large. Keep long emails in templates.
- Code
run_ended- Status
- 409
- Meaning
- That run has already ended.
- Code
run_not_failed- Status
- 409
- Meaning
- Only a run that failed at one of its steps can be tried again.
- Code
run_exists- Status
- 409
- Meaning
- This person is in the automation already, or may not enter it again.
- Code
event_taken- Status
- 409
- Meaning
- This workspace already has an event with that name.
- Code
event_data- Status
- 422
- Meaning
- The data does not fit the schema of the event.
- Code
contact_missing- Status
- 422
- Meaning
- There is no contact with that id in this workspace.
- Code
person_missing- Status
- 422
- Meaning
- Give the address of the person, or the id of a contact.
- Code
import_off- Status
- 409
- Meaning
- Imports are off: AUTH_SECRET is not set, so the key of the other account could not be kept sealed.
- Code
import_running- Status
- 409
- Meaning
- An import is already running in this workspace. Wait for it, or cancel it.
- Code
import_ended- Status
- 409
- Meaning
- This import has already ended.
- Code
import_key_restricted- Status
- 422
- Meaning
- This key can only send email at Resend, so it cannot read the account. Make a key with full access there and use that one.
- Code
property_taken- Status
- 409
- Meaning
- This workspace already has a contact property with that key.
- Code
property_limit- Status
- 403
- Meaning
- A workspace takes 100 contact properties at most. Delete one first.
- Code
topic_missing- Status
- 422
- Meaning
- There is no topic with that id.
- Code
topic_limit- Status
- 403
- Meaning
- A workspace takes 100 topics at most. Delete one first.
- Code
topic_in_use- Status
- 409
- Meaning
- A broadcast that has not been sent yet uses this topic. Change or delete that broadcast first.
- Code
images_off- Status
- 409
- Meaning
- Storage for images is not connected yet, so the image was not kept.
- Code
image_url- Status
- 422
- Meaning
- The url has to be the public https address of an image, such as https://example.com/logo.png.
- Code
image_large- Status
- 422
- Meaning
- The content is larger than 5 MB, which is the most an image can be.
- Code
image_kind- Status
- 422
- Meaning
- The content has to be a PNG, JPEG, GIF or WebP image. Its kind is read from the file itself, not from its name.
- Code
image_svg- Status
- 422
- Meaning
- The content is an SVG image, which is not taken. Send a PNG, JPEG, GIF or WebP image.
- Code
support_off- Status
- 409
- Meaning
- The contact form is not connected on this server yet, so the message was not sent.
- Code
support_refused- Status
- 403
- Meaning
- The message did not pass the check that keeps programs out of the contact form, so it was not sent.
- Code
support_busy- Status
- 429
- Meaning
- Too many messages came from here in the last hour. Try again in a little while.
- Code
support_undelivered- Status
- 503
- Meaning
- The mail service did not take the message. Nothing was sent, so it is safe to try again.