manage_api_keys when an agent or automation workflow needs to provision, inspect, rename, or revoke Kernel API keys. Created keys include the plaintext secret once; later reads return masked key metadata.
Create project-scoped keys for workloads that only need one project’s resources. Use org-wide keys only when the workload needs access across projects.
For API key concepts, scoping rules, rotation guidance, and SDK examples, see API Keys.
Actions
| Action | Description |
|---|---|
create | Create an org-wide or project-scoped API key. |
list | List masked API keys. |
get | Retrieve one masked API key. |
update | Rename an API key. |
delete | Revoke an API key. |
Recommended flow
- Call
listbefore creating a key so you don’t duplicate an existing workload key. - Call
createwithproject_idfor project-scoped automation. - Store the returned plaintext key immediately.
- Call
updatewhen a key’s owner or purpose changes. - Call
deleteto revoke keys for retired workloads.
Parameters
| Parameter | Description |
|---|---|
action | Operation to perform. Required. |
api_key_id | API key ID. Required for get, update, and delete. |
name | (create, update) API key name. |
project_id | (create) Project ID for project-scoped keys. Omit or use null for org-wide keys. |
days_to_expire | (create) Days until expiry, up to 3650. Use null for no expiry. |
limit | (list) Max results per page. Must be 1-100. |
offset | (list) Pagination offset. Must be 0 or greater. |