Skip to the page

Enroll existing API key

Makes a key you already use at Resend work here, so a program that holds it only needs a new address. The key is checked with Resend, kept as a hash like any other key, and gets the access it has there unless you narrow it.

POST/v1/api-keys/enroll
Needs the scopeapi_keys:write

Body parameters

  • namestringRequired

    A name to recognise the key by, such as the app that holds it. Up to 120 characters.

  • tokenstringRequired

    The key itself, as Resend gave it. It starts with re_. It is checked with Resend, kept as a hash and never shown again.

  • accessstring

    What the key may do here: full or sending. Without it the key keeps what it may do at Resend. A key that only sends there cannot be given full.

    One offullsending

  • domainIdstring

    The id of the one domain the key may send from. Only for a key with sending access. Up to 64 characters.

Returns

  • object"api_key"

    Always api_key.

  • idstring

    The id of the key.

  • namestring

    The name you gave the key.

  • accessstring

    What the key may do: full for everything, sending for sending email and nothing else.

    One offullsending

  • modestring

    live for a key that sends real email, test for a key whose emails are simulated and reach nobody.

    One oflivetest

  • previewstring

    The start of the key, enough to recognise it.

  • domainIdstring | null

    The id of the one domain a sending key may send from, or null when it may send from any.

  • domainstring | null

    The name of that domain, or null.

  • lastUsedAtstring | null

    When the key last made a request, or null if it never has.

  • createdAtstring

    When the key was made.