Namespaces
Namespaces organize keys into isolated groups. They follow a hierarchical pattern inspired by project structure.
Format
Pattern: project/environment/service
Examples:
billingbilling/prodbilling/prod/api
Rules
- Alphanumeric characters, hyphens, and underscores only
- Maximum 3 levels deep
- Maximum 256 characters total
Usage
Every key-value operation requires a namespace. Keys are always addressed as:
/v1/kv/{namespace}/{key}For example, storing DB_HOST in the myapp/prod namespace:
bash
curl -X PUT http://localhost:7200/v1/kv/myapp/prod/DB_HOST \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"value":"localhost","type":"config"}'Listing Namespaces
bash
curl http://localhost:7200/v1/namespaces \
-H "Authorization: Bearer YOUR_TOKEN"Isolation
Namespaces provide logical isolation. Tokens can be scoped to specific namespaces (or patterns like myapp/*) so applications only access the data they need.
See Authentication for role-based and scoped access control.
