# Create a connector

> Source: https://docs.clonepartner.com/api-reference/connectors/create-connector/

`POST /api/connectors`

Create a connector

**Operation ID:** `createConnector`

## Authentication

### Option 1

- **BearerAuth** (`http bearer`)
  API key token. Create via POST /api/api-keys. Format: `envoy_<hex>`

### Option 2

- **CookieAuth** (`apiKey`)
  Session cookie set after login + TOTP verification

## Request body

The request body is required.

### `application/json`

- Type: `object`
- Properties:
  - `name` (`string`, `required`)
  - `type` (`string`, `required`) — Connector type (e.g. sqlite, mongodb, mssql, api, csv)
  - `config` (`object`, `required`) — Type-specific configuration
    - Description: Type-specific configuration
    - Additional properties: allowed
  - `description` (`string`)

## Success responses

### 201

Connector created

**Content type:** `application/json`

- Reference: `Connector`
  - Type: `object`
  - Properties:
    - `id` (`integer`)
    - `name` (`string`)
    - `type` (`string`)
    - `config` (`object`) — Parsed connector configuration
    - `description` (`string | null`)
      - Nullable: yes
    - `created_at` (`string`)
      - Format: `date-time`
    - `updated_at` (`string`)
      - Format: `date-time`

## Examples

### cURL

```bash
curl --request POST \
  --url 'https://your-envoy.example.com/api/connectors' \
  --header 'Authorization: Bearer $API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "string",
  "type": "string",
  "config": {}
}'
```

### JavaScript (fetch)

```javascript
const response = await fetch('https://your-envoy.example.com/api/connectors', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "name": "string",
    "type": "string",
    "config": {}
  }),
});

if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = response.status === 204 ? null : await response.json();
console.log(data);
```
