> ## Documentation Index
> Fetch the complete documentation index at: https://docs.squasher.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Log Connectors API

> List the connector catalog, create project log connectors, verify delivery, and rotate managed ingest keys.

Use the Log Connectors API to manage reusable logging source connections for a project.

Every connector gets its own managed ingest key so you can rotate or revoke one source without touching the rest of the project.

## Authentication

All endpoints in this section require a Squasher API key with `project:read` or `project:write` access.

```bash theme={null}
curl -H "x-squasher-key: sq_pk_your_api_key" https://api.squasher.ai/v1/log-connectors/catalog
```

## Connector catalog

```http theme={null}
GET /v1/log-connectors/catalog
```

Returns the connector profiles currently supported by Squasher.

### Response

```json theme={null}
[
  {
    "aliases": ["vercel", "vercel_drain", "vercel-drain"],
    "docs_url": "https://docs.squasher.ai/integrations/vercel",
    "key": "vercel_drain",
    "provider": "vercel",
    "category": "platform_drain",
    "docs_slug": "vercel",
    "name": "Vercel Log Drain",
    "description": "Forward Vercel function and edge logs to Squasher."
  },
  {
    "aliases": ["otlp", "otel", "otlp_http", "otlp-http"],
    "docs_url": "https://docs.squasher.ai/integrations/opentelemetry",
    "key": "otlp_http",
    "provider": "open_telemetry",
    "category": "http_endpoint",
    "docs_slug": "opentelemetry",
    "name": "OTLP HTTP",
    "description": "Receive OpenTelemetry logs and traces over OTLP HTTP."
  }
]
```

You can pass either the canonical `connector_key` or one of the returned aliases when creating or onboarding a connector.

## List project connectors

```http theme={null}
GET /v1/projects/{project_id}/log-connectors
```

### Response

```json theme={null}
[
  {
    "id": "660e8400-e29b-41d4-a716-446655440001",
    "project_id": "660e8400-e29b-41d4-a716-446655440000",
    "api_key_id": "660e8400-e29b-41d4-a716-446655440002",
    "connector_key": "vercel_drain",
    "provider": "vercel",
    "display_name": "Vercel production drain",
    "status": "active",
    "enabled": true,
    "key_prefix": "sq_pk_abc12345",
    "config": {
      "format": "ndjson"
    },
    "last_verified_at": "2026-03-24T20:30:00Z",
    "last_ingested_at": "2026-03-24T20:33:00Z",
    "last_error_at": null,
    "last_error_message": null,
    "created_at": "2026-03-24T20:20:00Z",
    "updated_at": "2026-03-24T20:33:00Z"
  }
]
```

## Create a connector

```http theme={null}
POST /v1/projects/{project_id}/log-connectors
```

### Request body

```json theme={null}
{
  "connector_key": "otlp_http",
  "display_name": "OTLP collector",
  "config": {
    "mode": "collector",
    "authMode": "x-squasher-key",
    "signals": ["logs", "traces"]
  }
}
```

### Response

```json theme={null}
{
  "connection": {
    "id": "660e8400-e29b-41d4-a716-446655440001",
    "project_id": "660e8400-e29b-41d4-a716-446655440000",
    "api_key_id": "660e8400-e29b-41d4-a716-446655440002",
    "connector_key": "otlp_http",
    "provider": "open_telemetry",
    "display_name": "OTLP collector",
    "status": "draft",
    "enabled": true,
    "key_prefix": "sq_pk_abc12345",
    "config": {
      "mode": "collector",
      "authMode": "x-squasher-key",
      "signals": ["logs", "traces"]
    },
    "last_verified_at": null,
    "last_ingested_at": null,
    "last_error_at": null,
    "last_error_message": null,
    "created_at": "2026-03-24T20:20:00Z",
    "updated_at": "2026-03-24T20:20:00Z"
  },
  "setup": {
    "endpoint": "https://ingest.squasher.ai/v1/logs",
    "raw_key": "sq_pk_redacted_example",
    "snippet": "curl -X POST ..."
  }
}
```

