Skip to the page

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.

opensend api-keys create [flags]
Needs the scopeapi_keys:write
Changes data

Flags

  • --namestringRequired

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

  • --accessstring

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

    One offullsending

  • --domain-idstring

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

  • --modestring

    live for a key that sends real email. test for a key of the sandbox: every email it sends is simulated, reaches nobody and needs no verified domain. A test key always has sending access. Without it the key is live.

    One oflivetest

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.

  • 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.

  • tokenstring

    The key itself. It is shown this once and cannot be read again.