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.

SecuritybearerAuth
Request
path Parameters
userId
required
integer

User ID of the user to create an API key

query Parameters
o
required
integer

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

400

Invalid Request

401

Access token is missing or invalid

403

You do not have permission to perform this action.

404

Entity not found

429

Too many requests

503

Service Unavailable

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"
    }
}