Authentication
API key authentication and permissions.
Authentication
RawTree API requests use bearer authentication.
Authorization: Bearer rt_...Use rtree login for interactive CLI workflows. Use API keys for agents, scripts, services, and CI.
Create an API key
rtree key create --name my-agent --permission read_writeEvery API key belongs to one organization and one cluster. It is not tied to a database: the key's permission applies to every current and future database in that cluster.
Choose the database on each data-plane request with ?database=<name> or the
x-rawtree-database header. If neither is provided, RawTree uses the API key's
stored default database. Creating a key stores the database selected on that
request; if no database is selected, RawTree stores the logical default
database. On the shared cluster, RawTree maps the logical name to the
organization's isolated rt_<organization_id>_<database> namespace.
Permissions
| Permission | List databases | Insert | Query / logs | Delete table | Manage databases | Manage API keys |
|---|---|---|---|---|---|---|
admin | Yes | Yes | Yes | Yes | Yes | Yes |
read_write | Yes | Yes | Yes | No | No | No |
write_only | No | Yes | No | No | No | No |
read_only | Yes | No | Yes | No | No | No |
These permissions authorize database and data operations only. API keys cannot
read account, organization, membership, billing, or cluster-management
endpoints. The two control-plane exceptions are explicit: an admin API key
can manage databases and API keys in its own cluster.
Recommendations
- Use
read_writefor agents that ingest and query. - Use
read_onlyfor dashboards, audits, and validation jobs. - Use
write_onlyfor event producers. - Use
adminonly for database lifecycle, key management, and destructive data operations.
Environment variables
export RAWTREE_API_KEY=rt_...
export RAWTREE_DATABASE=analytics
export RAWTREE_ORG=team_alphaThe CLI reads RAWTREE_API_KEY before saved local credentials.