---
title: "Create an OAuth client"
method: POST
path: "/webhook_subscriptions/oauth_clients"
tags: ["Webhooks"]
---

# Create an OAuth client

`POST /webhook_subscriptions/oauth_clients`

Create a new OAuth client for webhook subscriptions. The client credentials will be validated by attempting to obtain an access token before creation.

Requires admin or owner role permissions.

Maximum of 10 OAuth clients per account.

## Headers

- `Accept` string, required
- `Content-Type` 'application/json', required

## Request body

- CreateOAuthClientRequest
  - `oauth_client` object, required
    - `name` string, required — A human-readable name for the OAuth client
    - `client_id` string, required — The OAuth client ID provided by the OAuth server
    - `client_secret` string, required — The OAuth client secret provided by the OAuth server
    - `scope` string — The OAuth scopes requested for this client
    - `token_url` string, uri, required — The OAuth token endpoint URL
    - `grant_type` 'client_credentials', required — The OAuth grant type (currently only client_credentials is supported)

## Response `201`

OAuth client created successfully

- object
  - `oauth_client` OAuthClient
    - `id` string — The ID of the OAuth client
    - `type` 'oauth_client', required — The type of object being created
    - `name` string, required — A human-readable name for the OAuth client
    - `client_id` string, required — The OAuth client ID provided by the OAuth server
    - `scope` string, nullable — The OAuth scopes requested for this client
    - `token_url` string, uri, required — The OAuth token endpoint URL
    - `grant_type` 'client_credentials', required — The OAuth grant type (currently only client_credentials is supported)
    - `status` 'active' | 'error' — The current status of the OAuth client

## Other responses

- `400` — Caller provided invalid arguments. Please review the response for error details. Retrying with the same arguments will *not* work.
- `401` — Caller did not supply credentials or did not provide the correct credentials. If you are using an API key, it may be invalid or your Authorization header may be malformed.
- `403` — Caller is not authorized to view the requested resource. While your authentication is valid, the authenticated user or token does not have permission to perform this action.

---

[API](https://skmtc.net/pagerduty/apis/rest-api.md) · [All operations](https://skmtc.net/pagerduty/apis/rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pagerduty/rest-api/versions/b679a8f3f02c/schema)
