> ## 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.

# Protected resource metadata

> OAuth 2.0 Protected Resource Metadata for resource discovery



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/oauth.yml get /.well-known/oauth-protected-resource
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-protected-resource:
    servers:
      - url: https://api.telnyx.com
    get:
      tags:
        - OAuth Discovery
      summary: Protected resource metadata
      description: OAuth 2.0 Protected Resource Metadata for resource discovery
      operationId: GetOAuthProtectedResourceMetadata
      responses:
        '200':
          description: Protected resource metadata
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceMetadata'
        '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.retrieveProtectedResourceMetadata();


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

            client = Telnyx()
            response = client.well_known.retrieve_protected_resource_metadata()
            print(response.authorization_servers)
        - 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.GetProtectedResourceMetadata(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.AuthorizationServers)\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.WellKnownRetrieveProtectedResourceMetadataParams;

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


            public final class Main {
                private Main() {}

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

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

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

            response = telnyx.well_known.retrieve_protected_resource_metadata

            puts(response)
        - lang: CLI
          source: |-
            telnyx well-known retrieve-protected-resource-metadata \
              --api-key 'My API Key'
components:
  schemas:
    ResourceMetadata:
      type: object
      properties:
        resource:
          type: string
          format: uri
          description: Protected resource URL
        authorization_servers:
          type: array
          items:
            type: string
            format: uri
          description: List of authorization server URLs
    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

````