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

# Issue an OAuth token

> Issue an OAuth token using client credentials.



## OpenAPI

````yaml /openapi.json post /auth/token
openapi: 3.1.0
info:
  title: Sophic Engine API
  version: 0.1.0
servers:
  - url: https://api.engine.usesophic.com
security: []
tags:
  - description: Retrieve accounts, statements, and account documents.
    name: accounts
    x-group: Accounts
  - description: Read the audit trail of platform activity.
    name: activity
    x-group: Activity
  - description: Obtain OAuth access tokens for the Engine API.
    name: auth
    x-group: Authentication
  - description: Inspect the authenticated user or service actor.
    name: identity
    x-group: Identity
  - description: Retrieve fee schedules and billing information.
    name: billing
    x-group: Billing
  - description: Browse instruments and tradable products.
    name: catalog
    x-group: Catalog
  - description: Track onboarding applications through completion.
    name: onboarding
    x-group: Onboarding
  - description: Manage customer records and related person data.
    name: customers
    x-group: Customers
  - description: List platform events and inspect individual occurrences.
    name: events
    x-group: Events
  - description: Read positions, transactions, and account holdings.
    name: holdings
    x-group: Holdings
  - description: Retrieve legal agreements and required disclosures.
    name: legal-documents
    x-group: Legal Documents
  - description: Access prices and market data for instruments.
    name: market-data
    x-group: Market Data
  - description: Manage deposits, withdrawals, and funding accounts.
    name: payments
    x-group: Payments
  - description: Retrieve returns, earnings, and performance metrics.
    name: performance
    x-group: Performance
  - description: Place and manage orders, quotes, and trades.
    name: trading
    x-group: Trading
  - description: Read position and account valuations over time.
    name: valuation
    x-group: Valuation
  - description: Configure webhook endpoints and inspect deliveries.
    name: webhooks
    x-group: Webhooks
  - description: Upload files and retrieve stored documents.
    name: files
    x-group: Files
paths:
  /auth/token:
    post:
      tags:
        - auth
      summary: Issue an OAuth token
      description: Issue an OAuth token using client credentials.
      operationId: issue_token_auth_token_post
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ClientCredentialsForm'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OAuthToken'
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OAuthErrorBody'
          description: >-
            OAuth error response (RFC 6749 §5.2). Malformed form fields return
            the standard error envelope instead.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OAuthErrorBody'
          description: Client authentication failed (RFC 6749 §5.2).
components:
  schemas:
    ClientCredentialsForm:
      description: Form for the `client_credentials` grant type.
      properties:
        client_id:
          description: OAuth client ID.
          title: Client Id
          type: string
        client_secret:
          description: OAuth client secret.
          title: Client Secret
          type: string
        grant_type:
          const: client_credentials
          description: Must be `client_credentials`.
          title: Grant Type
        scope:
          description: Space-separated list of scopes.
          title: Scope
          type: string
          x-remove-null-from-type-union: true
      required:
        - client_id
        - grant_type
        - client_secret
      title: ClientCredentialsForm
      type: object
    OAuthToken:
      properties:
        access_token:
          description: The access token.
          title: Access Token
          type: string
        expires_in:
          description: The number of seconds until the token expires.
          title: Expires In
          type: integer
        refresh_token:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            A refresh token for obtaining new access tokens without
            re-authentication.
          title: Refresh Token
        scope:
          description: The scopes of the token, comma-separated.
          title: Scope
          type: string
        token_type:
          description: The token type. Always 'bearer' for JWT tokens.
          title: Token Type
          type: string
      required:
        - access_token
        - token_type
        - expires_in
        - scope
      title: OAuthToken
      type: object
    OAuthErrorBody:
      description: >-
        RFC 6749 §5.2 error body returned by the OAuth protocol endpoints.


        Referenced in the OpenAPI schema only; responses are never serialized
        from

        this model.
      properties:
        error:
          description: The RFC 6749 error code, e.g. `invalid_grant`.
          title: Error
          type: string
        error_description:
          description: A human-readable description of the error.
          title: Error Description
          type: string
      required:
        - error
        - error_description
      title: OAuthErrorBody
      type: object

````