Skip to main content
POST
Create an API key

Authorizations

Authorization
string
header
required

Monid API key

Body

application/json
label
string
required

Human-readable label for the key. Unique among non-revoked keys in the workspace.

Minimum string length: 1
Example:

"ci-runner"

scopes
enum<string>[]

Scopes for the new key. They must be a subset of your own key's scopes. Omit to copy your key's scopes.

Minimum array length: 1
Available options:
*,
runs:*,
resources:*,
wallet:*,
topups:*,
controls:*,
api_keys:*,
runs:create,
runs:get,
runs:list,
runs:update,
resources:read,
resources:create,
resources:update,
resources:delete,
wallet:read,
wallet:update,
topups:create,
controls:read,
controls:create,
controls:update,
controls:delete,
api_keys:read,
api_keys:create,
api_keys:update,
api_keys:revoke
Example:
expiresAt
string<date-time>

When the key stops working, in ISO 8601. It cannot be later than your own key's expiry. Omit to use your key's expiry, or no expiry if your key has none. It cannot be changed later.

Example:

"2027-01-01T00:00:00Z"

Response

API key created. The full key is in this response only.

apiKey
string
required

The full API key. It is shown only once, so store it now. It cannot be retrieved again.

Example:

"monid_live_a1b2c3d4e5f6g7h8i9j0k1l2"

label
string
required
Example:

"ci-runner"

keyPrefix
string
required

The start of the key, monid_live_ in production. The full key is in apiKey.

Example:

"monid_live_"

workspaceId
string
required

The workspace the key belongs to.

owner
string
required

The user the key belongs to.

createdBy
string
required

Who created the key.

Example:

"USER#user_2abc"

scopes
enum<string>[]
required

The scopes the key holds, fixed at creation. See GET /v1/api-keys/scopes for every scope.

Minimum array length: 1
Available options:
*,
runs:*,
resources:*,
wallet:*,
topups:*,
controls:*,
api_keys:*,
runs:create,
runs:get,
runs:list,
runs:update,
resources:read,
resources:create,
resources:update,
resources:delete,
wallet:read,
wallet:update,
topups:create,
controls:read,
controls:create,
controls:update,
controls:delete,
api_keys:read,
api_keys:create,
api_keys:update,
api_keys:revoke
Example:
status
enum<string>
required

ACTIVE, EXPIRED or REVOKED. Only active keys work.

Available options:
ACTIVE,
EXPIRED,
REVOKED
origin
enum<string>
required

How the key was created, such as DASHBOARD or API.

Available options:
DASHBOARD,
API,
AEP,
SYSTEM
createdAt
string<date-time>
required

Creation time (ISO 8601).

expiresAt
string<date-time>

When the key stops working, in ISO 8601. Absent when the key never expires.