# Connectors

Connectors run compiled Rust plugins in deployments. Use the Main API for activation and the Supervisor API for instances.

Activation and deletion require `deployment:connectors:manage`. Listing requires `deployment:connectors:read`.

## Activation (Main API)

### List Available Connectors

`GET /tenants/{tenant_id}/workspaces/{workspace_id}/environments/{environment_id}/deployments/{deployment_id}/connectors`

Browse the connector catalog with availability and activation status for your deployment.

```bash
curl "https://api.laserdata.cloud/tenants/{tenant_id}/workspaces/{workspace_id}/environments/{environment_id}/deployments/{deployment_id}/connectors?type=sink&page=1&results=10" \
-H "ld-api-key: YOUR_API_KEY"
```

| Query Parameter | Description |
| --- | --- |
| `type` | Filter by `source` or `sink` |

### Activate a Connector

`POST /tenants/{tenant_id}/workspaces/{workspace_id}/environments/{environment_id}/deployments/{deployment_id}/connectors/activate`

Activate a connector on this deployment. The connector starts in Pending status and transitions to Active once nodes process the task.

```bash
curl -X POST https://api.laserdata.cloud/tenants/{tenant_id}/workspaces/{workspace_id}/environments/{environment_id}/deployments/{deployment_id}/connectors/activate \
-H "ld-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
  "connector_key": "postgres",
  "connector_type": "sink",
  "instance_name": "Telemetry to Postgres",
  "instance_key": "telemetry-pg-sink"
}'
```

| Field | Required | Description |
| --- | --- | --- |
| `connector_key` | Yes | Connector identifier (e.g. `postgres`, `elasticsearch`, `iceberg`) |
| `connector_type` | Yes | `source` or `sink` |
| `instance_name` | No | Human-readable name for this instance |
| `instance_key` | No | Unique key within the deployment (auto-generated if omitted, e.g. `postgres-sink-{operation_id}`) |

The endpoint returns `202 Accepted` and creates disabled initial configuration. Enable it under the returned instance key. Instances of one plugin keep separate histories. See [Connector Configuration](/connectors/configuration).

***

## Instances (Supervisor API)

An instance is a copy of a connector running on a deployment node.

### List Connector Instances

`GET {supervisor_url}/deployments/{deployment_id}/connectors/instances`

List all connector instances on the deployment.

```bash
curl {supervisor_url}/deployments/{deployment_id}/connectors/instances \
-H "ld-api-key: YOUR_API_KEY"
```

```json
[
  {
    "id": 1,
    "deployment_id": 611298765432109056,
    "connector_type": "sink",
    "connector_key": "postgres",
    "name": "Telemetry to Postgres",
    "key": "telemetry-pg-sink",
    "status": "active"
  }
]
```

Instance statuses are `pending`, `active`, `inactive`, and `failed`.

### Delete a Connector Instance

`DELETE {supervisor_url}/deployments/{deployment_id}/connectors/instances/{instance_id}`

Stop and remove a connector instance from all nodes.

```bash
curl -X DELETE {supervisor_url}/deployments/{deployment_id}/connectors/instances/{instance_id} \
-H "ld-api-key: YOUR_API_KEY"
```

A successful request returns `204 No Content`.

- [Connectors Guide](/connectors): Connector catalog and lifecycle
- [Connector Configuration](/api/configuration): Version-controlled connector configs

Source: https://docs.laserdata.com/api/connectors
