Skip to content

Questions · Published 2026-11-29 · Updated 2026-11-29 · AgentiSend

Resend API key

A Resend API key is the secret token, shown once, that authenticates a call to api.resend.com. You create it with Sending access or Full access.

You create it with Sending access or Full access. Every Resend fact below was read on 28 November 2026 from Create an API key, Create API key, How to handle API keys, Manage API keys, Send emails with Lovable and Resend, Send emails using Supabase with SMTP, Errors, the pricing page, the CLI reference, and src/commands/api-keys/create.ts on resend/resend-cli (that file last changed in commit 84b0fef, fetched from main the same day). The call list those keys authorize is Resend API docs, not this page.

We make AgentiSend. The labelled section near the end is ours. The rest of this page is Resend's.

A Resend API key is created in the dashboard, the API, the CLI, or the MCP server, stored once, then used to send. Sending access sends mail. Full access also manages the account. Replacing a key means creating a new one and then deleting the old one.

How to get a Resend API key

Create an API key says you need at least one key to use Resend from an SDK, the API, the CLI, or an AI tool. It names four ways to create one:

  1. The API keys page in the dashboard. Click Create API Key, enter a name of at most 50 characters, choose a permission, and optionally restrict Sending access to one domain. The page says you can view the key only once.
  2. POST https://api.resend.com/api-keys. The reference takes name (required, 50 characters at most) and permission (full_access or sending_access). domain_id restricts the key to one domain, and only when permission is sending_access.
  3. The CLI. The documented example on the CLI page is resend api-keys create --name "Production" --permission full_access.
  4. The MCP server. Its tool list includes API keys: create, list, and remove. The tool names are on the Resend MCP server page.

The CLI source fetched that day accepts --permission as full_access or sending_access, and its help text calls full_access the default. It sends permission only when you pass the flag. --domain-id is refused unless the permission is sending_access. A non-interactive run requires --name. The command prints the token once.

resend api-keys create --name "Lovable" --permission sending_access --domain-id YOUR_DOMAIN_ID

The same create over HTTP, with the fields the reference lists:

curl -X POST 'https://api.resend.com/api-keys' \
  -H 'Authorization: Bearer re_xxxxxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{"name":"Lovable","permission":"sending_access","domain_id":"YOUR_DOMAIN_ID"}'

The reference's response example returns id, object (api_key), and token. List API keys returns id, name, created_at, and last_used_at. It does not return token. limit is from 1 to 100. Update API key changes the name only, still at most 50 characters. Permission and domain are edited in the dashboard: More options, then Edit API key. Delete API key returns deleted: true. The leaked-key guide says deleting a key revokes it immediately, and there is no separate revoke step.

Full access vs sending access

This is the difference the dashboard asks you to pick, and the difference in the create body's permission field.

Full accessSending access
What the create reference saysCan create, delete, get, and update any resourceCan only send emails
InboxesIncluded in that "any resource" lineOnly Reply to Thread Email, Forward Thread Email, Create Draft, and Send Draft. A key restricted to a domain can use only the inboxes on that domain
Domain restrictionThe domain_id field is only used when permission is sending_accessOptional domain_id
When a send-only key calls something else—Error name restricted_api_key. Errors lists status 401, the message "This API key is restricted to only send emails.", and tells you to use a key with Full access for anything other than sending
What the leaked-key guide recommendsUse it when the key must manage the accountPrefer it. The guide says most applications only need to send, and a Sending access key cannot read contacts if it leaks

The dashboard page says you can change this permission later. The update endpoint cannot. It changes the name, and the dashboard changes the permission and the domain.

The CLI help text calls Full access the default when you omit --permission. The HTTP reference lists permission and does not mark it required, and it does not print a default in the body-parameter text. Pass sending_access in the JSON when the key should only send, rather than relying on an omitted field.

Store the key

Create an API key says to put the token in an environment variable and pass it into the client. The Node example is RESEND_API_KEY=re_xxxxxxxxx in .env, with .env listed in .gitignore, and this construction:

const resend = new Resend(process.env.RESEND_API_KEY);

The same page says the variable is not picked up for you. On Node.js v20 and later it names --env-file=.env, or the dotenv package. How to handle API keys adds: do not share the key, do not put it in the browser or other client-side code, do not hard-code it, and do not commit it. The resend skill states the same RESEND_API_KEY rule.

Rotate a Resend API key

