Merkl Developer Portal logo
post

/v4/organizations/{organizationId}/api-keys

Create a key for the caller, or for a service account with serviceAccountId. Needs api_key.create; a service account also needs api_key.manage on it. The secret is returned once. An organization holds at most 5 active keys per creator (409). Managing the credentials of a service account lets the holder act with that service account's rights.

Path parameters

organizationIdstring (uuid)
required

Request body

descriptionstring
expiresAtstring (date-time)

ISO 8601, in the future

serviceAccountIdstring (uuid)

The service account the key belongs to. Omit it for a personal key of the caller. Managing the credentials of a service account lets the holder act with that service account's rights.

Responses

200
Response for status 200
Schema
object
idstring
required
organizationIdstring | null
required
userIdstring | null
required
prefixstring
required
descriptionstring | null
required
tiernumber
required
issuedByUserIdstring | null
required
createdAtstring
required
expiresAtstring | null
required
revokedAtstring | null
required
rawKeystring | null
required
Example
{
  "id": "string",
  "organizationId": "string",
  "userId": "string",
  "prefix": "string",
  "description": "string",
  "tier": 0,
  "issuedByUserId": "string",
  "createdAt": "string",
  "expiresAt": "string",
  "revokedAt": "string",
  "rawKey": "string"
}