Update API key

Prev Next
Patch
/api_key/{api_key_id}

Update an existing API key

Security
HTTP
Type bearer

Bearer token authentication. Include the token in the Authorization header: Authorization: Bearer <your-token>

Path parameters
api_key_id
stringRequired

Supermetrics API key ID

Body parameters
object
description
string

Internal API key description

scope_names
Array of string

List of permission scopes for the API key

string
Valid values[ "ds_accounts_read", "ds_login_links_read", "ds_login_links_write", "ds_logins_read", "ds_logins_write", "ds_queries_read", "ds_queries_run", "table_groups_read", "table_groups_write", "team_lists_read", "team_lists_write", "team_settings_read", "team_settings_write" ]
allow_ips
Array of string

List of fixed or CIDR formatted IP addresses allowed to use API key. Only IPv4 is supported.

string
is_enabled
boolean

Whether API key is enabled and can be used in requests

behalf_of_user_id
string

Supermetrics user ID the API key identifies as. Use null to remove previously saved value.

Responses
200

API key updated successfully

Expand All
object
meta
object
request_id
string

API request ID

data
object (ApiKey)
@type
string
Valid values[ "api_key" ]
api_key_id
string

Supermetrics API key ID

created_time
string (date-time)

ISO 8601 datetime for when API key was created

description
string

Internal API key description

key_type
string

Type of API key

key_start
string

First 10 characters from the API key value

key_value
string

API key value as plain text, when requested. Defaults to null.

scope_names
Array of string

List of permission scopes for the API key

string
allow_ips
Array of string

List of fixed or CIDR formatted IP addresses allowed to use API key

string
is_enabled
boolean

Whether API key is enabled and can be used in requests

behalf_of_user_info
object (User)
@type
string
Valid values[ "user" ]
user_id
string

Supermetrics user ID

email
string

Supermetrics user email

400

API Key Error

object
error
string
Valid values[ "API_KEY_ALLOW_IP_INVALID", "API_KEY_SCOPE_NAME_INVALID", "API_KEY_USER_INVALID" ]
message
string
404

API Key Not Found

object
error
string
Valid values[ "API_KEY_NOT_FOUND" ]
message
string
500

API Key Update Failed

object
error
string
Valid values[ "API_KEY_UPDATE_FAILED" ]
message
string