Bootstrap your first admin token
The HTTP token endpoint requires a token withadmin: true. To generate one locally from your signing key (no server needed):
$ADMIN_TOKEN. You can then use it to issue scoped client tokens via the HTTP API.
Token format
Issue a token via HTTP
Permissions — V1 (glob lists)
V1 permissions use glob patterns matched against the CRDT key (crdt_id). Issue a V1 token with the permissions field:
Permissions — V2 (fine-grained rules)
V2 tokens add per-rule op masks, per-rule TTLs, and a rate limit override. Issue a V2 token with therules field:
Rule fields
Rules are evaluated first-match-wins in order. The token-level
expires_at still applies.
Op mask constants
Each CRDT type uses its own bit positions:
Combine masks with bitwise OR:
0x01 | 0x02 = 0x03 allows both operations.
Example: read-only observer + increment-only counter
Example: time-limited write rule
{clientId} template — per-agent key scoping
Pattern values in V2 rules may contain the literal placeholder {clientId}. The server expands it to the token’s client_id before matching. This lets you issue a single token template that automatically scopes each agent to its own keys:
or:cart-42 but not or:cart-99. Agent 99, issued with the same rule template, can only write or:cart-99.
This is especially useful for multi-agent systems where each agent must be isolated to its own slice of the namespace:
Rate limit override
Therl field (V2 only) sets a per-token rate limit in requests per second. This overrides the server default (100 req/s) for this specific token — useful to give trusted services higher throughput or restrict untrusted clients.
Backward compatibility
V1 and V2 tokens coexist without migration. Old V1 tokens continue to work unchanged. The server detects the version automatically from the token payload.Inspect a token
GET /v1/namespaces/:ns/tokens/me decodes the caller’s token and returns its claims as JSON. Useful for debugging — no msgpack tooling needed.
permissions with read, write, and admin fields instead.
Verify a token (SDK)
MeridianClient.create() automatically parses and validates the token before connecting: