latestOpenAPI 3.1.02026-08-221163801019.2 KB

f0f28319e448

Organization

Create an API key

Create a new API key for the given organization. This API key authorizes the organization to retrieve a per-user access token for users in this organization which allows the users to access most of Amigo's API endpoints. This API key is valid for the duration specified in the request. There's no way to extend the duration of an API key. The API key is not retrievable after issuance, so please keep it in a secure location.

Each organization has a maximum limit of 20 API keys.

Permissions

This endpoint requires the following permissions:

  • Organization:CreateAPIKey.
  • This endpoint requires the authenticated user to have more privileges than the role associated with the API key.
post/v1/{organization}/organization/api_key/

Path parameters

organizationstring required

Headers

x-mongo-cluster-namestring nullable

The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.

The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.

Sec-WebSocket-Protocolstring[]

Request body

namestring required
durationstring duration required

The valid duration of the API key. Should be supplied in the ISO8601 format. Must be between 1 to 90 days.

role_namestring

The name of the role associated with the key. When using this API key to authenticate, it can only authenticate for users with roles that are less permissive than this role.

Response

Succeeded.

api_key_idstring required

An identifier for this API key. You must present this along with the API key to authenticate.

api_keystring required

The API key. This is only visible once and is not retrievable later. Please store safely.

expires_atstring date-time required

Expiration time of the API key in UTC.