Portal API JWT
The credential for the management plane (workspaces, members, keys, brands, credits, flows).- Scope: one user, and every workspace they are a member of.
- Header:
Authorization: Bearer <jwt>. - Lifetime: about 1 hour.
- Format: HS256 JWT. Issuer
syvon-portal, audiencesyvon-api,sub= userId.
Mint one
From a signed-in session (magic link / Google / Apple cookie):{ "token": "..." }. Refresh before expiry via POST /api/auth/refresh. This is the credential for any “manage my account” flow.
Workspace API key
The credential for the brain read plane (published agents, feed, files, chat).- Scope: exactly one workspace. Full read of that workspace’s published data plus agent chat. No roles, no finer scope.
- Header:
Authorization: Bearer sk_ws_.... - Lifetime: until revoked.
- Storage: the server stores only a SHA-256 hash. The raw key is shown once, at mint time.
Mint one
402 with code API_KEYS_NOT_AVAILABLE. Body: { "name": string, "rateLimit"?: number }. The response includes the raw key alongside its metadata.
Verify and revoke
The brain hashes the bearer and looks it up. An unknown or revoked key returns a deliberately vague401. Revoke with DELETE /api/workspaces/:id/keys/:keyId.
Which credential do I need?
Handling expiry
The portal JWT is short-lived. Refresh it and hand the new token to the SDK without rebuilding state:.with() returns a new client; the original is unchanged. See The client.