> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scoutforschools.com/llms.txt
> Use this file to discover all available pages before exploring further.

# OAuth 2.0 Token Endpoint

> Generates an access token for API authentication using client credentials. Supports both request body authentication and Basic authentication header.



## OpenAPI

````yaml /api-reference/openapi.json post /ims/oneroster/v1p2/token
openapi: 3.1.0
info:
  title: Scout API
  version: 1.0.0
  description: >-
    Programmatic access to Scout rostering data (IMS OneRoster 1.1 & 1.2) and
    related endpoints, authenticated with an API access token.
servers:
  - url: https://api.teachwithscout.com/v1
    description: Production
security: []
paths:
  /ims/oneroster/v1p2/token:
    post:
      tags:
        - IMS OneRoster
      summary: OAuth 2.0 Token Endpoint
      description: >-
        Generates an access token for API authentication using client
        credentials. Supports both request body authentication and Basic
        authentication header.
      requestBody:
        required: false
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                grant_type:
                  type: string
                  enum:
                    - client_credentials
                  description: The grant type must be client_credentials
                client_id:
                  type: string
                  description: >-
                    The client identifier (required if not provided in
                    Authorization header)
                client_secret:
                  type: string
                  description: >-
                    The client secret (required if not provided in Authorization
                    header)
                scope:
                  type: string
                  description: The scope of the access request
              required:
                - grant_type
      responses:
        '200':
          description: Token generated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  access_token:
                    type: string
                    description: The access token
                  token_type:
                    type: string
                    enum:
                      - bearer
                    description: The token type
                  expires_in:
                    type: integer
                    description: Token expiration time in seconds
                  scope:
                    type: string
                    description: The scope of the access token
                required:
                  - access_token
                  - token_type
                  - expires_in
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    enum:
                      - invalid_request
                      - invalid_client
                      - invalid_grant
                      - unsupported_grant_type
                  error_description:
                    type: string
        '401':
          description: Invalid client credentials
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    enum:
                      - invalid_client
                  error_description:
                    type: string
      security:
        - basicAuth: []
components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: >-
        HTTP Basic authentication using your `client_id` (username) and
        `client_secret` (password). Used **only** to obtain an access token from
        the token endpoint.

````