Create API Key
create-api-keyGenerate a RawTree API key for CI, agents, connectors, or scripts with read-only, write-only, read-write, or admin permissions. The key is shown once, so display it to the user.
Instructions
Purpose: Create a new RawTree API key for a cluster.
NOT for: User login. Use RawTree auth/CLI or the dashboard for that workflow.
Returns: The new API key value. The API key is only shown once, so you MUST display it to the user.
Auth: Uses POST /v1/keys and requires admin permission for database API key auth.
When to use:
User needs a key for CI, an agent, a connector, or a script
User wants a read-only, write-only, read-write, or admin credential
User asks to rotate credentials by creating a replacement before revoking the old key
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Human-readable API key name. | |
| cluster | No | RawTree cluster to use for this operation. | |
| database | No | Optional default database for the new key. RawTree uses the default database when omitted. | |
| permission | No | Permission level. Prefer read_only for query-only agents and write_only for ingest-only connectors. | read_write |
| organization | No | RawTree organization containing the target cluster. |