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

# Get OAuth consent token

> Retrieve details about an OAuth consent token



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/oauth.yml get /oauth/consent/{consent_token}
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:
  /oauth/consent/{consent_token}:
    get:
      tags:
        - OAuth Protocol
      summary: Get OAuth consent token
      description: Retrieve details about an OAuth consent token
      operationId: GetOAuthConsentToken
      parameters:
        - name: consent_token
          in: path
          required: true
          schema:
            type: string
          description: OAuth consent token
      responses:
        '200':
          description: Consent token details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConsentTokenResponse'
        '422':
          description: Invalid consent token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/oauth_Error'
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Telnyx from 'telnyx';

            const client = new Telnyx({
              apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
            });

            const oauth = await client.oauth.retrieve('consent_token');

            console.log(oauth.data);
        - lang: Python
          source: |-
            import os
            from telnyx import Telnyx

            client = Telnyx(
                api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
            )
            oauth = client.oauth.retrieve(
                "consent_token",
            )
            print(oauth.data)
        - 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\toauth, err := client.OAuth.Get(context.TODO(), \"consent_token\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", oauth.Data)\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.oauth.OAuthRetrieveParams;
            import com.telnyx.sdk.models.oauth.OAuthRetrieveResponse;

            public final class Main {
                private Main() {}

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

                    OAuthRetrieveResponse oauth = client.oauth().retrieve("consent_token");
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

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

            oauth = telnyx.oauth.retrieve("consent_token")

            puts(oauth)
        - lang: CLI
          source: |-
            telnyx oauth retrieve \
              --api-key 'My API Key' \
              --consent-token consent_token
components:
  schemas:
    ConsentTokenResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            client_id:
              type: string
              description: Client ID
            name:
              type: string
              description: Client name
            requested_scopes:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                    description: Scope ID
                  name:
                    type: string
                    description: Scope name
                  description:
                    type: string
                    description: Scope description
            logo_uri:
              type:
                - string
                - 'null'
              format: uri
              description: URL of the client logo
            tos_uri:
              type:
                - string
                - 'null'
              format: uri
              description: URL of the client's terms of service
            policy_uri:
              type:
                - string
                - 'null'
              format: uri
              description: URL of the client's privacy policy
            redirect_uri:
              type: string
              format: uri
              description: The redirect URI for this authorization
            verified:
              type: boolean
              description: Whether the client is verified
    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

````