Create API key
Creates an API key. The token is in this answer and is never shown again, so store it now. A key with sending access can be limited to one domain: it then sends from that domain only. With mode: test the key belongs to the sandbox: what it sends is simulated and reaches nobody.
api_keys_createArguments
namestringRequiredA name to recognise the key by, such as the app that uses it. Up to 120 characters.
accessstringWhat the key may do:
fullfor everything,sendingfor sending email and nothing else. Without it the key getssending.One of
fullsendingdomainIdstringThe id of the one domain the key may send from. Only for a key with
sendingaccess. Up to 64 characters.modestringlivefor a key that sends real email.testfor a key of the sandbox: every email it sends is simulated, reaches nobody and needs no verified domain. A test key always hassendingaccess. Without it the key islive.One of
livetest
Returns
The answer comes back under structuredContent, with the same JSON as text in content. A call the API refuses comes back with isError set, and the code and the message under structuredContent.error. MCP shows how to connect a client.
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.
tokenstringThe key itself. It is shown this once and cannot be read again.