Parameters
#keystringRequired
The key's ID (see
api-key view).labelstring
Replacement label for the key. Use one line of up to 200 bytes. Omit to keep the current label.
expiresstring
Replacement lifetime counted from now, from 1s through 365d, or
never. Omit to retain the current expiration.commandsstring[]
Command in the replacement permissions list, such as
restart. Omit to keep the current commands.no_scopeboolean
Remove the key's resource scope. Use this option or provide replacement scope fields.
scopeobject
Resource scope by pool, Computer or tag. Any matching list grants access within your permissions; each list accepts up to 64 entries.
Show 3 attributesHide attributes
computersstring[]
Computer name or ID to include in the replacement scope. Providing any scope field replaces the full scope.
poolsstring[]
Pool name or ID to include in the replacement scope along with its Computers. Providing any scope field replaces the full scope.
tagsstring[]
Tag whose Computers to include in the replacement scope. Providing any scope field replaces the full scope.
Returns
#dataobjectAlways present
An API key's identity, permissions and lifetime.
Show 13 attributesHide attributes
cmdsstring[] | nullAlways present
Permitted commands, subject to your permissions.
* permits all commands for a sign-in key.computer_namesmap<string, string>
Names of the Computers its scope names, by ID, those its organization still has. May be omitted.
created_atstring (date-time)Always present
When the key was created.
expires_atstring (date-time) | nullAlways present
When the key expires, or null if it has no expiry.
idstringAlways present
Key ID for editing, rotation or revocation.
labelstringAlways present
User-assigned label.
last_used_atstring (date-time) | nullAlways present
Last recorded use, or null if no use has been recorded.
organizationstring
Organization the key acts in. Sign-in keys can omit this to select an organization per request. May be omitted.
previous_secret_expires_atstring (date-time)
Expiry of the replaced secret, included while it remains accepted. May be omitted.
revoked_atstring (date-time) | nullAlways present
When the key was revoked, or null if it has not been revoked.
rotated_atstring (date-time) | nullAlways present
When its secret was last rotated, or null if it has not been rotated.
scopeobject
Resource restrictions in addition to your permissions. An absent scope adds no restriction. May be omitted.
Show 3 attributesHide attributes
computersstring[]
Computer IDs included in the key's scope. May be omitted.
poolsstring[]
Pool IDs included in the key's scope. May be omitted.
tagsstring[]
Tags selecting Computers the key can reach. May be omitted.
tokenstring
Newly issued secret, returned only on creation or rotation. May be omitted.
Errors
#| Code | Status | What happened |
|---|---|---|
| invalid | 400 | An input is missing or invalid. |
| unauthenticated | 401 | The credential is missing, invalid, expired or revoked. |
| denied | 403 | The caller lacks permission for this action. |
| not_found | 404 | The resource is absent or inaccessible to this caller. |
| conflict | 409 | The request conflicts with the current resource state or an earlier request. |
| over_capacity | 409 | The request exceeds a resource or credential allowance. |
| access_list_full | 409 | The change would exceed the access-list allowance. |
| payment_required | 402 | Payment or credit is required. |
| rate_limited | 429 | The caller's request rate exceeds its limit. |
| busy | 429 | Too much work is in progress to accept this request. |
| unknown | 503 | The outcome is unconfirmed; a change may have happened. |
| unavailable | 503 | The service or requested feature is unavailable. |
Notes
#- A key that expires cannot give a key a later expiry than its own, and CLI and MCP sign-ins last 90 days. Use management SSH or the dashboard for a longer expiry or
never. CLI:heaven loginwithHEAVEN_API_KEYunset. MCP: Heaven sign-in. cURL:HEAVEN_SIGN_IN_KEYfrom approved device sign-in (POST /v1/auth/create). - A key limited to a command list cannot run this command.