Skip to Content
MailroomMailroom home
API referenceA P I Keys

Create an API key

The plaintext secret is returned once.

POST
/api-keys

The plaintext secret is returned once.

Authorization

bearerAuth
headerAuthorizationBearer <mr_live_ / mr_test_>

API key. Never log the secret.

Header Parameters

Idempotency-Key?string

Stored 24h. Same key + body returns the original response.

Request Body

application/json
  1. body
name*string
scopes?array<>
agent_id?string
domain_ids?array<string>
expires_at?string
Formatdate-time

Response Body

Key with secret

application/json
  1. response
id?string
name?string
prefix?string
scopes?array<>
agent_id?string|null
created_at?string
Formatdate-time
last_used_at?|
Formatdate-time
key?string

Plaintext secret, shown once.

Example Request
curl -X POST 'https://api.mailroom.gosuevals.com/v1/api-keys' \  -H 'Content-Type: application/json' \  -d '{  "name": "string"}'
Example Response201
{  "id": "string",  "name": "string",  "prefix": "string",  "scopes": [    "emails:send"  ],  "agent_id": "string",  "created_at": "2019-08-24T14:15:22Z",  "last_used_at": "2019-08-24T14:15:22Z",  "key": "string"}