API Keys

Endpoints related to managing a hub's API keys.

List API Keys

Requires the api-keys-manage capability.

SecuritybearerAuth and hubAuth
Request
query Parameters
sort
Array of strings

An array of sort values. To sort descending, put a - in front of the value, e.g. -id.

filter
object
object

In a list return, the data associated with the page number and size returned. 20 results per page, page 2 would be page[size]=20&page[number]=2

Responses
200

Returns a collection of API Key resources.

default

General error response from the platform

get/v1/hubs/current/api-keys
Response samples
application/json
{
  • "data": [
    ]
}

Create API Key

Requires the api-keys-manage capability.

SecuritybearerAuth and hubAuth
Request
Request Body schema: application/json

Parameters for creating an API Key.

name
required
string

A name given to the API Key.

role_id
required
string <objectid> (ID)

The ID of the role this API Key is a member of.

ips
Array of strings or null

An array of approved IPs from which this API Key can be used.

Responses
201

Returns an API Key.

default

General error response from the platform

post/v1/hubs/current/api-keys
Request samples
application/json
{
  • "name": "string",
  • "role_id": "651586fca6078e98982dbd90",
  • "ips": [
    ]
}
Response samples
application/json
{
  • "data": {
    }
}

Get API Key

Requries the api-keys-manage capability.

SecuritybearerAuth and hubAuth
Request
path Parameters
apikeyId
required
string

The ID of the API Key.

query Parameters
include
Array of strings

A comma separated list of include values. Included resources will show up under the root document's include field, with the key being the id of the included resource. In the case of applying an include to a collection of resources, if two resources share the same include, it will only appear once in the return.

Items Value: "roles"
Responses
200

Returns an API Key resource.

default

General error response from the platform

get/v1/hubs/current/api-keys/{apikeyId}
Response samples
application/json
{
  • "data": {
    },
  • "includes": {
    }
}

Update API Key

Requires the api-keys-manage capability.

SecuritybearerAuth and hubAuth
Request
path Parameters
apikeyId
required
string

The ID of the API Key.

Request Body schema: application/json

Parameters for updating an API Key.

name
string

A name given to the API Key.

role_id
string <objectid> (ID)

The ID of the role this API Key is a member of.

ips
Array of strings or null

An array of approved IPs from which this API Key can be used.

Responses
200

Returns an API Key.

default

General error response from the platform

patch/v1/hubs/current/api-keys/{apikeyId}
Request samples
application/json
{
  • "name": "string",
  • "role_id": "651586fca6078e98982dbd90",
  • "ips": [
    ]
}
Response samples
application/json
{
  • "data": {
    }
}

Delete API Key

Requires the 'api-keys-manage' capability.

SecuritybearerAuth and hubAuth
Request
path Parameters
apikeyId
required
string

The ID of the API Key.

Responses
200

Returns an API Key.

default

General error response from the platform

delete/v1/hubs/current/api-keys/{apikeyId}
Response samples
application/json
{
  • "data": {
    }
}