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

# Dynamic client registration

> Register a new OAuth client dynamically (RFC 7591)



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/oauth.yml post /oauth/register
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/register:
    post:
      tags:
        - OAuth Protocol
      summary: Dynamic client registration
      description: Register a new OAuth client dynamically (RFC 7591)
      operationId: RegisterOAuthClient
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OAuthDynamicRegistrationRequest'
      responses:
        '201':
          description: Client registered successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OAuthDynamicRegistrationResponse'
        '400':
          description: Invalid client metadata
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: invalid_client_metadata
                  error_description:
                    type: string
                    example: The client metadata was invalid
                  invalid_fields:
                    type: object
                    additionalProperties:
                      type: array
                      items:
                        type: string
      security: []
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Telnyx from 'telnyx';

            const client = new Telnyx();

            const response = await client.oauth.register();

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

            client = Telnyx()
            response = client.oauth.register()
            print(response.client_id)
        - 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.OAuth.Register(context.TODO(), telnyx.OAuthRegisterParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.ClientID)\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.OAuthRegisterParams;
            import com.telnyx.sdk.models.oauth.OAuthRegisterResponse;

            public final class Main {
                private Main() {}

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

                    OAuthRegisterResponse response = client.oauth().register();
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

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

            response = telnyx.oauth.register

            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->oauth->register(
                clientName: 'My OAuth Application',
                grantTypes: ['authorization_code'],
                logoUri: 'https://example.com',
                policyUri: 'https://example.com',
                redirectUris: ['https://example.com/callback'],
                responseTypes: ['string'],
                scope: 'admin',
                tokenEndpointAuthMethod: 'none',
                tosUri: 'https://example.com',
              );

              var_dump($response);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx oauth register \
              --api-key 'My API Key'
components:
  schemas:
    OAuthDynamicRegistrationRequest:
      type: object
      properties:
        redirect_uris:
          type: array
          items:
            type: string
            format: uri
          description: Array of redirection URI strings for use in redirect-based flows
          example:
            - https://example.com/callback
        client_name:
          type: string
          description: >-
            Human-readable string name of the client to be presented to the
            end-user
          example: My OAuth Application
        grant_types:
          type: array
          items:
            type: string
            enum:
              - authorization_code
              - client_credentials
              - refresh_token
          description: Array of OAuth 2.0 grant type strings that the client may use
          default:
            - authorization_code
        response_types:
          type: array
          items:
            type: string
          description: Array of the OAuth 2.0 response type strings that the client may use
          default:
            - code
        scope:
          type: string
          description: Space-separated string of scope values that the client may use
          example: admin
        token_endpoint_auth_method:
          type: string
          enum:
            - none
            - client_secret_basic
            - client_secret_post
          description: Authentication method for the token endpoint
          default: client_secret_basic
        logo_uri:
          type: string
          format: uri
          description: URL of the client logo
        tos_uri:
          type: string
          format: uri
          description: URL of the client's terms of service
        policy_uri:
          type: string
          format: uri
          description: URL of the client's privacy policy
      additionalProperties: false
    OAuthDynamicRegistrationResponse:
      type: object
      properties:
        client_id:
          type: string
          description: Unique client identifier
          example: abc123def456
        client_secret:
          type: string
          description: Client secret (only for confidential clients)
        redirect_uris:
          type: array
          items:
            type: string
            format: uri
          description: Array of redirection URIs
        client_name:
          type: string
          description: Human-readable client name
        grant_types:
          type: array
          items:
            type: string
          description: Array of allowed grant types
        response_types:
          type: array
          items:
            type: string
          description: Array of allowed response types
        scope:
          type: string
          description: Space-separated scope values
        token_endpoint_auth_method:
          type: string
          description: Token endpoint authentication method
        client_id_issued_at:
          type: integer
          description: Unix timestamp of when the client ID was issued
        logo_uri:
          type: string
          format: uri
          description: URL of the client logo
        tos_uri:
          type: string
          format: uri
          description: URL of the client's terms of service
        policy_uri:
          type: string
          format: uri
          description: URL of the client's privacy policy
      required:
        - client_id
        - client_id_issued_at
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````