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

# OAuth 2.0 Authorization Server Metadata

> Returns authorization server metadata per RFC 8414. MCP clients use this to discover endpoints for the OAuth 2.0 authorization flow.



## OpenAPI

````yaml https://app.usechar.ai/api/spec.json get /.well-known/oauth-authorization-server
openapi: 3.1.1
info:
  title: Char API
  version: 1.0.0
  description: >-
    REST API for managing organizations, identity providers, end users, skills,
    threads, usage, and subscriptions.


    ## Authentication


    This API uses Bearer token authentication with WorkOS JWT tokens. Include
    the token in the Authorization header:


    ```

    Authorization: Bearer <your-jwt-token>

    ```


    ## Authorization Levels


    - **Public endpoints**: No authentication required

    - **Protected endpoints**: Require valid JWT token (user authentication)

    - **Organization endpoints**: Require valid JWT token with organization
    context selected


    Most endpoints require organization context. Ensure your JWT token includes
    the `org_id` claim.


    ## Data Formats


    ### Allowed Domains

    The `allowed_domains` field is an array of origins (e.g.,
    `https://app.example.com`). It is stored as JSON internally but surfaced as
    an array in the API.


    ### Timestamps

    All timestamps are returned as ISO 8601 strings (e.g.,
    `"2025-01-15T10:30:00.000Z"`).


    ## Rate Limits


    No application-level rate limiting is currently enforced.


    ## Error Responses


    All errors follow a consistent format:


    ```json

    {
      "code": "ERROR_CODE",
      "status": 400,
      "message": "Human-readable error message",
      "data": { /* optional additional details */ }
    }

    ```


    ### Error Codes


    | data.code | Description |

    |-----------|-------------|

    | `VALIDATION_ERROR` | Invalid input data (400) |

    | `AUTH_REQUIRED` | Missing or invalid authentication (401) |

    | `ACCESS_DENIED` | Permission denied (403) |

    | `PAYMENT_REQUIRED` | Subscription required (403) |

    | `ORG_CONTEXT_REQUIRED` | Organization selection required (403) |

    | `RESOURCE_NOT_FOUND` | Resource missing (404) |

    | `DUPLICATE_RESOURCE` | Resource already exists (409) |

    | `INTERNAL_ERROR` | Server-side error (500) |
servers:
  - url: https://app.usechar.ai/api
    description: Production API
security:
  - bearerAuth: []
tags:
  - name: Auth
    description: >-
      Authentication operations including session management and logout. All
      auth endpoints require a valid JWT token.
  - name: Users
    description: >-
      Access the current authenticated user's profile and organization
      memberships.
  - name: Organizations
    description: Organization details, members, and configuration such as allowed domains.
  - name: Identity Providers
    description: Manage SSO configuration and test IDP connectivity.
  - name: Directories
    description: Directory sync resources backed by WorkOS directories.
  - name: End Users
    description: End users who interact with embedded widgets, identified by IDP tokens.
  - name: Organization Skills
    description: CRUD for SKILL.md content following the Agent Skills spec.
  - name: Threads
    description: Conversation thread metadata and management.
  - name: Usage Analytics
    description: Usage and token analytics for the organization.
  - name: Plan Tiers
    description: Plan tiers and limit definitions.
  - name: Subscriptions
    description: Billing and subscription status via Polar integration.
  - name: OAuth
    description: OAuth 2.0 authorization flow endpoints for MCP client authentication.
  - name: OAuth Discovery
    description: RFC 8414/8707 well-known discovery endpoints for OAuth 2.0.
paths:
  /.well-known/oauth-authorization-server:
    get:
      tags:
        - OAuth Discovery
      summary: OAuth 2.0 Authorization Server Metadata
      description: >-
        Returns authorization server metadata per RFC 8414. MCP clients use this
        to discover endpoints for the OAuth 2.0 authorization flow.
      operationId: getWellKnownOauthAuthorizationServer
      responses:
        '200':
          description: Authorization server metadata
          content:
            application/json:
              schema:
                type: object
                properties:
                  issuer:
                    description: Authorization server issuer URL
                    type: string
                  authorization_endpoint:
                    description: OAuth 2.0 authorization endpoint
                    type: string
                  token_endpoint:
                    description: OAuth 2.0 token endpoint
                    type: string
                  registration_endpoint:
                    description: OAuth 2.0 dynamic client registration endpoint
                    type: string
                  revocation_endpoint:
                    description: OAuth 2.0 token revocation endpoint
                    type: string
                  response_types_supported:
                    description: Supported OAuth 2.0 response types
                    type: array
                    items:
                      type: string
                  grant_types_supported:
                    description: Supported OAuth 2.0 grant types
                    type: array
                    items:
                      type: string
                  code_challenge_methods_supported:
                    description: Supported PKCE methods
                    type: array
                    items:
                      type: string
                  token_endpoint_auth_methods_supported:
                    description: Token endpoint auth methods
                    type: array
                    items:
                      type: string
                  revocation_endpoint_auth_methods_supported:
                    description: Revocation auth methods
                    type: array
                    items:
                      type: string
                  scopes_supported:
                    description: Supported OAuth 2.0 scopes
                    type: array
                    items:
                      type: string
                required:
                  - issuer
                  - authorization_endpoint
                  - token_endpoint
                  - registration_endpoint
                  - revocation_endpoint
                  - response_types_supported
                  - grant_types_supported
                  - code_challenge_methods_supported
                  - token_endpoint_auth_methods_supported
                  - revocation_endpoint_auth_methods_supported
                  - scopes_supported
      security: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        WorkOS JWT token. Obtain via WorkOS AuthKit authentication flow. The
        token must include organization_id claim for organization-scoped
        endpoints.

````