---
title: Register an OAuth2 client
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > OAuth2 Client Public
---

# Register an OAuth2 client{% #register-an-oauth2-client %}
Copy pageCopied
{% tab title="v2" %}
**Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                              |
| ----------------- | --------------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/oauth2/register |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/oauth2/register |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/oauth2/register      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/oauth2/register      |
| us2.ddog-gov.com  | POST https://api.us2.ddog-gov.com/api/v2/oauth2/register  |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/oauth2/register     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/oauth2/register |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/oauth2/register |

### Overview

Register an OAuth2 client using the Dynamic Client Registration protocol defined in RFC 7591.

### Request

#### Body Data (required)



{% tab title="Model" %}

| Field                           | Type     | Description                                                                                                  |
| ------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------ |
| client_name [*required*]   | string   | Human-readable name of the client. Control characters are rejected.                                          |
| client_uri                      | string   | URL of the home page of the client.                                                                          |
| grant_types                     | [string] | OAuth 2.0 grant types the client may use. Defaults to `authorization_code` and `refresh_token` when omitted. |
| jwks_uri                        | string   | URL referencing the client's JSON Web Key Set.                                                               |
| logo_uri                        | string   | URL referencing a logo for the client.                                                                       |
| policy_uri                      | string   | URL pointing to the client's privacy policy.                                                                 |
| redirect_uris [*required*] | [string] | Array of redirection URI strings used by the client in redirect-based flows.                                 |
| response_types                  | [string] | OAuth 2.0 response types the client may use. Only `code` is supported.                                       |
| scope                           | string   | Space-separated list of scope values the client may request.                                                 |
| token_endpoint_auth_method      | string   | Requested authentication method for the token endpoint. Only `none` is supported.                            |
| tos_uri                         | string   | URL pointing to the client's terms of service.                                                               |

{% /tab %}

{% tab title="Example" %}

```json
{
  "client_name": "Example MCP Client",
  "client_uri": "https://example.com",
  "grant_types": [
    "authorization_code",
    "refresh_token"
  ],
  "jwks_uri": "https://example.com/.well-known/jwks.json",
  "logo_uri": "https://example.com/logo.png",
  "policy_uri": "https://example.com/privacy",
  "redirect_uris": [
    "https://example.com/oauth/callback"
  ],
  "response_types": [
    "code"
  ],
  "scope": "openid profile",
  "token_endpoint_auth_method": "none",
  "tos_uri": "https://example.com/tos"
}
```

{% /tab %}

### Response

{% tab title="201" %}
Created
{% tab title="Model" %}
Response payload for a successful OAuth2 dynamic client registration as defined by RFC 7591.

| Field                                        | Type     | Description                                                             |
| -------------------------------------------- | -------- | ----------------------------------------------------------------------- |
| client_id [*required*]                  | uuid     | Unique identifier assigned to the registered client.                    |
| client_name [*required*]                | string   | Human-readable name of the client.                                      |
| grant_types [*required*]                | [string] | OAuth 2.0 grant types registered for the client.                        |
| redirect_uris [*required*]              | [string] | Redirection URIs registered for the client.                             |
| response_types [*required*]             | [string] | OAuth 2.0 response types registered for the client.                     |
| token_endpoint_auth_method [*required*] | string   | Authentication method registered for the token endpoint. Always `none`. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "client_id": "72b68208-36a6-11f0-b21b-da7ad0900002",
  "client_name": "Example MCP Client",
  "grant_types": [
    "authorization_code",
    "refresh_token"
  ],
  "redirect_uris": [
    "https://example.com/oauth/callback"
  ],
  "response_types": [
    "code"
  ],
  "token_endpoint_auth_method": "none"
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% tab title="Model" %}
Error payload returned by OAuth2 dynamic client registration as defined by RFC 7591.

| Field                               | Type   | Description                                                                                   |
| ----------------------------------- | ------ | --------------------------------------------------------------------------------------------- |
| error [*required*]             | string | Single ASCII error code per RFC 7591, such as `invalid_request` or `invalid_client_metadata`. |
| error_description [*required*] | string | Human-readable description of the error.                                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "error": "invalid_client_metadata",
  "error_description": "redirect URI is not well-formed"
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \## default
# 
 \# Curl command curl -X POST "https://api.datadoghq.com/api/v2/oauth2/register" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d @- << EOF
{
  "client_name": "Example MCP Client",
  "grant_types": [
    "authorization_code",
    "refresh_token"
  ],
  "redirect_uris": [
    "https://example.com/oauth/callback"
  ],
  "response_types": [
    "code"
  ],
  "token_endpoint_auth_method": "none"
}
EOF 
                
{% /tab %}
