Creates an API key for a user

Note: A user is only allowed to have a maximum of 10 active keys per organization at any given time. Refer to Managing Keys for more information on required permissions.

SecuritybearerAuth
Request
path Parameters
userId
required
integer <int64>

User ID of the user to create an API key

query Parameters
o
required
integer <int64>

The Organization of the user.

Request Body schema: application/json
required
name
required
string

A unique name for this key. Users are not allowed to have two keys with the same name under a given organization.

expires_at
string <date-time>

The time at which (in UTC) the key should automatically expire. Format is ISO8601. Example: 2020-08-05T18:21:47+0000

Responses
200

Successful Operation

4XX

Invalid Request

default

Invalid Request

post/users/{userId}/api_keys
Request samples
application/json
{
  • "name": "My Test API Key",
  • "expires_at": "2021-12-05T18:21:47+0000"
}
Response samples
application/json
{
  • "id": 0,
  • "name": "string",
  • "is_enabled": true,
  • "expires_at": "2019-08-24T14:15:22Z",
  • "created_at": "2019-08-24T14:15:22Z",
  • "user": {
    • "id": 0,
    • "firstname": "string",
    • "lastname": "string",
    • "email": "user@example.com"
    }
}