---
title: "Test an OAuth connection"
description: "Attempts to retrieve a valid provider token for the selected workspace connection."
---

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

Path: Channel Automation API › Integrations

`POST /api/oauth/connections/{id}/test`

Attempts to retrieve a valid provider token for the selected workspace connection.

## Authentication

Requires one of the following:

- `BearerAuth`, http, header `Authorization`, format `JWT`
- `ApiKeyAuth`, apiKey, in header, header `X-API-Key`, format `API_KEY`

## Path parameters

- `id` (`post/api/oauth/connections/id/test.path.id`; string, required)
  - format `uuid`

## Header parameters

- `x-workspace-id` (`post/api/oauth/connections/id/test.header.x-workspace-id`; string, required)

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.channelautomation.com/api/oauth/connections/<id>/test' \
  --header 'Authorization: Bearer <token>' \
  --header 'x-workspace-id: string'
```

### TypeScript

```typescript
const url = 'https://api.channelautomation.com/api/oauth/connections/<id>/test';
const options = {
  method: 'POST',
  headers: {'x-workspace-id': 'string', Authorization: 'Bearer <token>'}
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.channelautomation.com/api/oauth/connections/<id>/test"

headers = {
    "x-workspace-id": "string",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, headers=headers)

print(response.text)
```

## Responses

### 200

Connection test result.

### 400

Workspace ID is required.

### 404

Connection not found.

### 500

Internal server error

#### Example

```json
{
  "error": "Internal server error",
  "details": "string",
  "success": false
}
```

- `error` (`post/api/oauth/connections/id/test.response.500.error`; string, optional)
  - example `"Internal server error"`
- `details` (`post/api/oauth/connections/id/test.response.500.details`; string, optional)
- `success` (`post/api/oauth/connections/id/test.response.500.success`; boolean, optional)
  - example `false`


Source: https://developer.channelautomations.com/api/post-api-oauth-connections-id-test/index.md
