API Reference
Errors
Troubleshoot problems with this comprehensive breakdown of all error codes.
Error schema
We use standard HTTP response codes for success and failure notifications, and our errors are further classified by type.
missing_required_field
- Status: 422
- Message: The request body is missing one or more required fields.
- Suggested action: Check the error message to see the list of missing fields.
invalid_attachment
- Status: 422
- Message: Attachment must have either a
content
orpath
. - Suggested action: Attachments must either have a
content
(strings, Buffer, or Stream contents) orpath
to a remote resource (better for larger attachments).
missing_api_key
- Status: 401
- Message: Missing API key in the authorization header.
- Suggested action: Include the following header
Authorization: Bearer YOUR_API_KEY
in the request.
invalid_api_key
- Status: 403
- Message: The API key is not valid.
- Suggested action: Generate a new API key in the dashboard.
invalid_from_address
- Status: 403
- Message: The
from
address is not valid. - Suggested action: Review your existing domains in the dashboard.
invalid_to_address
- Status: 403
- Message: You can only send testing emails to your own email address.
- Suggested action: In order to send emails to any external address, you need to add a domain and use that as the
from
address instead ofonboarding@resend.dev
.
not_found
- Status: 404
- Message: The requested endpoint does not exist.
- Suggested action: Change your request URL to match a valid API endpoint.
method_not_allowed
- Status: 405
- Message: This endpoint does not support the specified HTTP method.
- Suggested action: Change the HTTP method to follow the documentation for the endpoint.
invalid_scope
- Status: 422
- Message: This endpoint does not support the specified scope.
- Suggested action: Change the scope to follow the documentation for the endpoint.
rate_limit_exceeded
- Status: 429
- Message: Too many requests. Please limit the number of requests per second. Or contact support to increase rate limit.
- Suggested action: You should read the response headers and reduce the rate at which you request the API. This can be done by introducing a queue mechanism or reducing the number of concurrent requests per second. If you have specific requirements, contact support to request a rate increase.
daily_quota_exceeded
- Status: 429
- Message: You have reached your daily email sending quota.
- Suggested action: Upgrade your plan to remove daily quota limit or wait until 24 hours have passed to continue sending.
internal_server_error
- Status: 500
- Message: An unexpected error occurred.
- Suggested action: Try the request again later. If the error does not resolve, check our status page for service updates.