> 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 (bearer token, required) — Bearer user API key
- `Authorization` header (basic auth, required) — Basic organization-scoped API key

## Request

### Path parameters

- `id` (string, required)

## Response

### 200

OK

- `data` (ModelSyncV5Response, optional)

## Errors

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

### ModelSyncV5Response

- `active` (boolean, optional)
- `created_at` (datetime, optional)
- `created_by` (OutputActor, optional)
- `encryption_passphrase` (string, optional)
- `fields` (list of SyncField, optional)
- `id` (string, optional)
- `identities` (ModelSyncIdentities, optional) — Identity mappings for the sync and the strategy combining them.
- `mode` (enum, optional)
  - Allowed values: `create`, `update`, `updateOrCreate`, `replace`, `append`, `remove`, `snapshot`
- `model_filters` (ModelFilters, optional) — Filters applied to the records read from the source.
- `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 OverrideField, optional)
- `overrides` (list of Override, optional)
- `policies` (list of string, optional)
- `problems` (list of ModelSyncProblem, optional, nullable) — Parts of this configuration which could not be resolved when it was read. The configuration is reported unchanged, references included, so it can be corrected and written back; this property is ignored on input.
- `schedule` (Schedule, optional)
- `skip_initial_backfill` (boolean, optional)
- `sync_all_records` (boolean, optional)
- `target` (ModelSyncV5Target, optional)
- `target_filters` (TargetFilters, optional) — Filters applied to the destination records the sync has matched. Only some destinations and sync modes support them; 'supports\_target\_filters' on the mode returned by GET /api/connections/\{id}/modelsync/target/fields says which.
- `updated_at` (datetime, optional)
- `updated_by` (OutputActor, optional)
- `filter_logic` (string, optional, deprecated) — Deprecated. Use 'model_filters.logic'.
- `filters` (list of Filter, optional, deprecated) — Deprecated. Use 'model_filters.conditions' and 'target_filters.conditions'. Reports the same filters, with the two kinds interleaved and told apart by 'field_type'.
- `identity` (Identity, optional, deprecated) — Deprecated. Use 'identities'. Reports the first identity mapping only.

### OutputActor

- `id` (string, optional)
- `name` (string, optional)
- `type` (string, optional)

### SyncField

- `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` (Source, 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.

### ModelSyncIdentities

Identity mappings determining how records are matched between source and destination.

- `mappings` (list of Identity, required) — Identity mappings in priority order. An empty list removes every identity mapping.
- `strategy` (enum, optional) — How the mappings are combined: 'priority' matches each record on the first mapping that finds a destination record, and 'and' requires every mapping to match. Required when there is more than one mapping; a single mapping is always 'priority'.
  - Allowed values: `priority`, `and`

### ModelFilters

Filters applied to the records read from the source.

- `conditions` (list of ModelFilterCondition, optional, nullable) — Conditions a source record must satisfy to be read. An empty list reads every record.
- `logic` (string, optional) — Expression combining the conditions in this object by their labels; 'and', 'or', and parentheses are supported. The operators are not case-sensitive but the labels are, and the expression has to name every condition in this object -- a condition may be repeated, as in '(A and B) or (A and C)' -- and an expression which leaves one out is rejected. An empty expression means every condition must be satisfied.

### OverrideField

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.

### Override

Either `field` or `field_id` must be provided. If `field_id` is provided, `field` is ignored.

- `field` (Source, 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)

### ModelSyncProblem

- `code` (string, optional) — Stable identifier for the kind of problem. Branch on this rather than on 'message'.
- `message` (string, optional) — Description of the problem, suitable for showing to a person.
- `path` (string, optional) — JSON path of the part of this configuration the problem is about, relative to the sync object.
- `severity` (enum, optional) — How serious the problem is. Every problem reported today is an error, which stops the sync from running; read this rather than assuming.
  - Allowed values: `error`

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

### ModelSyncV5Target

- `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.
- `object` (string, optional)
- `filter_logic` (string, optional, deprecated) — Deprecated. Use 'target_filters.logic', which combines the conditions it is grouped with.
- `new_name` (string, optional, deprecated) — Name for a new target object.
- `search_values` (map from string to any, optional, deprecated)

### TargetFilters

Filters applied to the destination records the sync has matched. Only some destinations and sync modes support them; 'supports\_target\_filters' on the mode returned by GET /api/connections/\{id}/modelsync/target/fields says which.

- `conditions` (list of TargetFilterCondition, optional, nullable) — Conditions a destination record must satisfy to be written. An empty list writes every matched record.
- `logic` (string, optional) — Expression combining the conditions in this object by their labels; 'and', 'or', and parentheses are supported. The operators are not case-sensitive but the labels are, and the expression has to name every condition in this object -- a condition may be repeated, as in '(A and B) or (A and C)' -- and an expression which leaves one out is rejected. An empty expression means every condition must be satisfied.

