> This page is for version 2025-09-18 (default).
> For other versions, use one of these documentation indexes:
> - 2025-09-18 (default): https://apidocs.polytomic.com/2025-09-18/llms.txt
> - 2024-02-08: https://apidocs.polytomic.com/2024-02-08/llms.txt
> - 2023-04-25: https://apidocs.polytomic.com/2023-04-25/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://apidocs.polytomic.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://apidocs.polytomic.com/_mcp/server.

# sync.completed

Fires when a Model Sync execution finishes, whatever its outcome. Read `status` to see the outcome. A failed or canceled execution also fires `sync.failed` or `sync.canceled`, and a completed execution with record errors or warnings also fires `sync.completed_with_errors`. Polytomic sends this event once the execution's record logs are available, so it can arrive after those events. Polytomic does not send it if the Model Sync has been deleted.

## Payload fields

| Field | Type | Always present | Description |
| --- | --- | --- | --- |
| `sync_name` | string | Yes | Name of the Model Sync |
| `organization_id` | string (UUID) | Yes | Organization ID |
| `sync_id` | string (UUID) | Yes | Model Sync ID |
| `execution_id` | string (UUID) | Yes | Execution ID |
| `schedule` | object | No | Schedule that started the execution |
| `schedule.frequency` | string | No | Frequency of the schedule |
| `status` | string | Yes | Final status of the execution, one of completed, failed, or canceled |
| `trigger` | string | Yes | What started the execution |
| `record_count` | integer | Yes | Number of records processed by the execution |
| `inserted_count` | integer | No | Number of records inserted |
| `updated_count` | integer | No | Number of records updated |
| `upserted_count` | integer | No | Number of records upserted |
| `deleted_count` | integer | No | Number of records deleted |
| `warning_count` | integer | Yes | Number of record warnings |
| `error_count` | integer | Yes | Number of record errors |
| `target_connection_id` | string (UUID) | Yes | Destination connection ID |
| `logs_url` | string | No | Endpoint returning the index of record logs produced by this execution |
| `total_records` | array of string | No | URLs of the record log files for all records |
| `inserted_records` | array of string | No | URLs of the record log files for inserted records |
| `updated_records` | array of string | No | URLs of the record log files for updated records |
| `errored_records` | array of string | No | URLs of the record log files for records with errors |
| `deleted_records` | array of string | No | URLs of the record log files for deleted records |
| `warnings` | array of string | No | URLs of the record log files for records with warnings |

## Example

This example shows a webhook delivery, with the fields above in `event`. See the
[events overview](/guides/events/overview) for the delivery format.

```json
{
  "id": "685a851c-31bb-5703-b70f-05b07e107ae5",
  "created_at": "2024-01-01T02:00:00Z",
  "type": "sync.completed",
  "event": {
    "error_count": 0,
    "execution_id": "0ecd09c1-b901-4d27-9053-f0367c427254",
    "inserted_count": 85,
    "logs_url": "https://app.polytomic.com/api/syncs/0b155265-c537-44c9-9359-a3ceb468a4da/executions/0ecd09c1-b901-4d27-9053-f0367c427254/logs",
    "organization_id": "be80a27e-0e80-4dcb-bee9-1666f02eeb83",
    "record_count": 100,
    "schedule": {
      "frequency": "hourly"
    },
    "status": "completed",
    "sync_id": "0b155265-c537-44c9-9359-a3ceb468a4da",
    "sync_name": "Salesforce contacts",
    "target_connection_id": "7c67e0b3-9759-44eb-b96c-2a7042b583f0",
    "trigger": "scheduled",
    "updated_count": 15,
    "warning_count": 0
  }
}
```