How to handle API keys says keys do not expire. They stay valid until you delete them. There is no expiration field and no automatic rotation. The page's rotation steps are:

  1. Create a new key with the same permission and the same domain scope, in the dashboard or with the API.
  2. Deploy that key everywhere the old one is used.
  3. Confirm it on the Logs page, filtered by API key.
  4. Delete the old key only after that.

Both keys work until you delete the old one. The page says to rotate at least every 90 days, or immediately if you think a key has leaked, and that the dashboard flags a key unused for 30 days or more. If you already know it leaked, the leaked-key guide says to delete it now rather than wait for the 90-day pass. You cannot view the old token again, so the replacement is a new key.

Is a Resend API key free?

Creating a key is not a line on the price table. Pricing, fetched the same day, lists the transactional Free plan at $0 a month, 3,000 emails a month, and 100 emails a day. The security table marks API key permissions as Yes on Free, Pro, Scale, and Enterprise. The priced add-ons on that page are extra domains, a dedicated IP, and single sign-on. A key does not appear among them. Sending with the key still uses the plan's email allowance. Our prices are on AgentiSend vs Resend and Resend alternative pricing.

Resend API key in Lovable

Send emails with Lovable and Resend says to create the key in the Resend dashboard and not to put it in the browser. It names three ways Lovable may wire the key:

  • Store it with the Supabase integration. The page calls this the one to use, and says that at the time of writing Lovable does not securely handle API keys on its own. It points at Lovable's Supabase secrets. You may have to ask the chat to store the key that way. Add API key opens the modal.
  • Ask each user of the generated app for their own key.
  • Put the key in the code. The same page says not to do that in client-side code.

The page also says a new Lovable function sends from resend.dev, which delivers only to the address on the Resend account, and that verifying a domain does not rewrite the From address. You ask Lovable to change From and redeploy. The send itself, after the key is stored, is the call on Resend API docs. If the app should call this API instead, the steps are on Lovable email sending.

Resend API key in Supabase

Send emails using Supabase with SMTP uses the API key as the SMTP password. It requires a key and a verified domain. The credentials it prints are:

FieldValue
Hostsmtp.resend.com
Port465
Usernameresend
Passwordthe API key

In the Supabase dashboard the page's path is Authentication, then Email under Notifications, then SMTP Settings. Sender email and sender name are required. It says you can copy the SMTP block from resend.com/settings/smtp. The password is the whole key, not the key's id.

That guide does not name a permission. The create page says to choose Sending access unless the key must create, delete, get, and update resources. SMTP submits a message, so Sending access matches that instruction. Pass domain_id when the key should send from one domain only.

Auth mail that should leave through this API, rather than through Resend SMTP, is the Send Email Hook on the Supabase guide. The host, port, username, and password for a later SMTP setup here are on the SMTP guide. The status page is what says whether that host is offered.

The same job on AgentiSend

A key here is created with POST /api-keys. The token is returned once and begins with as_. GET /api-keys lists permission, scopes, domain_scope, token_prefix, and the budget, and it does not list the token. The name may be 255 characters. Omit permission and the key is full_access. Pass sending_access for a key that sends.

Full access and sending access here

The two permission names match. What they hold does not stop at Resend's sentence.

sending_access holds emails:send and emails:read. scopes can narrow that list and cannot widen it. A sending key calls POST /emails and reads the messages it sent. A management route answers restricted_api_key. The catalogue message is "This API key is restricted to sending only." The longer page is what restricted_api_key means. Which of the two to hand an agent is which API key permission an agent should have.

full_access holds 20 scopes. It still cannot approve a held send, resume a paused key, or raise a budget. Those answer human_action_required. Over MCP, create_api_key is one of those person's decisions: a connection is refused, and the tool text says to create the key in the console. The AgentiSend MCP server is the tool list. The AgentiSend API docs are the routes.

domain_scope limits sending to one domain already on the account, by name or by id, on create or later with PATCH /api-keys/{id}. That patch renames the key and can replace domain_scope and scopes. It does not change permission and it does not change the token. How do I restrict an API key to one domain? is the scope check.

Every new key is created with a monthly budget equal to the account's included emails. On Free that is 5,000 emails. A key may lower budget_per_period with PATCH /limits/keys/{id}. Raising it is a person's decision. The per-minute ceiling on a new key is 600 requests.

A key can expire. expires_in_days is a whole number from 1 to 365, or you send expires_at inside that same window. Omit both and the key does not expire. Resend's handling page says their keys have no expiration field. Rotation here is POST /api-keys/{id}/rotate: the new token is returned once, the key id and the budget stay, and the previous token keeps working for the grace window in the operation summary. The steps are how to rotate an API key without downtime. DELETE /api-keys/{id} revokes immediately.

