Agent API authentication
Catalog search, unsaved drafts, and the public MCP server require no credentials. The optional agent credentials below identify API clients; they do not sign a person into a workspace.
Documentation Authentication
On this page
1. Discover the authentication endpoints
Read protected-resource metadata, then authorization-server metadata. The issuer and resource are both https://usearken.com. A protected endpoint returns 401 with a WWW-Authenticate header pointing to the resource metadata.
2. Register an anonymous agent
POST https://usearken.com/agent/identity with Content-Type: application/json and {"type":"anonymous"}. The response contains registration_id, registration_type, identity_assertion, assertion_expires, and pre_claim_scopes. Assertions expire after five minutes. Only anonymous registration is supported by this endpoint.
Anonymous registration grants only catalog.read and drafts.prepare. It does not grant workspace or email access. These are ARKEN service credentials, not a Primitive API key or a user password.
3. Exchange the assertion for a token
POST https://usearken.com/oauth2/token with Content-Type: application/x-www-form-urlencoded. Send grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer and assertion=<identity_assertion>. Optional scope must be a subset of catalog.read drafts.prepare. Omit optional resource, or set it to https://usearken.com.
4. Check the agent session
The token response includes access_token, token_type=Bearer, expires_in=900, and scope. Send Authorization: Bearer <access_token> to GET /api/agent/session or GET /agent/auth to inspect the agent session. Public catalog and draft requests still work without a token.
5. Expiry and revocation
Access tokens expire after 15 minutes. Repeat the token exchange while the assertion is valid; otherwise register anonymously again. No refresh token is issued. POST https://usearken.com/oauth2/revoke with form field token=<access_token> to revoke a token. Revocation is idempotent and invalid tokens return 200 without revealing their status.
Errors and limits
OAuth errors contain error and error_description. invalid_grant means restart registration; invalid_scope means request fewer privileges. API errors contain error.code, error.message, and error.hint. A 401 means obtain a valid token; a 403 means insufficient scope or a disallowed request origin.
Token issuance is limited to 120 requests per minute across the service instance. HTTP 429 includes RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset, and Retry-After. Active tokens survive restarts; the bounded token ledger can also return 429 at capacity.
Workspace and email access
Sign in to create a private workspace with Google sign-in. Model analysis requires prepaid credits and separate permission. Agent registration does not create a workspace or grant access to its cases and uploads.
Email access requires a separately enabled workspace connection. Anonymous credentials cannot read or reply to email. The public gateway blocks the legacy /api/agent/inbox routes, including requests with an owner token. Operator-only client credentials are not a public email integration method.
Keep credentials out of URLs, source control, logs and model prompts. Never send Primitive keys to ARKEN endpoints.