Skip to navigation

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

FieldTypeAlways presentDescription
sync_namestringYesName of the Model Sync
organization_idstring (UUID)YesOrganization ID
sync_idstring (UUID)YesModel Sync ID
execution_idstring (UUID)YesExecution ID
scheduleobjectNoSchedule that started the execution
schedule.frequencystringNoFrequency of the schedule
statusstringYesFinal status of the execution, one of completed, failed, or canceled
triggerstringYesWhat started the execution
record_countintegerYesNumber of records processed by the execution
inserted_countintegerNoNumber of records inserted
updated_countintegerNoNumber of records updated
upserted_countintegerNoNumber of records upserted
deleted_countintegerNoNumber of records deleted
warning_countintegerYesNumber of record warnings
error_countintegerYesNumber of record errors
target_connection_idstring (UUID)YesDestination connection ID
logs_urlstringNoEndpoint returning the index of record logs produced by this execution
total_recordsarray of stringNoURLs of the record log files for all records
inserted_recordsarray of stringNoURLs of the record log files for inserted records
updated_recordsarray of stringNoURLs of the record log files for updated records
errored_recordsarray of stringNoURLs of the record log files for records with errors
deleted_recordsarray of stringNoURLs of the record log files for deleted records
warningsarray of stringNoURLs 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 for the delivery format.

{
"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
}
}