Skip to content
Docs

API Keys

Create API Key
client.apiKeys.create(APIKeyCreateParams { expires_at, name, permissions, 4 more } body, RequestOptionsoptions?): APIKey { id, created_at, expires_at, 10 more }
POST/v1/api_keys
Get API Key Details
client.apiKeys.get(stringapiKeyID, RequestOptionsoptions?): APIKey { id, created_at, expires_at, 10 more }
GET/v1/api_keys/{api_key_id}
Update API Key
client.apiKeys.update(stringapiKeyID, APIKeyUpdateParams { name, permissions, project_ids, 2 more } body, RequestOptionsoptions?): APIKey { id, created_at, expires_at, 10 more }
PATCH/v1/api_keys/{api_key_id}
Delete API Key
client.apiKeys.delete(stringapiKeyID, RequestOptionsoptions?): void
DELETE/v1/api_keys/{api_key_id}
List API Keys
client.apiKeys.list(APIKeyListParams { cursor, limit } query?, RequestOptionsoptions?): Cursor<APIKey { id, created_at, expires_at, 10 more } >
GET/v1/api_keys
ModelsExpand Collapse
APIKey { id, created_at, expires_at, 10 more }

API Key response.

id: string

API Key ID.

created_at: string

When the API Key was created.

formatdate-time
expires_at: string

When the API Key expires and is no longer valid.

formatdate-time
managed: boolean

Whether this API key is system-managed.

name: string

API Key name.

maxLength255
minLength1
permissions: Array<APIKeyPermission { permission, resource_type } >

Scoped permissions for this API key.

permission: APIPermissionLevel

Permission level: “read” or “edit”.

One of the following:
"read"
"edit"

Resource type this permission applies to.

One of the following:
"vm"
"vpc"
"volume"
"connect_connection"
"rpc_node_dedicated"
"rpc_node_flex"
"nks_cluster"
"nks_node_pool"
"project"
"api_key"
"organization"
"audit_log"
"usage"
project_ids: Array<string>

Project IDs this API key is scoped to.

source_ip_rule: SourceIPRuleResponse { allowed, blocked }

IP filter rules.

allowed: Array<string>

List of IPv4 CIDR addresses to allow.

blocked: Array<string>

List of IPv4 CIDR addresses to deny.

status: "active" | "inactive" | "expired"

Status of the API Key.

One of the following:
"active"
"inactive"
"expired"
tags: Array<string>

Tags to attach to the API Key.

updated_at: string

When the API Key was updated.

formatdate-time
key?: string

API Key. Only returned on creation.

starts_at?: string

When the API Key starts to be valid.

formatdate-time
APIKeyList { items, pagination }
items: Array<APIKey { id, created_at, expires_at, 10 more } >
id: string

API Key ID.

created_at: string

When the API Key was created.

formatdate-time
expires_at: string

When the API Key expires and is no longer valid.

formatdate-time
managed: boolean

Whether this API key is system-managed.

name: string

API Key name.

maxLength255
minLength1
permissions: Array<APIKeyPermission { permission, resource_type } >

Scoped permissions for this API key.

permission: APIPermissionLevel

Permission level: “read” or “edit”.

One of the following:
"read"
"edit"

Resource type this permission applies to.

One of the following:
"vm"
"vpc"
"volume"
"connect_connection"
"rpc_node_dedicated"
"rpc_node_flex"
"nks_cluster"
"nks_node_pool"
"project"
"api_key"
"organization"
"audit_log"
"usage"
project_ids: Array<string>

Project IDs this API key is scoped to.

source_ip_rule: SourceIPRuleResponse { allowed, blocked }

IP filter rules.

allowed: Array<string>

List of IPv4 CIDR addresses to allow.

blocked: Array<string>

List of IPv4 CIDR addresses to deny.

status: "active" | "inactive" | "expired"

Status of the API Key.

One of the following:
"active"
"inactive"
"expired"
tags: Array<string>

Tags to attach to the API Key.

updated_at: string

When the API Key was updated.

formatdate-time
key?: string

API Key. Only returned on creation.

starts_at?: string

When the API Key starts to be valid.

formatdate-time
APIKeyPermission { permission, resource_type }

API Key permission.

permission: APIPermissionLevel

Permission level: “read” or “edit”.

One of the following:
"read"
"edit"

Resource type this permission applies to.

One of the following:
"vm"
"vpc"
"volume"
"connect_connection"
"rpc_node_dedicated"
"rpc_node_flex"
"nks_cluster"
"nks_node_pool"
"project"
"api_key"
"organization"
"audit_log"
"usage"
APIPermissionLevel = "read" | "edit"

Permission level: “read” or “edit”.

One of the following:
"read"
"edit"
APIPermissionResourceType = "vm" | "vpc" | "volume" | 10 more

Resource type this permission applies to.

One of the following:
"vm"
"vpc"
"volume"
"connect_connection"
"rpc_node_dedicated"
"rpc_node_flex"
"nks_cluster"
"nks_node_pool"
"project"
"api_key"
"organization"
"audit_log"
"usage"