POST
/
projects
/
{projectIdOrName}
/
api-keys
curl --request POST \
  --url https://api.withampersand.com/v1/projects/{projectIdOrName}/api-keys \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <api-key>' \
  --data '{
  "label": "MailMonkey API Key",
  "scopes": [
    [
      "full",
      "frontend"
    ]
  ]
}'
{
  "key": "api-key-123",
  "label": "MailMonkey API Key",
  "scopes": [
    [
      "full",
      "frontend"
    ]
  ],
  "projectId": "project-id-123",
  "active": true
}

Authorizations

X-Api-Key
string
header
required

Path Parameters

projectIdOrName
string
required

Body

application/json
label
string
required

A short name for the API key.

Example:

"MailMonkey API Key"

scopes
string[]

The scopes for the API key.

Response

201
application/json
Created
key
string
required

The API key.

Example:

"api-key-123"

label
string
required

A short name for the API key.

Example:

"MailMonkey API Key"

scopes
string[]
required

The scopes for the API key.

projectId
string
required

The project ID.

Example:

"project-id-123"

active
boolean

Whether the API key is active.

Example:

true