Create API Key
create-api-keyCreates a cluster-scoped RawTree API key with selected permissions and optional expiry, returning the one-time credential for CI, agents, connectors, or scripts.
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/api-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
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"name": "<name>"
},
"name": "create-api-key"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Human-readable API key name. | |
| cluster | No | Name or ID of the 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 | Name or ID of the organization containing the target cluster. |