# Create new authentication configuration

**Documentation:** /reference/api-reference/auth-configs/postAuthConfigs

Creates a new auth config for a toolkit, allowing you to use your own OAuth credentials or API keys instead of Composio-managed authentication. This is required when you want to use custom OAuth apps (bring your own client ID/secret) or configure specific authentication parameters for a toolkit.

---

## POST `/api/v3/auth_configs`

**Endpoint:** `https://backend.composio.dev/api/v3/auth_configs`

**Summary:** Create new authentication configuration

Creates a new auth config for a toolkit, allowing you to use your own OAuth credentials or API keys instead of Composio-managed authentication. This is required when you want to use custom OAuth apps (bring your own client ID/secret) or configure specific authentication parameters for a toolkit.

### Authentication

**ApiKeyAuth** - API Key in `header` header `x-api-key` OR **UserApiKeyAuth** - API Key in `header` header `x-user-api-key`

### Request Body

**Schema:**

- `toolkit` (object) *(required)*
  - `slug` (string) *(required)*: Toolkit slug to create auth config for
- `auth_config` (any)

**Example:**

```json
{
  "toolkit": {
    "slug": "string"
  },
  "auth_config": {
    "type": "use_composio_managed_auth",
    "credentials": {},
    "restrict_to_following_tools": []
  }
}
```

### Responses

#### 201 - Successfully created auth config

**Response Schema:**

- `toolkit` (object) *(required)*
  - `slug` (string) *(required)*: The unique key of the toolkit
- `auth_config` (object) *(required)*
  - `id` (string (authConfigId)) *(required)*: The auth config id of the toolkit (must be a valid auth config id)
  - `auth_scheme` (string) *(required)*: The authentication mode of the toolkit
  - `is_composio_managed` (boolean) *(required)*: Whether the auth config is managed by Composio
  - `restrict_to_following_tools` (array<string>): The tools that the user can use with the auth config

**Example Response:**

```json
{
  "toolkit": {
    "slug": "string"
  },
  "auth_config": {
    "id": "string",
    "auth_scheme": "string",
    "is_composio_managed": true,
    "restrict_to_following_tools": []
  }
}
```

#### 400 - Bad request

**Response Schema:**

- `error` (object) *(required)*
  - `message` (string) *(required)*
  - `code` (number) *(required)*
  - `slug` (string) *(required)*
  - `status` (number) *(required)*
  - `request_id` (string)
  - `suggested_fix` (string)
  - `errors` (array<string>)

#### 401 - Unauthorized

**Response Schema:**

- `error` (object) *(required)*
  - `message` (string) *(required)*
  - `code` (number) *(required)*
  - `slug` (string) *(required)*
  - `status` (number) *(required)*
  - `request_id` (string)
  - `suggested_fix` (string)
  - `errors` (array<string>)

#### 404 - Not found

**Response Schema:**

- `error` (object) *(required)*
  - `message` (string) *(required)*
  - `code` (number) *(required)*
  - `slug` (string) *(required)*
  - `status` (number) *(required)*
  - `request_id` (string)
  - `suggested_fix` (string)
  - `errors` (array<string>)

#### 500 - Internal server error

**Response Schema:**

- `error` (object) *(required)*
  - `message` (string) *(required)*
  - `code` (number) *(required)*
  - `slug` (string) *(required)*
  - `status` (number) *(required)*
  - `request_id` (string)
  - `suggested_fix` (string)
  - `errors` (array<string>)

### Example cURL Request

```bash
curl -X POST "https://backend.composio.dev/api/v3/auth_configs" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "toolkit": {
      "slug": "string"
    },
    "auth_config": {
      "type": "use_composio_managed_auth",
      "credentials": {},
      "restrict_to_following_tools": []
    }
  }'
```