API Authentication
Purpose
xTrakt APIs require an authenticated product context, either through a platform session/token flow or an API key for integrations.
Browser Session Flow
- Authenticate with the SSO API using OpenID Connect PKCE.
- Receive an SSO
access_token. - Exchange that token with
POST /user/get-platform-token. - Exchange the redirect code with
POST /auth/exchange-redirect-code. - Persist the platform session in the
xtrakt_sessionHttpOnly cookie. - Send the companion CSRF token on mutating requests.
Integration Flow
- Generate an API key for the tenant.
- Store it securely.
- Send it in the
Authorizationheader. - Scope the integration to one tenant and use case.
caution
Some xTrakt backend responses are returned with Content-Type: text/plain while the body contains JSON. API clients should parse the response body as JSON even when the content type is not application/json.