Skip to content

Tenants and Access

Witnesses, watchers and notaries can be operated as a service for many parties. Each service manages its tenants independently.

Access modes

ACCESS Who is served
registered (default) Identifiers enrolled by an active tenant
open Everyone

Administration

Administrative endpoints need Authorization: Bearer <ADMIN_TOKEN>.

Method and path Purpose
POST /v1/admin/tenants Create a tenant. Body: id, and optionally active, max_aids (100), daily (0). Returns the API key once
GET /v1/admin/tenants List tenants with usage
PATCH /v1/admin/tenants/{id} Change active, max_aids or daily
POST /v1/admin/tenants/{id}/key Issue a new API key. The old one stops working

Tenant ids use lowercase letters, digits and hyphens. API keys are stored only as hashes.

Tenant endpoints

These need Authorization: Bearer <API key>.

Method and path Purpose
PUT /v1/aids/{aid} Enroll an identifier
DELETE /v1/aids/{aid} Withdraw an identifier
GET /v1/aids List enrolled identifiers
GET /v1/usage Limits and usage of today
curl -X POST http://127.0.0.1:7610/v1/admin/tenants -H "Authorization: Bearer $WITNESS_ADMIN" -d '{"id":"acme","daily":1000}'
curl -X PUT http://127.0.0.1:7610/v1/aids/<aid> -H "Authorization: Bearer <api key>"

Enroll an identifier with every service that should serve it.

Quotas

daily is the number of chargeable operations per UTC day, and 0 means unlimited. A witness charges for a newly accepted event, and a notary for a new certificate. Repeated submissions of the same event or request are not charged. If an identifier is enrolled by several tenants, the first one with remaining quota is charged.