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.
opensend api-keys enroll [flags]Flags
--namestringRequiredA name to recognise the key by, such as the app that holds it. Up to 120 characters.
--tokenstringRequiredThe key itself, as Resend gave it. It starts with
re_. It is checked with Resend, kept as a hash and never shown again.--accessstringWhat the key may do here:
fullorsending. Without it the key keeps what it may do at Resend. A key that only sends there cannot be givenfull.One of
fullsending--domain-idstringThe id of the one domain the key may send from. Only for a key with
sendingaccess. Up to 64 characters.
Returns
The command prints the answer: as JSON when its output goes to a file or another program, and as a table or a list of fields in a terminal. When the API refuses, the error goes to the error stream and the command ends with a code that names the failure. Output and scripts lists the codes.
object"api_key"Always
api_key.idstringThe id of the key.
namestringThe name you gave the key.
accessstringWhat the key may do:
fullfor everything,sendingfor sending email and nothing else.One of
fullsendingmodestringlivefor a key that sends real email,testfor a key whose emails are simulated and reach nobody.One of
livetestpreviewstringThe start of the key, enough to recognise it.
domainIdstring | nullThe id of the one domain a sending key may send from, or
nullwhen it may send from any.domainstring | nullThe name of that domain, or
null.lastUsedAtstring | nullWhen the key last made a request, or
nullif it never has.createdAtstringWhen the key was made.