For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inBook a demo
GuidesAPI Reference
GuidesAPI Reference
  • API Reference
      • GETGet Sync Source
      • GETModel Sync Field Query
      • GETList Syncs
      • POSTCreate Sync
      • GETGet Sync Schedule Options
      • GETGet Sync
      • PUTUpdate Sync
      • DELDelete Model Sync
      • POSTActivate Sync
      • POSTCancel Sync
      • POSTStart Sync
      • GETGet Sync Status
        • GETGet Sync Target
        • GETList Sync Targets
        • GETGet Target Creation Property Values
Logo
Log inBook a demo
API ReferenceModel SyncTargets

Get Sync Target

GET
https://app.polytomic.com/api/connections/:id/modelsync/target/fields
GET
/api/connections/:id/modelsync/target/fields
$curl -G https://app.polytomic.com/api/connections/248df4b7-aa70-47b8-a036-33ac447e668d/modelsync/target/fields \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d target=sales.customers \
> -d refresh=true
1{
2 "data": {
3 "fields": [
4 {
5 "association": false,
6 "createable": true,
7 "description": "Unique identifier for the customer",
8 "encryptable": false,
9 "filterable": true,
10 "id": "customer_id",
11 "identity_functions": [
12 {
13 "id": "Equality",
14 "label": "Equality"
15 }
16 ],
17 "name": "Customer ID",
18 "required": true,
19 "source_type": "varchar(36)",
20 "supports_identity": true,
21 "type": "string",
22 "updateable": false
23 },
24 {
25 "association": false,
26 "createable": true,
27 "description": "Customer's email address",
28 "encryptable": true,
29 "filterable": true,
30 "id": "email",
31 "identity_functions": [
32 {
33 "id": "Equality",
34 "label": "Equality"
35 },
36 {
37 "id": "Hashed",
38 "label": "Hashed Match"
39 }
40 ],
41 "name": "Email",
42 "required": true,
43 "source_type": "varchar(255)",
44 "supports_identity": true,
45 "type": "string",
46 "updateable": true
47 },
48 {
49 "association": false,
50 "createable": true,
51 "description": "Date the customer was created",
52 "encryptable": false,
53 "filterable": true,
54 "id": "created_at",
55 "identity_functions": null,
56 "name": "Created At",
57 "required": false,
58 "source_type": "timestamp",
59 "supports_identity": false,
60 "type": "datetime",
61 "updateable": false
62 },
63 {
64 "association": true,
65 "createable": true,
66 "description": "Reference to the customer's assigned sales representative",
67 "encryptable": false,
68 "filterable": true,
69 "id": "sales_rep_id",
70 "identity_functions": null,
71 "name": "Sales Rep",
72 "required": false,
73 "source_type": "uuid",
74 "supports_identity": false,
75 "type": "string",
76 "updateable": true
77 }
78 ],
79 "id": "sales.customers",
80 "modes": [
81 {
82 "description": "Create records when they don't exist; don't update existing ones",
83 "label": "Create",
84 "mode": "create",
85 "requires_identity": true,
86 "supports_field_sync_mode": false,
87 "supports_target_filters": false
88 },
89 {
90 "description": "Update existing records; do not create new ones",
91 "label": "Update",
92 "mode": "update",
93 "requires_identity": true,
94 "supports_field_sync_mode": true,
95 "supports_target_filters": true
96 },
97 {
98 "description": "Create new records or update existing ones based on identity",
99 "label": "Upsert",
100 "mode": "upsert",
101 "requires_identity": true,
102 "supports_field_sync_mode": true,
103 "supports_target_filters": true
104 }
105 ],
106 "name": "Customers",
107 "properties": {
108 "does_not_report_operation_counts": false,
109 "mappings_not_required": false,
110 "new_target_label": "Customer Table Name",
111 "optional_target_mappings": false,
112 "primary_metadata_object": "customer_metadata",
113 "requires_configuration": false,
114 "supports_field_creation": true,
115 "supports_field_encryption": true,
116 "supports_field_type_selection": true,
117 "supports_identity_field_creation": true,
118 "supports_target_filters": true,
119 "target_creator": false,
120 "use_field_names_as_labels": false
121 },
122 "refreshed_at": "2024-06-15T12:00:00Z"
123 }
124}
Returns the fields, modes, and properties of a target object on a connection. Pass the target object identifier to retrieve the fields available for mapping on that object. These are the destination fields you can reference when configuring field mappings in a model sync. > 📘 To list available target objects and their identifiers, use > [`GET /api/connections/{id}/modelsync/targetobjects`](../../../../../../api-reference/model-sync/targets/list). Fields returned here reflect the connection's current cached state. If the upstream object schema has changed, trigger a schema refresh with [`POST /api/connections/{id}/schemas/refresh`](../../../../../../api-reference/schemas/refresh) before calling this endpoint. ## Fields for a target that hasn't been created yet Some connections support creating a new destination object as part of a model sync — for example, a Facebook Ads custom audience or a LinkedIn Ads contact list. In that case there is no existing target identifier to pass; instead, describe the new target with the same properties returned in the `target_creation` block of [`GET /api/connections/{id}/modelsync/targetobjects`](../../../../../../api-reference/model-sync/targets/list), and this endpoint will return the fields the new target will expose. Exactly one of `target` or `properties` must be supplied. Each input is sent as a separate `properties[key]=value` query parameter. For a Facebook Ads connection that requires an `account` and a `name`: ``` GET /api/connections/{id}/modelsync/target/fields ?properties[account]=act_1234567 &properties[name]=My%20new%20audience ``` The response shape is identical to the existing-target form. For backends where the new target's field set is fixed (most ads platforms), `fields` contains those fields; for backends where the columns are user-defined (e.g. a SQL database), `fields` will be empty and the caller defines the columns at mapping time. When `properties` is supplied, the `refresh` parameter is ignored — a not-yet-created target has no cached schema to refresh.
Was this page helpful?
Previous

