API reference
Authentication
How clients authenticate to the Tracehold API and MCP endpoint.
Token types#
Tracehold issues these bearer tokens, each for one audience.
1. Admin / user JWT#
Used to call the REST API (guardrails, exceptions, audit, compliance, settings). Obtained by signing in: POST /api/v1/auth/login with a password (and a two-factor code when it is on), SAML 2.0 SSO, or Google, GitHub or Microsoft. Each of the last three is trusted only for an address it vouches for: Google's verified email, GitHub's verified primary email, and a Microsoft work or school account's user principal name (never its mail attribute, which a tenant's administrator can set to anyone's address). An account with two-factor on signs in with its password and code, and an organization that requires SSO sends its people to it. Short-lived; refreshed via an HTTP-only refresh cookie.
Authorization: Bearer <jwt>
2. MCP server token#
Used by agents to call the /mcp/<server-id>/ JSON-RPC endpoint on a server set to A token (a server set to People sign in refuses it). One per MCP server; shown once at creation. Rotatable from the server detail page.
Authorization: Bearer <mcp-token>
Never share an MCP token in a document or ticket: it grants tool-call access to that server's allowed actions. If leaked, rotate immediately.
3. Agent sign-in tokens#
Used by an agent app signed in as a person, on a server set to People
sign in (Agent identity). Tracehold is the OAuth 2.1
authorization server the MCP standard describes: the app registers itself
(public client), the person allows it on Tracehold's consent page (PKCE with
S256, a resource naming the one server), and the app receives an access
token (tha_, one hour) and a refresh token (thr_, replaced on every use;
a replaced one used again ends the sign-in). Tracehold keeps only their
hashes. Each is good for one server and stops at once when the sign-in is
stopped or the person is deactivated, made a viewer or removed.
Authorization: Bearer tha_...
4. Connector token#
Used by your connector to call Tracehold (heartbeat, next job, result), and as the password for pulling the connector image from Tracehold's registry (docker login registry.tracehold.ai -u tracehold). It starts with tcn_, is shown once when the connector is added, and Tracehold keeps only its hash. Replace it with New token on the connector; the old one stops working at once.
Browser sessions and live updates#
Browser sessions use short-lived JWTs kept in memory plus an HttpOnly; SameSite=Strict refresh cookie. Server-Sent Events authenticate via an opaque one-shot ticket exchanged from an authenticated POST /api/v1/auth/sse/tickets, never via a URL query string.
Enterprise SSO#
On Enterprise, SAML 2.0 metadata for your org is served at /api/v1/auth/saml/<org-slug>/metadata, and the ACS is at /api/v1/auth/saml/<org-slug>/acs. Two-factor authentication (TOTP and backup codes) can be required for owners and admins on any plan. See Your team and sign-in.