Access denied) when sending requests to the Resend API. This happens because requests without a User-Agent header are blocked before they reach the API.
The Problem
The Resend API requires all HTTP requests to include aUser-Agent header. When your HTTP client doesn’t send one, the request is rejected with a 403 status code and error 1010 before it ever reaches the API.
This can be confusing because:
- The error doesn’t come from the Resend API itself
- Tools like
curlautomatically include aUser-Agentheader, so requests from the command line work fine - The error message doesn’t clearly indicate that the missing header is the cause
How to Identify This Issue
- You’re getting a 403 error, but your API key and domain are correct
- The error response contains an error code of
1010 - The same request works when using
curlfrom the command line
Solution
Add aUser-Agent header to your HTTP requests.
Example with Node.js fetch:
If you’re using a Resend SDK, the
User-Agent header is already
included automatically. This issue typically only affects direct HTTP requests
made without an SDK.Still Having Issues?
If you’ve added aUser-Agent header and you’re still getting a 403 error:
- Verify that the header is being sent correctly by inspecting your outgoing request.
- Ensure your API key is valid and has the necessary permissions.
- Check that your domain is verified in the Resend Domains page.
- Contact Resend support with details about your error.