List Sync Targets

Next

Returns the fields, modes, and properties of a target object on a connection.

Pass the target object identifier to retrieve the fields available for mapping on that object. These are the destination fields you can reference when configuring field mappings in a model sync.

📘 To list available target objects and their identifiers, use GET /api/connections/{id}/modelsync/targetobjects.

Fields returned here reflect the connection’s current cached state. If the upstream object schema has changed, trigger a schema refresh with POST /api/connections/{id}/schemas/refresh before calling this endpoint.

Fields for a target that hasn’t been created yet

Some connections support creating a new destination object as part of a model sync — for example, a Facebook Ads custom audience or a LinkedIn Ads contact list. In that case there is no existing target identifier to pass; instead, describe the new target with the same properties returned in the target_creation block of GET /api/connections/{id}/modelsync/targetobjects, and this endpoint will return the fields the new target will expose.

Exactly one of target or properties must be supplied. Each input is sent as a separate properties[key]=value query parameter. For a Facebook Ads connection that requires an account and a name:

GET /api/connections/{id}/modelsync/target/fields
?properties[account]=act_1234567
&properties[name]=My%20new%20audience

The response shape is identical to the existing-target form. For backends where the new target’s field set is fixed (most ads platforms), fields contains those fields; for backends where the columns are user-defined (e.g. a SQL database), fields will be empty and the caller defines the columns at mapping time.

When properties is supplied, the refresh parameter is ignored — a not-yet-created target has no cached schema to refresh.

Authentication

AuthorizationBearer
Bearer user API key
OR
AuthorizationBasic

Basic organization-scoped API key

Path parameters

idstringRequiredformat: "uuid"
Unique identifier of the connection.

Headers

X-Polytomic-VersionstringOptional

Query parameters

targetstringOptional

Identifier of the target object (e.g. schema.table for a database destination, object name for a SaaS destination). Required unless properties is supplied.

refreshbooleanOptional
When true, force a cache refresh of the target's schema before returning its fields. Ignored when properties is supplied.
propertiesmap from strings to lists of stringsOptional

Target-creation property values, supplied as properties[key]=value, matching the target_creation.properties returned by GET /api/connections/{id}/modelsync/targetobjects. When supplied, the response describes the not-yet-created target that would result from these inputs, in the same shape as for an existing target. Exactly one of target or properties must be supplied.

Response

OK
dataobject

Errors

400
Bad Request Error
403
Forbidden Error
404
Not Found Error
500
Internal Server Error