### Filter

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` (Source, 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` (Source, 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'.

### Identity

- `function` (enum, required)
  - Allowed values: `Equality`, `ISubstring`, `OneOf`, `DomainMatch`, `HostnameMatch`
- `source` (Source, required)
- `target` (string, required)
- `new_field` (boolean, optional)
- `remote_field_type_id` (string, optional, nullable)

### Source

- `field` (string, required)
- `model_id` (string, required)

### ModelFilterCondition

- `function` (enum, required) — Comparison this condition applies to the field's value.
  - 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`
- `source` (Source, required) — Model field this condition tests, named the same way as a field mapping's source.
- `label` (string, optional) — Handle naming this condition in 'logic'. A label starts with a letter or underscore and continues with letters, digits and underscores. Labels are scoped to this object, so a model condition and a target condition may share one. Optional: label every condition in the object or none of them, and an unlabelled object is labelled by position -- A, B, C -- which is how labels are always reported back.
- `value` (any, optional) — Value the field is compared against. Omitted for functions which take no value, such as 'IsNotNull'.

### RunAfter

- `bulk_sync_ids` (list of string, optional)
- `sync_ids` (list of string, optional)

### TargetFilterCondition

- `field` (string, required) — Destination field this condition tests, identified the same way as a field mapping's target.
- `function` (enum, required) — Comparison this condition applies to the field's value.
  - 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`
- `label` (string, optional) — Handle naming this condition in 'logic'. A label starts with a letter or underscore and continues with letters, digits and underscores. Labels are scoped to this object, so a model condition and a target condition may share one. Optional: label every condition in the object or none of them, and an unlabelled object is labelled by position -- A, B, C -- which is how labels are always reported back.
- `value` (any, optional) — Value the field is compared against. Omitted for functions which take no value, such as 'IsNotNull'.
- `value_source` (Source, optional) — Model field whose value the destination field is compared against, resolved separately for every record, named the way a model condition names its source. Mutually exclusive with 'value', and accepted only by destinations reporting 'supports_filter_value_fields'.

## 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"
      }
    ],
    "id": "248df4b7-aa70-47b8-a036-33ac447e668d",
    "identities": {
      "mappings": [
        {
          "function": "Equality",
          "source": {
            "field": "id",
            "model_id": "248df4b7-aa70-47b8-a036-33ac447e668d"
          },
          "target": "name",
          "new_field": true,
          "remote_field_type_id": "string"
        }
      ],
      "strategy": "priority"
    },
    "mode": "create",
    "model_filters": {
      "conditions": [
        {
          "function": "Equality",
          "source": {
            "field": "id",
            "model_id": "248df4b7-aa70-47b8-a036-33ac447e668d"
          },
          "label": "A",
          "value": null
        }
      ],
      "logic": "A and B or C"
    },
    "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"
    ],
    "problems": [
      {
        "code": "unknown_target_field",
        "message": "string",
        "path": "target_filters.conditions[1].field",
        "severity": "error"
      }
    ],
    "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"
      },
      "object": "Users",
      "filter_logic": "string",
      "new_name": "string",
      "search_values": {
        "name": "value"
      }
    },
    "target_filters": {
      "conditions": [
        {
          "field": "Email",
          "function": "Equality",
          "label": "A",
          "value": null,
          "value_source": {
            "field": "id",
            "model_id": "248df4b7-aa70-47b8-a036-33ac447e668d"
          }
        }
      ],
      "logic": "A and B"
    },
    "updated_at": "2024-01-15T09:30:00Z",
    "updated_by": {
      "id": "12345678-1234-1234-1234-123456789012",
      "name": "John Doe",
      "type": "user"
    },
    "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"
        }
      }
    ],
    "identity": {
      "function": "Equality",
      "source": {
        "field": "id",
        "model_id": "248df4b7-aa70-47b8-a036-33ac447e668d"
      },
      "target": "name",
      "new_field": true,
      "remote_field_type_id": "string"
    }
  }
}
```

**SDK Code**

```python
import requests

url = "https://app.polytomic.com/api/syncs/248df4b7-aa70-47b8-a036-33ac447e668d"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://app.polytomic.com/api/syncs/248df4b7-aa70-47b8-a036-33ac447e668d';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://app.polytomic.com/api/syncs/248df4b7-aa70-47b8-a036-33ac447e668d"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```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["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://app.polytomic.com/api/syncs/248df4b7-aa70-47b8-a036-33ac447e668d")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://app.polytomic.com/api/syncs/248df4b7-aa70-47b8-a036-33ac447e668d', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://app.polytomic.com/api/syncs/248df4b7-aa70-47b8-a036-33ac447e668d");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

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()
```