> ## 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 update

## PATCH /api/v1/public/sheet-syncs/:id/

Change a sync's settings, or pause and resume it. Only the fields you send change. The new settings apply from the next run.

Auth: `X-API-Key`

### Path Parameters

* `id` (integer, required): Sync ID

### Request Body

Any of the settings of [POST /public/sheet-syncs/](https://docs.seleqt.ai/api-reference/public/sheet-syncs-create.md#request-body-parameters): `spreadsheet_id`, `spreadsheet_name`, `sheet_name`, `sheet_id`, `header_row`, `key_field`, `key_column`, `mappings`, `status_values`, `create_leads`, `append_rows`, `enabled`. The lead list or campaign of a sync can't be changed.

`mappings` and `status_values` replace the saved ones as a whole.

Pause:

```json theme={null}
{ "enabled": false }
```

Resume (also clears `last_error`):

```json theme={null}
{ "enabled": true }
```

Add a Status value:

```json theme={null}
{
  "status_values": { "Closed lost": "STOPPED", "On hold": "STOPPED" }
}
```

### Response

```json theme={null}
{
  "success": true,
  "sync": {
    "id": 42,
    "campaign_id": 456,
    "enabled": true,
    "status_values": { "Closed lost": "STOPPED", "On hold": "STOPPED" },
    "last_error": "",
    "...": "see the sync object"
  }
}
```

Returns the full [sync object](https://docs.seleqt.ai/api-reference/public/sheet-syncs.md#the-sync-object).

### Error Responses

| Status | `error` | When |
| - | - | - |
| `400` | `Pick a spreadsheet, a tab and the column that identifies each lead.` | `spreadsheet_id`, `sheet_name` or `key_column` was set to an empty value. |
| `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`. |
| `403` | `Viewers can't change a sync.` | The API key belongs to a Viewer. |
| `404` | `Sync not found.` | No sync with this ID in your current workspace. |

### Example

```bash theme={null}
curl -X PATCH -H "X-API-Key: <key>" \
  -H "Content-Type: application/json" \
  -d '{"enabled": false}' \
  "https://api.seleqt.ai/api/v1/public/sheet-syncs/42/"
```

### Notes

* Unlike creating a sync, an update doesn't read the Sheet. Check a new `key_column`, `header_row` or tab with [POST /public/sheet-syncs/preview/](https://docs.seleqt.ai/api-reference/public/sheet-syncs-preview.md) (`sync_id` + the new values) first; a wrong one makes the next run fail with `last_error`.
* A sync paused because its spreadsheet or tab was gone resumes with `{"enabled": true}` once the spreadsheet is reachable again.


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