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

# Authorization server metadata

> OAuth 2.0 Authorization Server Metadata (RFC 8414)



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/oauth.yml get /.well-known/oauth-authorization-server
openapi: 3.1.0
info:
  title: Telnyx OAuth API
  version: 2.0.0
  description: API for OAuth.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /.well-known/oauth-authorization-server:
    servers:
      - url: https://api.telnyx.com
    get:
      tags:
        - OAuth Discovery
      summary: Authorization server metadata
      description: OAuth 2.0 Authorization Server Metadata (RFC 8414)
      operationId: GetOAuthAuthorizationServerMetadata
      responses:
        '200':
          description: Authorization server metadata
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthorizationServerMetadata'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/oauth_Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/oauth_Error'
      security: []
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Telnyx from 'telnyx';


            const client = new Telnyx();


            const response = await
            client.wellKnown.retrieveAuthorizationServerMetadata();


            console.log(response.authorization_endpoint);
        - lang: Python
          source: >-
            from telnyx import Telnyx


            client = Telnyx()

            response =
            client.well_known.retrieve_authorization_server_metadata()

            print(response.authorization_endpoint)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.WellKnown.GetAuthorizationServerMetadata(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.AuthorizationEndpoint)\n}\n"
        - lang: Java
          source: >-
            package com.telnyx.sdk.example;


            import com.telnyx.sdk.client.TelnyxClient;

            import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;

            import
            com.telnyx.sdk.models.wellknown.WellKnownRetrieveAuthorizationServerMetadataParams;

            import
            com.telnyx.sdk.models.wellknown.WellKnownRetrieveAuthorizationServerMetadataResponse;


            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    TelnyxClient client = TelnyxOkHttpClient.fromEnv();

                    WellKnownRetrieveAuthorizationServerMetadataResponse response = client.wellKnown().retrieveAuthorizationServerMetadata();
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

            telnyx = Telnyx::Client.new(api_key: "My API Key")

            response = telnyx.well_known.retrieve_authorization_server_metadata

            puts(response)
        - lang: PHP
          source: >-
            <?php


            require_once dirname(__DIR__) . '/vendor/autoload.php';


            use Telnyx\Client;

            use Telnyx\Core\Exceptions\APIException;


            $client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API
            Key');


            try {
              $response = $client->wellKnown->retrieveAuthorizationServerMetadata();

              var_dump($response);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx well-known retrieve-authorization-server-metadata \
              --api-key 'My API Key'
components:
  schemas:
    AuthorizationServerMetadata:
      type: object
      properties:
        issuer:
          type: string
          format: uri
          description: Authorization server issuer URL
        token_endpoint:
          type: string
          format: uri
          description: Token endpoint URL
        introspection_endpoint:
          type: string
          format: uri
          description: Token introspection endpoint URL
        jwks_uri:
          type: string
          format: uri
          description: JWK Set endpoint URL
        registration_endpoint:
          type: string
          format: uri
          description: Dynamic client registration endpoint URL
        authorization_endpoint:
          type: string
          format: uri
          description: Authorization endpoint URL
        grant_types_supported:
          type: array
          items:
            type: string
          description: Supported grant types
        code_challenge_methods_supported:
          type: array
          items:
            type: string
          description: Supported PKCE code challenge methods
        response_types_supported:
          type: array
          items:
            type: string
          description: Supported response types
        token_endpoint_auth_methods_supported:
          type: array
          items:
            type: string
          description: Supported token endpoint authentication methods
        scopes_supported:
          type: array
          items:
            type: string
          description: Supported OAuth scopes
          example:
            - admin
    oauth_Error:
      type: object
      properties:
        error:
          type: string
          description: Error code
        error_description:
          type: string
          description: Human-readable error description
      required:
        - error
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````