Create a new API key. Creating a new API key through this endpoint is recorded to the audit logs.
Bearer token authentication. Include the token in the Authorization header:
Authorization: Bearer <your-token>
API key creation parameters including type, permissions, and access controls
{
"key_type": "query",
"description": "Marketing team API key",
"scope_names": [
"ds_queries_read",
"ds_queries_run",
"table_groups_read"
],
"allow_ips": [
"192.168.1.100",
"10.0.0.0/24"
],
"is_enabled": true,
"behalf_of_user_id": "user_123456"
}Type of key to create. Either query for shared API keys to show in Query Manager or user for private keys intended for one user.
Internal API key description
List of permission scopes for the API key. Defaults to none.
List of fixed or CIDR formatted IP addresses allowed to use API key. Only IPv4 is supported.
Whether API key is enabled and can be used in requests
Supermetrics user ID the API key identifies as
API key created successfully
API request ID
Supermetrics API key ID
ISO 8601 datetime for when API key was created
Internal API key description
Type of API key
First 10 characters from the API key value
API key value as plain text, when requested. Defaults to null.
List of permission scopes for the API key
List of fixed or CIDR formatted IP addresses allowed to use API key
Whether API key is enabled and can be used in requests
Supermetrics user ID
Supermetrics user email
API Key Error
Unauthorized - invalid or missing authentication
API request ID
Error code
Error message
Error description
API Key Limit Exceeded
Unprocessable Entity - request validation failed
API request ID
Error code
Error message
Error description
Too Many Requests - rate limit exceeded
API request ID
Error code
Error message
Error description
Internal Server Error - unexpected server error
API request ID
Error code
Error message
Error description