> You are reading the Docusign Developer Documentation. For clean Markdown of any page, append .md to the page URL.
>
> Documentation indexes by section:
> - APIs and SDKs: https://docusign.docs.buildwithfern.com/docs/llms.txt
> - Platform 101: https://docusign.docs.buildwithfern.com/platform/llms.txt
> - Extension Apps: https://docusign.docs.buildwithfern.com/extension-apps/llms.txt
> - Docusign CLI: https://docusign.docs.buildwithfern.com/docusign-cli/llms.txt
>
> Authentication (OAuth, JWT Grant, M2M): https://docusign.docs.buildwithfern.com/platform/auth
> Webhooks and Connect: https://docusign.docs.buildwithfern.com/platform/webhooks
>
> OpenAPI specifications: https://docusign.docs.buildwithfern.com/openapi.json
> MCP server: https://docusign.docs.buildwithfern.com/_mcp/server

# Set up Connect OAuth

POST https://demo.docusign.net/restapi/v2.1/accounts/{accountId}/connect/oauth
Content-Type: application/json

Sets up Connect OAuth for the specified account using an authorization server of your choice. To use this endpoint, get the client ID and client secret from your authorization server.

When you call this endpoint, Docusign requests an access token from your authorization server. Docusign will use that token in the Authorization HTTP header of your account's Connect messages. Finally, your listener will be responsible for validating the token by calling the authorization server.

To use this method, you must be an account administrator
and Connect must be enabled on your account.

## Related topics:

* [OAuth for Docusign Connect](/platform/webhooks/connect/validation-and-security/oauth-connect/)

Reference: https://developers.docusign.com/docs/esign-rest-api/reference/connect/connectconfigurations/createconnectoauthconfig

## Authentication

- `Authorization` header (required) (prefixed with ` Bearer  `) — OAuth 2.0 access token (JWT or auth-code grant). Sent as `Authorization: Bearer <token>` on every request except `GET /v2.1` and `GET /service_information`, which are public discovery endpoints.

## Servers

- `https://demo.docusign.net/restapi` (Demo, default)
- `https://www.docusign.net/restapi` (Production)

## Request

### Path parameters

- `accountId` (string, required) — The external account number (int) or account ID Guid.

### Body (application/json)

This endpoint expects a connectOAuthConfig.

- `authorizationServerUrl` (string, optional) — The token URL for your authorization server or OAuth service. This property is required.
- `clientId` (string, optional) — The client ID assigned to your app by your authorization server or OAuth service. This property is required.
- `clientSecret` (string, optional) — The secret value provided by your authorization server. This property is required.
- `customParameters` (map from string to string, optional)
- `scope` (string, optional) — The scopes that your app will request from the authorization server. This property is optional. **Note:** If you are using Azure, this value is the application ID URI of the secified resource affixed with the `.default`. For example: `api://{{clientId}}/.default`

## Response

### 201

Successful response.

- `authorizationServerUrl` (string, optional) — The token URL for your authorization server or OAuth service. This property is required.
- `clientId` (string, optional) — The client ID assigned to your app by your authorization server or OAuth service. This property is required.
- `clientSecret` (string, optional) — The secret value provided by your authorization server. This property is required.
- `customParameters` (map from string to string, optional)
- `scope` (string, optional) — The scopes that your app will request from the authorization server. This property is optional. **Note:** If you are using Azure, this value is the application ID URI of the secified resource affixed with the `.default`. For example: `api://{{clientId}}/.default`

## Errors

### 400 Bad Request Error

Error encountered.

- `errorCode` (string, optional) — The code associated with the error condition.
- `message` (string, optional) — A brief message describing the error condition.

## Examples

**Request**

```json
{
  "authorizationServerUrl": "sample string 1",
  "clientId": "sample string 2",
  "clientSecret": "sample string 3",
  "customParameters": {
    "key": "sample string 1"
  },
  "scope": "sample string 4"
}
```

**Response**

```json
{
  "authorizationServerUrl": "sample string 1",
  "clientId": "sample string 2",
  "clientSecret": "sample string 3",
  "customParameters": {
    "key": "sample string 1"
  },
  "scope": "sample string 4"
}
```