Create an API key
oneguard_keys_createCreates a new API key with permissions, vault scope, and lifetime capped by the current key, and returns the raw secret once. Call only when explicitly requested.
Instructions
Creates a new API key and returns the raw secret exactly once. The new key can never be broader than the current key: no extra permission, vault scope, capabilities or lifetime. Use oneguard_keys_list first if you need the current key scope. Only call this when the user explicitly asked to create a key.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Name of the new key. | |
| never | No | The key never expires. Cannot outlive the current key. | |
| vaults | No | Vault ids or id prefixes, or "all". Omit or pass [] for all vaults. Restricted to the current key vault scope. | |
| permission | No | read or write. | read |
| duration_days | No | Days until expiry. Defaults to 30. Ignored when never is true. | |
| can_create_keys | No | Let the new key create and manage other keys. Requires the current key to have this permission. | |
| can_create_vaults | No | Let the new key create vaults (write keys only). Requires the current key to have this permission. |