Trakt O Auth API

Authorization Code and Device OAuth flows.

Operations 4

POST /oauth/device/code Generate New Device Codes #
POST /oauth/device/token Poll For The Access Token #
POST /oauth/token Exchange A Token #
POST /oauth/revoke Revoke An Access Token #

Documentation

Specifications

Schemas & Data

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/trakt-oauth-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

trakt-oauth-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Trakt OAuth API
  description: 'The Trakt API is a RESTful API for integrating TV show and movie tracking

    features into applications.'
  version: '2.0'
  contact:
    name: Trakt API Support
    url: https://forums.trakt.tv
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
- url: https://api.trakt.tv
  description: Production
- url: https://api-staging.trakt.tv
  description: Staging
security:
- bearerAuth: []
tags:
- name: OAuth
  description: Authorization Code and Device OAuth flows.
paths:
  /oauth/device/code:
    post:
      tags:
      - OAuth
      operationId: generateDeviceCode
      summary: Generate New Device Codes
      description: Generate new codes to start the device authentication process. The device_code and interval are used to poll for the access_token. The user_code and verification_url should be presented to the user.
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeviceCodeRequest'
      responses:
        '200':
          description: Device code issued.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceCodeResponse'
  /oauth/device/token:
    post:
      tags:
      - OAuth
      operationId: pollDeviceToken
      summary: Poll For The Access Token
      description: Poll using the device_code at the returned interval until the user authorizes the app. Returns access_token on success. Status codes 400/404/409/410/418/429 indicate pending, expired, denied, or polling-too-fast states.
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeviceTokenRequest'
      responses:
        '200':
          description: Token issued.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenResponse'
        '400':
          description: Pending — keep polling.
  /oauth/token:
    post:
      tags:
      - OAuth
      operationId: exchangeToken
      summary: Exchange A Token
      description: Exchange an OAuth authorization code or refresh token for an access token.
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
              - $ref: '#/components/schemas/TokenRequest'
              - $ref: '#/components/schemas/TokenRefreshRequest'
      responses:
        '200':
          description: Token issued.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenResponse'
        '400':
          description: Invalid request.
  /oauth/revoke:
    post:
      tags:
      - OAuth
      operationId: revokeToken
      summary: Revoke An Access Token
      description: Revoke an access_token when the user signs out of the app.
      security: []
      responses:
        '200':
          description: Token revoked.
components:
  schemas:
    TokenRefreshRequest:
      type: object
      required:
      - refresh_token
      - client_id
      - client_secret
      - redirect_uri
      - grant_type
      properties:
        refresh_token:
          type: string
        client_id:
          type: string
        client_secret:
          type: string
        redirect_uri:
          type: string
          format: uri
        grant_type:
          type: string
          enum:
          - refresh_token
    DeviceTokenRequest:
      type: object
      required:
      - code
      - client_id
      - client_secret
      properties:
        code:
          type: string
        client_id:
          type: string
        client_secret:
          type: string
    DeviceCodeResponse:
      type: object
      properties:
        device_code:
          type: string
        user_code:
          type: string
        verification_url:
          type: string
          format: uri
        expires_in:
          type: integer
        interval:
          type: integer
    DeviceCodeRequest:
      type: object
      required:
      - client_id
      properties:
        client_id:
          type: string
    TokenRequest:
      type: object
      required:
      - code
      - client_id
      - client_secret
      - redirect_uri
      - grant_type
      properties:
        code:
          type: string
        client_id:
          type: string
        client_secret:
          type: string
        redirect_uri:
          type: string
          format: uri
        grant_type:
          type: string
          enum:
          - authorization_code
    TokenResponse:
      type: object
      properties:
        access_token:
          type: string
        token_type:
          type: string
        expires_in:
          type: integer
        refresh_token:
          type: string
        scope:
          type: string
        created_at:
          type: integer
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: OAuth 2.0 access token from /oauth/token or /oauth/device/token. Send via Authorization header and required headers trakt-api-version (2) and trakt-api-key (client_id).