The `raw_key` is only returned on create and rotate.

## Onboard a connector

```http theme={null}
POST /v1/projects/{project_id}/log-connectors/onboard
```

Creates the connector and returns the same setup material plus API, CLI, and MCP guidance for self-serve onboarding.

### Request body

```json theme={null}
{
  "connector_key": "railway",
  "display_name": "Railway production",
  "config": {}
}
```

### Response

```json theme={null}
{
  "connection": {
    "id": "660e8400-e29b-41d4-a716-446655440001",
    "connector_key": "railway_drain",
    "display_name": "Railway production",
    "key_prefix": "sq_pk_abc12345",
    "status": "draft"
  },
  "setup": {
    "endpoint": "https://ingest.squasher.ai/v1/drain/railway/660e8400-e29b-41d4-a716-446655440000?key=sq_pk_redacted_example",
    "raw_key": "sq_pk_redacted_example",
    "snippet": "curl -X POST ..."
  },
  "onboarding": {
    "api_path": "/v1/projects/660e8400-e29b-41d4-a716-446655440000/log-connectors/onboard",
    "cli_command": "squasher log-connectors onboard --project 660e8400-e29b-41d4-a716-446655440000 --connector-key railway_drain --display-name \"Railway production\"",
    "docs_url": "https://docs.squasher.ai/integrations/railway",
    "mcp_operation": "logConnectors.onboard",
    "steps": [
      {
        "title": "Create the managed connector",
        "description": "Create the Railway production connector in Squasher to get a dedicated ingest key."
      },
      {
        "title": "Configure your provider",
        "description": "Paste the returned endpoint or snippet into the provider's log forwarding settings."
      }
    ]
  }
}
```

For OTLP connectors, use the managed key with both:

* `https://ingest.squasher.ai/v1/logs`
* `https://ingest.squasher.ai/v1/traces`

## Agent handoff

Use managed connectors when an agent is onboarding a log source:

```text theme={null}
Create or verify a Squasher log connector for project <project_id>. List the catalog first, use onboard for a self-serve setup payload, return the destination URL and required headers, and ask before rotating keys or deleting connectors.
```

CLI equivalents live under `squasher log-connectors ...`. MCP clients should call `search("logConnectors.onboard")` or `search("logConnectors.verify")`, then `execute` the selected operation.

## Get one connector

```http theme={null}
GET /v1/projects/{project_id}/log-connectors/{connection_id}
```

Returns the current connector record.

## Update a connector

```http theme={null}
PUT /v1/projects/{project_id}/log-connectors/{connection_id}
```

### Request body

```json theme={null}
{
  "display_name": "OTLP collector main",
  "enabled": true,
  "status": "active",
  "config": {
    "mode": "collector",
    "authMode": "bearer",
    "signals": ["logs", "traces"]
  }
}
```

Returns the updated connector record.

## Verify a connector

```http theme={null}
POST /v1/projects/{project_id}/log-connectors/{connection_id}/verify
```

Marks the connector as verified and returns the updated connector record.

## Rotate a connector key

```http theme={null}
POST /v1/projects/{project_id}/log-connectors/{connection_id}/rotate-key
```

Returns a fresh managed ingest key plus updated setup material.

### Response

```json theme={null}
{
  "connection": {
    "id": "660e8400-e29b-41d4-a716-446655440001",
    "connector_key": "otlp_http",
    "display_name": "OTLP collector",
    "key_prefix": "sq_pk_newprefix",
    "status": "active"
  },
  "setup": {
    "endpoint": "https://ingest.squasher.ai/v1/logs",
    "raw_key": "sq_pk_new_redacted_example",
    "snippet": "curl -X POST ..."
  }
}
```

## Delete a connector

```http theme={null}
DELETE /v1/projects/{project_id}/log-connectors/{connection_id}
```

Deletes the connector record and revokes its managed ingest key.
