Create API key

Creates a key. The token is returned only in this response, so store it securely.

POST/api-keys

Body parameters

  • namestringrequired

    A name to recognise the key, e.g. Production.

  • permission'full' | 'sending_access'

    Default full.

  • domain_idstring

    Limit the key to one sending domain.

The API key object

A key for the API and SMTP relay. Its token is only shown when it’s created.

  • idstring

    Unique ID of the API key.

  • namestring

    The name you gave it.

  • permissionstring

    full (every endpoint) or sending_access (only sending email).

  • created_atstring

    When it was created (ISO 8601, UTC).

  • last_used_atstring | null

    When it was last used, to the minute.

  • tokenstring

    Only in the create response: the secret key, starting with mv_.

Request

curl -X POST 'https://api.mailvina.com/api-keys' \
  -H 'Authorization: Bearer mv_xxxxxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "Production",
  "permission": "sending_access"
}'

Response

{
  "id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e",
  "token": "mv_123456789_abcdefghijklmnop"
}