curl -sS -X POST https://api.agentisend.com/api-keys \
  -H 'Authorization: Bearer YOUR_FULL_ACCESS_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"name":"Lovable","permission":"sending_access","domain_scope":"example.com"}'

Store token from that response as AGENTISEND_API_KEY on the server. The sample the reference generates for POST /api-keys sends permission full_access, which is what this API stores when the field is omitted. The curl above is the sending key. The generated sample is:

curl -sS -X POST https://api.agentisend.com/api-keys \
  -H "Authorization: Bearer $AGENTISEND_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"name":"example","permission":"full_access"}'
201
{
  "budget_per_period": 5000,
  "created_at": "2026-09-04T09:14:00.000Z",
  "domain_scope": "example",
  "expires_at": "2026-09-04T09:14:00.000Z",
  "id": "9c8f8f0e-3d1a-4d3f-9a1e-2b7c1a0f5e42",
  "inboxes": [],
  "last_used_at": "2026-09-04T09:14:00.000Z",
  "loop_guard": "off",
  "name": "example",
  "object": "api_key",
  "period": "monthly",
  "permission": "full_access",
  "previous_key_expires_at": "2026-09-04T09:14:00.000Z",
  "rate_ceiling_per_minute": 600,
  "request_count_30d": -9007199254740991,
  "rotated_at": "2026-09-04T09:14:00.000Z",
  "scopes": [],
  "system": false,
  "token": "as_abababababababababababababababababababababababababababababababab",
  "token_prefix": "as_abababab"
}
Response
Resend, read 28 November 2026AgentiSend
CreateDashboard, POST https://api.resend.com/api-keys, CLI, or MCPPOST /api-keys. An MCP connection cannot mint a key
Permissionsfull_access or sending_accessThe same two names. Sending holds emails:send and emails:read
One domaindomain_id, only with Sending accessdomain_scope on either permission, by name or id
See the token againNoNo. The list shows token_prefix
Change permission laterDashboard. The API changes the name onlyNot on PATCH /api-keys/{id}. Create another key
ExpiryNone until you delete itOptional, at most 365 days
Replace a keyNew key, deploy, then delete. Both work until the deletePOST /api-keys/{id}/rotate keeps the old token for a grace window. The id and the budget stay
Budget on the keyNot a create field. The plan allowance is on the pricing pageSet when the key is created, at the account's monthly inclusion
Price of a keyIncluded on Free, which that page lists at $0 a month. Not an add-onIncluded. Plan prices are on pricing

FAQ

How do I get a Resend API key?

Open the API keys page, click Create API Key, name it in 50 characters or fewer, and choose Sending access unless the key must create, delete, get, and update other resources. The token is shown once. The same create is the API, resend api-keys create, or the MCP server.

What is the difference between full access and sending access on a Resend API key?

Full access can create, delete, get, and update any resource. Sending access can send emails, and on inboxes it can only reply, forward, create a draft, and send a draft. A sending key that calls anything else gets restricted_api_key.

Is a Resend API key free?

The pricing page lists API key permissions as included on the Free plan, which it prices at $0 a month, and on the paid plans. A key is not one of the add-ons. Mail you send with it still counts against the plan's email allowance, 3,000 a month and 100 a day on Free.

Where do I put a Resend API key in Lovable?

Resend's Lovable guide says to store it with the Supabase integration, and says Lovable does not securely handle API keys on its own. It also names asking each user for a key, or putting the key in code, and it says not to expose the key in the browser.

How do I use a Resend API key with Supabase?

Resend's SMTP guide sets the password to the API key. The host is smtp.resend.com, the port is 465, and the username is resend. In Supabase that page's path is Authentication, then Email, then SMTP Settings. A verified domain is required.

Can I view a Resend API key again after I create it?

No. The create page and the handling page both say the key can be viewed only once. The list API returns the id, the name, and when it was last used, and it does not return the token. A lost key is replaced with a new one.

Do Resend API keys expire?

No. The handling page says they stay valid until you delete them, and that there is no automatic rotation. It says to rotate at least every 90 days, and the dashboard flags a key that has not been used for 30 days or more.

What does restricted_api_key mean for a Resend API key?

Resend's error reference says the message is "This API key is restricted to only send emails." and tells you to use a Full access key for anything other than sending.

Next