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

# Dynamic Client Registration

> Register a new OAuth 2.0 client dynamically.

Register a new OAuth 2.0 client dynamically with Stytch. This endpoint allows client applications to register themselves without requiring manual configuration through the Dashboard. This endpoint uses your [Custom Domain](/connected-apps/resources/custom-domains).

This feature must be enabled at the project level in the [Connected Apps section](https://stytch.com/dashboard/connected-apps) of the Dashboard.

This endpoint creates a Third-Party Public or Third-Party Confidential Connected App client, depending on the authentication method specified. Public clients with identical metadata may return the same client ID (see Client Deduplication below), while confidential clients always receive a unique client ID.

No authorization is needed for this endpoint.

This endpoint implements the [OpenID Connect Dynamic Client Registration](https://openid.net/specs/openid-connect-registration-1%5F0.html#ClientRegistration) specification and is compatible with the [OAuth 2.0 Dynamic Client Registration](https://tools.ietf.org/html/rfc7591) specification.

#### Client Deduplication

To prevent duplicate public clients, Stytch computes a hash of the submitted client metadata. If the metadata matches an existing public client exactly, the same client ID is returned instead of creating a new one. This ensures that multiple instances of the same application (like MCP clients) can be administered as a single client identity.

<Note>
  Deduplication only applies to public clients (those using `token_endpoint_auth_method: "none"`). Confidential clients always receive a unique client ID and client secret.
</Note>

#### Client Types and Authentication

Both `third_party_public` and `third_party_confidential` clients can be created through dynamic registration:

* `third_party_public`: Set `token_endpoint_auth_method` to `none`. These clients do not receive a client secret and must use PKCE for all authorization flows.
* `third_party_confidential`: Set `token_endpoint_auth_method` to `client_secret_post` or `client_secret_basic`. These clients receive a client secret for authentication.

All dynamically registered clients will have:

* `grant_types`: `["authorization_code", "refresh_token"]`
* `response_types`: `["code"]`

<Info>
  We recommend using the [Custom Domain](/connected-apps/resources/custom-domains) whenever possible. For backwards compatibility reasons, this endpoint is also available at [https://test.stytch.com/v1/public/\$\{projectId}/oauth2/register](https://test.stytch.com/v1/public/\$\{projectId}/oauth2/register).
</Info>

## Body

<ParamField body="redirect_uris" type="array" required>
  Array of redirect URI values for use in OAuth Authorization flows.
</ParamField>

<ParamField body="client_name" type="string">
  A human-readable name for the client.
</ParamField>

<ParamField body="client_uri" type="string">
  URL of the home page of the Client.
</ParamField>

<ParamField body="token_endpoint_auth_method" type="string">
  Authentication method used by the client for the token endpoint. Must be one of `none`, `client_secret_post`, or `client_secret_basic`.
</ParamField>

## Response

<ResponseField name="client_id" type="string">
  The ID of the Connected App client.
</ResponseField>

<ResponseField name="client_uri" type="string">
  URL of the home page of the Client.
</ResponseField>

<ResponseField name="client_name" type="string">
  A human-readable name for the client.
</ResponseField>

<ResponseField name="grant_types" type="array">
  Array of OAuth 2.0 grant types that the client may use.
</ResponseField>

<ResponseField name="redirect_uris" type="array">
  Array of redirect URI values for use in OAuth Authorization flows.
</ResponseField>

<ResponseField name="response_types" type="array">
  Array of OAuth 2.0 response types that the client may use.
</ResponseField>

<ResponseField name="token_endpoint_auth_method" type="string">
  Authentication method used by the client for the token endpoint. Must be one of `none`, `client_secret_post`, or `client_secret_basic`.
</ResponseField>

<ResponseField name="request_id" type="string">
  Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we
  may ask for this value to help identify a specific API call when helping you debug an issue.
</ResponseField>

<ResponseField name="status_code" type="number">
  The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values
  equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
</ResponseField>

<Panel>
  <RequestExample>
    ```curl cURL theme={null}
    curl --request POST \
      --url https://${projectDomain}/v1/oauth2/register \
      -H 'Content-Type: application/json' \
      -d '{
        "client_name": "Dynamically registered client",
        "client_uri": "https://client.example.com/about",
        "redirect_uris": ["http://localhost:3000/oauth2/callback"]
      }'
    ```
  </RequestExample>

  <ResponseExample>
    ```json 200 theme={null}
    {
      "client_id": "connected-app-test-f1877bf2-d660-4675-b82d-b5fe91a609fa",
      "client_name": "Dynamically registered client",
      "grant_types": ["authorization_code", "refresh_token"],
      "redirect_uris": ["http://localhost:3000/oauth2/callback"],
      "response_types": ["code"],
      "token_endpoint_auth_method": "none"
    }
    ```

    ```json 429 theme={null}
    {
      "status_code": 429,
      "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
      "error_type": "too_many_requests",
      "error_message": "Too many requests have been made.",
      "error_url": "https://stytch.com/docs/api/errors/429"
    }
    ```

    ```json 500 theme={null}
    {
      "status_code": 500,
      "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
      "error_type": "internal_server_error",
      "error_message": "Oops, something seems to have gone wrong, please reach out to support@stytch.com to let us know what went wrong.",
      "error_url": "https://stytch.com/docs/api/errors/500"
    }
    ```
  </ResponseExample>
</Panel>
