> 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. # Get Sync GET https://app.polytomic.com/api/syncs/{id} Returns a single model sync by ID. To check whether a sync is currently running or has recently completed, use [`GET /api/syncs/{id}/status`](../../../api-reference/model-sync/get-status). For the full history of executions, use [`GET /api/syncs/{id}/executions`](../../../api-reference/model-sync/executions/list). Reference: https://apidocs.polytomic.com/api-reference/model-sync/get ## Authentication - `Authorization` header (basic auth, required) — This is the Polytomic deployment key (on-premises only) - `Authorization` header (bearer token, required) — This is the Polytomic API key ## Request ### Path parameters - `id` (string, required) ## Response ### 200 OK - `data` (V2SyncResponse, optional) ## Errors ### 401 Unauthorized Error Unauthorized - `code` (integer, optional) — Application-specific error code. - `context` (map from string to any, optional) — Application context. - `error` (string, optional) — Error message. - `status` (string, optional) — Status text. ### 404 Not Found Error Not Found - `key` (string, optional) - `message` (string, optional) - `metadata` (map from string to any, optional) - `status` (integer, optional) ### 500 Internal Server Error Internal Server Error - `key` (string, optional) - `message` (string, optional) - `metadata` (map from string to any, optional) - `status` (integer, optional) ## Types ### V2SyncResponse - `active` (boolean, optional) - `created_at` (string, optional) - `created_by` (OutputActor, optional) - `encryption_passphrase` (string, optional) - `fields` (list of V2SyncField, optional) - `filter_logic` (string, optional) - `filters` (list of V2Filter, optional) - `id` (string, optional) - `identity` (V2Identity, optional) - `mode` (enum, optional) - Allowed values: `create`, `update`, `updateOrCreate`, `replace`, `append`, `remove`, `snapshot` - `model_ids` (list of string, optional) — Model IDs used in the sync. - `name` (string, optional) - `only_enrich_updates` (boolean, optional) - `organization_id` (string, optional) - `override_fields` (list of V2OverrideField, optional) - `overrides` (list of V2Override, optional) - `policies` (list of string, optional) - `schedule` (Schedule, optional) - `skip_initial_backfill` (boolean, optional) - `sync_all_records` (boolean, optional) - `target` (V2Target, optional) - `updated_at` (string, optional) - `updated_by` (OutputActor, optional) ### OutputActor - `id` (string, optional) - `name` (string, optional) - `type` (string, optional) ### V2SyncField - `target` (string, required) — Target field ID the source field value will be written to. - `encryption_enabled` (boolean, optional) — Whether the field should be encrypted. - `new` (boolean, optional, default: false) — New is set to true if the target field should be created by Polytomic. This is not supported by all backends. - `override_value` (string, optional) — Value to set in the target field; a mapping with an override value and no source is stored as an override field. - `source` (V2Source, optional) - `sync_mode` (string, optional) — Sync mode for the field; defaults to 'updateOrCreate'. If set to 'create', the field will not be synced if it already has a value. This is not supported by all backends. ### V2Filter A filter on this sync. Either `field` or `field_id` must be provided; if `field_id` is provided, `field` is ignored. `field` names a model field by model and source name. `field_id` is a model field's UUID when `field_type` is `Model`, and the destination's own field identifier when it is `Target`. - `function` (enum, required) - Allowed values: `Equality`, `Inequality`, `IsNull`, `IsNotNull`, `True`, `False`, `OnOrAfter`, `OnOrBefore`, `GreaterThan`, `GreaterThanEqual`, `LessThan`, `LessThanEqual`, `StringContains`, `StringStartsWith`, `StringEndsWith`, `StringDoesNotContain`, `StringDoesNotStartWith`, `StringDoesNotEndWith`, `StringOneOf`, `StringNotOneOf`, `Between`, `ArrayContains`, `ArrayDoesNotContain`, `InTheLast`, `RelativeOnOrBefore`, `RelativeOnOrAfter`, `StringLike`, `StringNotLike`, `StringMatchesTrimmed` - `field` (V2Source, optional) - `field_id` (string, optional) — Identifier of the field to filter on: a model field's UUID when 'field_type' is 'Model', or the destination's own field identifier when it is 'Target'. - `field_type` (enum, optional) - Allowed values: `Model`, `Target` - `label` (string, optional) - `value` (any, optional) - `value_field` (V2Source, optional) — Model field whose value this filter compares against, resolved separately for each record. Only valid on a target filter, mutually exclusive with 'value', and accepted only by destinations reporting 'supports_filter_value_fields'. ### V2Identity - `function` (enum, required) - Allowed values: `Equality`, `ISubstring`, `OneOf`, `DomainMatch`, `HostnameMatch` - `source` (V2Source, required) - `target` (string, required) - `new_field` (boolean, optional) - `remote_field_type_id` (string, optional, nullable) ### V2OverrideField A target field which is set to a fixed value for every record; unlike a field mapping, an override field has no source field. - `override_value` (string, required) — Value written to the target field for every record. - `target` (string, required) — Target field ID the value will be written to. - `new` (boolean, optional, default: false) — New is set to true if the target field should be created by Polytomic. This is not supported by all backends. - `sync_mode` (string, optional) — Sync mode for the field; defaults to 'updateOrCreate'. If set to 'create', the field will not be synced if it already has a value. This is not supported by all backends. ### V2Override Either `field` or `field_id` must be provided. If `field_id` is provided, `field` is ignored. - `field` (V2Source, optional) - `field_id` (string, optional) — Field ID of the model field to override. - `function` (enum, optional) - Allowed values: `Equality`, `Inequality`, `IsNull`, `IsNotNull`, `True`, `False`, `OnOrAfter`, `OnOrBefore`, `GreaterThan`, `GreaterThanEqual`, `LessThan`, `LessThanEqual`, `StringContains`, `StringStartsWith`, `StringEndsWith`, `StringDoesNotContain`, `StringDoesNotStartWith`, `StringDoesNotEndWith`, `StringOneOf`, `StringNotOneOf`, `Between`, `ArrayContains`, `ArrayDoesNotContain`, `InTheLast`, `RelativeOnOrBefore`, `RelativeOnOrAfter`, `StringLike`, `StringNotLike`, `StringMatchesTrimmed` - `override` (any, optional) - `value` (any, optional) ### Schedule - `connection_id` (string, optional) - `day_of_month` (string, optional, nullable) - `day_of_week` (string, optional, nullable) - `frequency` (enum, optional) - Allowed values: `manual`, `continuous`, `hourly`, `daily`, `weekly`, `custom`, `builder`, `runafter`, `multi`, `dbtcloud` - `hour` (string, optional, nullable) - `job_id` (integer, optional, nullable) - `minute` (string, optional, nullable) - `month` (string, optional, nullable) - `run_after` (RunAfter, optional) - `run_after_success_only` (boolean, optional, nullable) — If true, the sync will only run if the dependent syncs completed successfully. ### V2Target - `connection_id` (string, required) - `configuration` (map from string to any, optional) - `create` (map from string to string, optional) — Create a new target object with these properties. - `filter_logic` (string, optional) — Logical expression combining this sync's target filters -- the entries in 'filters' whose 'field_type' is 'Target' -- by their labels. The operators are not case-sensitive but the labels are, and the expression has to name every target filter at least once -- a filter may be repeated, as in '(A and B) or (A and C)' -- and an expression which leaves one out is rejected. - `object` (string, optional) - `new_name` (string, optional, deprecated) — Name for a new target object. - `search_values` (map from string to any, optional, deprecated) ### V2Source - `field` (string, required) - `model_id` (string, required) ### RunAfter - `bulk_sync_ids` (list of string, optional) - `sync_ids` (list of string, optional) ## Examples **Response** ```json { "data": { "active": true, "created_at": "2024-01-15T09:30:00Z", "created_by": { "id": "12345678-1234-1234-1234-123456789012", "name": "John Doe", "type": "user" }, "encryption_passphrase": "string", "fields": [ { "target": "name", "encryption_enabled": true, "new": false, "override_value": "fixed_value", "source": { "field": "id", "model_id": "248df4b7-aa70-47b8-a036-33ac447e668d" }, "sync_mode": "create" } ], "filter_logic": "string", "filters": [ { "function": "Equality", "field": { "field": "id", "model_id": "248df4b7-aa70-47b8-a036-33ac447e668d" }, "field_id": "field1", "field_type": "Model", "label": "A", "value": null, "value_field": { "field": "id", "model_id": "248df4b7-aa70-47b8-a036-33ac447e668d" } } ], "id": "248df4b7-aa70-47b8-a036-33ac447e668d", "identity": { "function": "Equality", "source": { "field": "id", "model_id": "248df4b7-aa70-47b8-a036-33ac447e668d" }, "target": "name", "new_field": true, "remote_field_type_id": "string" }, "mode": "create", "model_ids": [ "string" ], "name": "Users Sync", "only_enrich_updates": false, "organization_id": "248df4b7-aa70-47b8-a036-33ac447e668d", "override_fields": [ { "override_value": "fixed_value", "target": "name", "new": false, "sync_mode": "create" } ], "overrides": [ { "field": { "field": "id", "model_id": "248df4b7-aa70-47b8-a036-33ac447e668d" }, "field_id": "field1", "function": "Equality", "override": null, "value": null } ], "policies": [ "248df4b7-aa70-47b8-a036-33ac447e668d" ], "schedule": { "connection_id": "248df4b7-aa70-47b8-a036-33ac447e668d", "day_of_month": "1", "day_of_week": "monday", "frequency": "manual", "hour": "12", "job_id": 1, "minute": "30", "month": "1", "run_after": { "bulk_sync_ids": [ "248df4b7-aa70-47b8-a036-33ac447e668d" ], "sync_ids": [ "248df4b7-aa70-47b8-a036-33ac447e668d" ] }, "run_after_success_only": true }, "skip_initial_backfill": false, "sync_all_records": false, "target": { "connection_id": "248df4b7-aa70-47b8-a036-33ac447e668d", "configuration": { "key": "value" }, "create": { "name": "value" }, "filter_logic": "A and B", "object": "Users", "new_name": "string", "search_values": { "name": "value" } }, "updated_at": "2024-01-15T09:30:00Z", "updated_by": { "id": "12345678-1234-1234-1234-123456789012", "name": "John Doe", "type": "user" } } } ``` **SDK Code** ```typescript import { PolytomicClient } from "polytomic"; async function main() { const client = new PolytomicClient({ token: "YOUR_TOKEN_HERE", version: "X-Polytomic-Version", }); await client.modelSync.get("248df4b7-aa70-47b8-a036-33ac447e668d"); } main(); ``` ```python from polytomic import Polytomic client = Polytomic( token="YOUR_TOKEN_HERE", version="X-Polytomic-Version", ) client.model_sync.get( id="248df4b7-aa70-47b8-a036-33ac447e668d", ) ``` ```go package example import ( context "context" client "github.com/polytomic/polytomic-go/v24/client" option "github.com/polytomic/polytomic-go/v24/option" ) func do() { client := client.NewClient( option.WithToken( "YOUR_TOKEN_HERE", ), option.WithVersion( "X-Polytomic-Version", ), ) client.ModelSync.Get( context.TODO(), "248df4b7-aa70-47b8-a036-33ac447e668d", ) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://app.polytomic.com/api/syncs/248df4b7-aa70-47b8-a036-33ac447e668d") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["X-Polytomic-Version"] = 'X-Polytomic-Version' request.basic_auth("", "") response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://app.polytomic.com/api/syncs/248df4b7-aa70-47b8-a036-33ac447e668d") .header("X-Polytomic-Version", "X-Polytomic-Version") .basicAuth("", "") .asString(); ``` ```php request('GET', 'https://app.polytomic.com/api/syncs/248df4b7-aa70-47b8-a036-33ac447e668d', [ 'headers' => [ 'X-Polytomic-Version' => 'X-Polytomic-Version', ], 'auth' => ['', ''], ]); echo $response->getBody(); ``` ```csharp using RestSharp; using RestSharp.Authenticators; var client = new RestClient("https://app.polytomic.com/api/syncs/248df4b7-aa70-47b8-a036-33ac447e668d"); client.Authenticator = new HttpBasicAuthenticator("", ""); var request = new RestRequest(Method.GET); request.AddHeader("X-Polytomic-Version", "X-Polytomic-Version"); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let credentials = Data(":".utf8).base64EncodedString() let headers = [ "X-Polytomic-Version": "X-Polytomic-Version", "Authorization": "Basic \(credentials)" ] let request = NSMutableURLRequest(url: NSURL(string: "https://app.polytomic.com/api/syncs/248df4b7-aa70-47b8-a036-33ac447e668d")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```