---
title: "Create an OAuth2 client credentials auth method"
method: POST
path: "/api/v2/integration/webhooks/configuration/auth-method/oauth2-client-credentials"
tags: ["Webhooks Integration"]
---

# Create an OAuth2 client credentials auth method

`POST /api/v2/integration/webhooks/configuration/auth-method/oauth2-client-credentials`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/integration/webhooks/configuration/auth-method/oauth2-client-credentials`
- Auth: API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`

Create a new OAuth2 client credentials auth method for the Webhooks
integration. The `client_secret` is stored securely and never returned.

## Request body

- WebhooksOAuth2ClientCredentialsCreateRequest: Create request for an OAuth2 client credentials auth method.
  - `data` WebhooksOAuth2ClientCredentialsCreateData, required: OAuth2 client credentials data for a create request.
    - `attributes` WebhooksOAuth2ClientCredentialsCreateAttributes, required: OAuth2 client credentials attributes for a create request.
      - `access_token_url` string, required: URL of the OAuth2 access token endpoint.
      - `audience` string, nullable: The intended audience for the OAuth2 access token.
      - `client_id` string, required: The OAuth2 client ID issued by the authorization server.
      - `client_secret` string, required: The OAuth2 client secret issued by the authorization server. Write-only; never returned by the API.
      - `name` string, required: Human-readable name for this auth method. Must be unique within your organization.
      - `scope` string, nullable: Space-separated list of OAuth2 scopes to request.
    - `type` 'webhooks-auth-method-oauth2-client-credentials', required: OAuth2 client credentials resource type.

## Response `201`

CREATED

- WebhooksOAuth2ClientCredentialsResponse: Response containing an OAuth2 client credentials auth method.
  - `data` WebhooksOAuth2ClientCredentialsResponseData, required: OAuth2 client credentials data from a response.
    - `attributes` WebhooksOAuth2ClientCredentialsResponseAttributes, required: OAuth2 client credentials attributes returned by the API. The `client_secret` is never echoed.
      - `access_token_url` string: URL of the OAuth2 access token endpoint.
      - `audience` string, nullable: The intended audience for the OAuth2 access token.
      - `client_id` string: The OAuth2 client ID issued by the authorization server.
      - `name` string: Human-readable name for this auth method.
      - `protocol` 'oauth2-client-credentials': Authentication protocol used by the auth method.
      - `scope` string, nullable: Space-separated list of OAuth2 scopes to request.
    - `id` string, required: The ID of the OAuth2 client credentials auth method.
    - `type` 'webhooks-auth-method-oauth2-client-credentials', required: OAuth2 client credentials resource type.

## Other responses

- `400`: Bad Request
- `403`: Forbidden
- `409`: Conflict
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/da68bf029e4c?raw)
