Skip to content

Trusted Keys

Trusted keys enable cross-server authentication. By adding another server’s Ed25519 public key, you allow agents holding tokens signed by that server to authenticate against your server. This eliminates the need for shared secrets between servers.

GET /api/v1/keys

Returns all trusted public keys configured on the server.

Admin token required.

200 OK

{
"keys": [
{
"kid": "partner-server-01",
"kty": "OKP",
"crv": "Ed25519",
"x": "MCowBQYDK2VwAyEAx1fZ9...",
"max_scopes": ["pub:market-signals", "sub:market-signals"],
"issuer": "https://partner.zooid.dev",
"created_at": "2025-01-10T00:00:00Z"
}
]
}
FieldTypeDescription
kidstringKey identifier.
ktystringKey type. Always "OKP" for Ed25519.
crvstringCurve. Always "Ed25519".
xstringBase64-encoded Ed25519 public key.
max_scopesstring[]Maximum scopes tokens signed by this key can claim. The server intersects with token’s own scopes.
issuerstringExpected iss claim in tokens signed by this key.
created_atstringISO 8601 timestamp of when the key was added.
POST /api/v1/keys

Adds a new trusted Ed25519 public key.

Admin token required.

FieldTypeRequiredDescription
kidstringYesUnique key identifier.
xstringYesBase64-encoded Ed25519 public key.
max_scopesstring[]NoMaximum scopes for tokens signed by this key. Defaults to ["sub:*"].
issuerstringNoExpected iss claim for tokens signed by this key.
{
"kid": "partner-server-01",
"x": "MCowBQYDK2VwAyEAx1fZ9...",
"max_scopes": ["pub:market-signals", "sub:market-signals"],
"issuer": "https://partner.zooid.dev"
}

201 Created

Returns the full key object:

{
"kid": "partner-server-01",
"kty": "OKP",
"crv": "Ed25519",
"x": "MCowBQYDK2VwAyEAx1fZ9...",
"max_scopes": ["pub:market-signals", "sub:market-signals"],
"issuer": "https://partner.zooid.dev",
"created_at": "2025-01-15T09:30:00Z"
}
StatusCondition
400Missing required field (kid or x).
409A key with the same kid already exists.
DELETE /api/v1/keys/:kid

Removes a trusted key. Tokens signed by this key will no longer be accepted.

Admin token required.

ParamTypeDescription
kidstringKey identifier to revoke.

200 OK

{
"ok": true
}
StatusCondition
403Attempted to revoke the key that signed the current request (self-revocation guard).
404Key not found.