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

# Sheet syncs create

## POST /api/v1/public/sheet-syncs/

Connect a Google Sheet tab to a lead list or a campaign. Seleqt reads the tab to check the key column, saves the sync and starts the first run right away in the background; after that it runs every 5 minutes. See [How a sync works](https://docs.seleqt.ai/api-reference/public/sheet-syncs.md#how-a-sync-works).

The spreadsheet must have been picked in the Seleqt app with the connected Google account first — the API can only sync spreadsheets that account granted to Seleqt. Run [POST /public/sheet-syncs/preview/](https://docs.seleqt.ai/api-reference/public/sheet-syncs-preview.md) with the same body first to see what the first run would do.

Auth: `X-API-Key`

### Request Body

```json theme={null}
{
  "campaign_id": 456,
  "spreadsheet_id": "1AbCdEfGhIjKlMnOpQrStUvWxYz0123456789",
  "sheet_name": "Leads",
  "header_row": 1,
  "key_field": "email",
  "key_column": "Email",
  "mappings": [
    { "column": "First name", "field": "first_name", "direction": "both" },
    { "column": "Last name", "field": "last_name", "direction": "both" },
    { "column": "Company", "field": "company.name", "direction": "out" },
    { "column": "Status", "field": "lead_status", "direction": "both" }
  ],
  "status_values": { "Closed lost": "STOPPED", "Demo planned": "MEETING_BOOKED" },
  "create_leads": true,
  "append_rows": true
}
```

### Request Body Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `campaign_id` | integer | One of the two | The campaign to sync with. |
| `search_id` | integer | One of the two | The lead list to sync with (used when `campaign_id` is not sent). |
| `spreadsheet_id` | string | Yes | The spreadsheet ID from its URL. |
| `sheet_name` | string | Yes | The tab's title. |
| `sheet_id` | integer | No | The tab's Google ID (`gid` in the URL). Lets the sync follow the tab after a rename. Filled in on the first run if omitted. |
| `spreadsheet_name` | string | No | Display name; refreshed from Google on every run. |
| `header_row` | integer | No | The row with the column headers, 1–50. Defaults to `1`. |
| `key_field` | string | No | `email` (default) or `linkedin_profile_url`. |
| `key_column` | string | Yes | The header of the column holding the key. Must exist in `header_row`. |
| `mappings` | array | No | `[{ "column", "field", "direction" }]` — see [Mappings](https://docs.seleqt.ai/api-reference/public/sheet-syncs.md#mappings). |
| `status_values` | object | No | `{ "<Sheet value>": "<STATUS>" }` — see [Status values](https://docs.seleqt.ai/api-reference/public/sheet-syncs.md#status-values). |
| `create_leads` | boolean | No | New rows become new leads. Defaults to `true`. |
| `append_rows` | boolean | No | New leads get a new row. Defaults to `true`. |
| `enabled` | boolean | No | Create the sync paused with `false`. Defaults to `true`. |

### Response

`201 Created`

```json theme={null}
{
  "success": true,
  "sync": {
    "id": 42,
    "search_id": null,
    "campaign_id": 456,
    "spreadsheet_id": "1AbCdEfGhIjKlMnOpQrStUvWxYz0123456789",
    "spreadsheet_name": "Q4 pipeline",
    "sheet_id": 0,
    "sheet_name": "Leads",
    "header_row": 1,
    "key_field": "email",
    "key_column": "Email",
    "mappings": [
      { "column": "First name", "field": "first_name", "direction": "both" },
      { "column": "Last name", "field": "last_name", "direction": "both" },
      { "column": "Company", "field": "company.name", "direction": "out" },
      { "column": "Status", "field": "lead_status", "direction": "both" }
    ],
    "status_values": { "Closed lost": "STOPPED", "Demo planned": "MEETING_BOOKED" },
    "create_leads": true,
    "append_rows": true,
    "enabled": true,
    "last_synced_at": null,
    "last_error": "",
    "last_stats": {},
    "created_at": "2026-11-24T10:00:02Z"
  }
}
```

The first run's results appear in `last_stats` and the [log](https://docs.seleqt.ai/api-reference/public/sheet-syncs-logs.md) a few seconds later — poll [GET /public/sheet-syncs/:id/](https://docs.seleqt.ai/api-reference/public/sheet-syncs-get.md) for `last_synced_at`.

### Error Responses

| Status | `error` | When |
| - | - | - |
| `400` | `Connect Google Sheets first (Settings › Integrations).` | Google Sheets isn't connected in the workspace. |
| `400` | `Pick the lead list or campaign to sync.` | No `campaign_id` / `search_id`, or it isn't in your current workspace. |
| `400` | `Pick a spreadsheet, a tab and the column that identifies each lead.` | `spreadsheet_id`, `sheet_name` or `key_column` is missing. |
| `400` | `header_row must be a row number.` | `header_row` isn't a number. |
| `400` | `key_field must be email or linkedin_profile_url.` | Invalid `key_field`. |
| `400` | `"Email" isn't a column of row 1.` | The key column isn't in the header row. The response also has `headers`: the columns found in that row. |
| `400` | `Seleqt can't open this spreadsheet any more. Pick it again in Google Sheets (or reconnect Google).` | The connected Google account didn't grant Seleqt this spreadsheet (pick it in the app), or access was revoked. |
| `400` | `The spreadsheet was deleted or moved out of reach.` | The spreadsheet no longer exists. |
| `400` | `The tab "Leads" is no longer in the spreadsheet.` | No tab with this `sheet_id` / `sheet_name`. |
| `400` | `Google's rate limit was reached — the next run tries again.` | Google Sheets quota; retry shortly. |
| `403` | `Viewers can't connect a Sheet.` | The API key belongs to a Viewer. |

### Example

```bash theme={null}
curl -X POST -H "X-API-Key: <key>" \
  -H "Content-Type: application/json" \
  -d '{
    "search_id": 123,
    "spreadsheet_id": "1AbCdEfGhIjKlMnOpQrStUvWxYz0123456789",
    "sheet_name": "Leads",
    "key_field": "linkedin_profile_url",
    "key_column": "LinkedIn",
    "mappings": [{"column": "Status", "field": "lead_status", "direction": "in"}],
    "create_leads": false
  }' \
  "https://api.seleqt.ai/api/v1/public/sheet-syncs/"
```

### Notes

* A Status column that stops outreach applies on the first run too: rows set to Stopped (or a value mapped to it) stop the person in every campaign.
* Several syncs can point at the same lead list or campaign (for example one tab per team).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.