Create API Key
create-api-keyPurpose: Create a new RawTree API key for a cluster.
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 and expires_at (UTC timestamp or null for never). 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. | |
| expires_at | No | Optional expiration as a future RFC 3339 timestamp with a timezone. The API validates and normalizes it to UTC. Omit or use null to never expire. Expiration cannot be updated; create a replacement key to change it. | |
| 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. |