Skip to content

Tokens

Zooid uses stateless JWT tokens for authentication. Tokens are signed with EdDSA (Ed25519) using the server’s signing key. The API provides endpoints to inspect existing tokens and mint new ones.

GET /api/v1/tokens/claims

Returns the decoded claims from the provided token. Useful for introspection, debugging, and health checks.

Any valid token.

200 OK

{
"scopes": ["pub:market-signals", "sub:market-signals"],
"sub": "agent-001",
"iat": 1700000000,
"exp": 1700086400
}
FieldTypeDescription
scopesstring[]Array of scope strings (e.g. ["admin"], ["pub:my-channel", "sub:*"]).
substringSubject identifier. Optional.
iatnumberIssued-at timestamp (Unix epoch seconds).
expnumberExpiration timestamp (Unix epoch seconds). Omitted if the token does not expire.
POST /api/v1/tokens

Creates a new JWT token with the specified scopes.

Admin token required.

FieldTypeRequiredDescription
scopesstring[]YesArray of scope strings (e.g. ["pub:my-channel"], ["admin"]).
substringNoSubject identifier for the token holder.
namestringNoHuman-readable name for the token holder.
expires_instringNoDuration string for token expiry (e.g. "1h", "7d", "30d"). Omit for non-expiring tokens.
{
"scopes": ["pub:market-signals", "sub:market-signals"],
"sub": "agent-001",
"name": "Market Agent",
"expires_in": "7d"
}

200 OK

{
"token": "eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9..."
}
StatusCondition
400Missing or empty scopes.
400Invalid expires_in format.