# Set the Salesforce full table scan frequency

> Sets how often every record of Salesforce tables with formula fields is read again: Salesforce changes a formula field without changing the record's modified date, so only a full read catches it. Tables left out keep their frequency.

Source: https://docs.stacksync.com/api-reference/syncs/set_sync_app_full_table_scan_frequency

`POST https://api.stacksync.com/v1/workspaces/{workspace_id}/bases/{base_id}/apps/{app_id}/full-table-scan-frequency`

- Operation: `set_sync_app_full_table_scan_frequency`
- Resource: Syncs
- Access: writes data

## Authentication

- `Authorization: Bearer <key>`: A workspace API key (workspace_…, created by a workspace owner under Workspace settings > Stacksync API) acts with editor rights on that workspace only; a user API key (user_…, created under Profile > Stacksync API) acts as that user in every workspace they belong to. POST, PUT and PATCH requests must send Content-Type: application/json. Every authentication failure answers 403.
- `Content-Type: application/json` on every request with a body.

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `workspace_id` | integer | Yes | The workspace. List the ones your key can reach with GET /v1/workspaces. |
| `base_id` | string (uuid) | Yes | The sync. |
| `app_id` | string | Yes | One of the sync's two apps, as listed in the sync's apps. |

## Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `region` | string (besg \| usnv) | Yes | The region of the sync |

## Request body

`application/json`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `tables` | array of object (FullTableScanFrequencyOfTable), at least 1 item | Yes | The tables to set; the app's other tables keep their frequency |
| `tables[].table_mapping_id` | string | Yes | A table of this app with formula fields, as listed in the sync's tables |
| `tables[].full_table_scan_frequency_in_seconds` | integer (3600 \| 14400 \| 21600 \| 43200 \| 86400) \| null | Yes | How often every record of this table is read again to catch formula field changes, in seconds; null never reads them again |
| `validate_only` | boolean, default false | No | Run every check of the write and answer 204 without writing: a refused write answers the error the write would |

## Returns

### 200 OK

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `app_id` | string | Yes |  |
| `tables` | array of object (StoredFullTableScanFrequencyOfTable) | Yes |  |
| `tables[].table_mapping_id` | string | Yes |  |
| `tables[].table_name` | string | Yes |  |
| `tables[].full_table_scan_frequency_in_seconds` | integer \| null | Yes | How often every record of this table is read again to catch formula field changes, in seconds; null never reads them again |

### 204 No Content

No body.

## Example request

```bash
curl -X POST "https://api.stacksync.com/v1/workspaces/{workspace_id}/bases/{base_id}/apps/{app_id}/full-table-scan-frequency?region=besg" \
  -H "Authorization: Bearer $STACKSYNC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "tables": [
    {
      "table_mapping_id": "<table_mapping_id>",
      "full_table_scan_frequency_in_seconds": 3600
    }
  ]
}'
```

## Example response (200)

```json
{
  "app_id": "<app_id>",
  "tables": [
    {
      "table_mapping_id": "<table_mapping_id>",
      "table_name": "<table_name>",
      "full_table_scan_frequency_in_seconds": 0
    }
  ]
}
```

## Errors

| Status | Meaning | Body |
| --- | --- | --- |
| 400 | Bad Request | `{ "error": string, "msg": string, "field": string \| null }` |
| 403 | Forbidden | `{ "error": string, "msg": string, "field": string \| null }` |
| 404 | Not Found | `{ "error": string, "msg": string, "field": string \| null }` |
| 409 | Conflict | `{ "error": string, "msg": string, "field": string \| null }` |

## Related

- [API Reference overview](https://docs.stacksync.com/api-reference): base URLs, regions, pagination, idempotency and errors
- [Authentication](https://docs.stacksync.com/api-reference/authentication): API keys and the 403 answers
- OpenAPI document: https://docs.stacksync.com/openapi.json
- [List syncs](https://docs.stacksync.com/api-reference/syncs/list_syncs)
- [Get a sync](https://docs.stacksync.com/api-reference/syncs/get_sync)
- [Get the status of a sync](https://docs.stacksync.com/api-reference/syncs/get_sync_status)
- [Get sync metrics](https://docs.stacksync.com/api-reference/syncs/get_sync_metrics)
- [Get sync diagnostics](https://docs.stacksync.com/api-reference/syncs/get_sync_diagnostics)
- [Get association change capture status](https://docs.stacksync.com/api-reference/syncs/get_sync_association_cdc_status)
- [Create a sync](https://docs.stacksync.com/api-reference/syncs/create_sync)
- [Update sync settings](https://docs.stacksync.com/api-reference/syncs/update_sync_settings)
- [Edit a sync](https://docs.stacksync.com/api-reference/syncs/edit_sync)
- [Delete a sync](https://docs.stacksync.com/api-reference/syncs/delete_sync)
- [Rename a sync](https://docs.stacksync.com/api-reference/syncs/rename_sync)
- [Switch a sync on or off](https://docs.stacksync.com/api-reference/syncs/switch_sync)
- [Set the change capture method](https://docs.stacksync.com/api-reference/syncs/set_sync_app_cdc_method)
- [Set the rate limit of an app](https://docs.stacksync.com/api-reference/syncs/set_sync_app_rate_limit)
- [Set Salesforce Bulk API access](https://docs.stacksync.com/api-reference/syncs/set_sync_app_bulk_api_access)
- [Set delete protection of an app](https://docs.stacksync.com/api-reference/syncs/set_sync_app_delete_protection)