Get Sync Target

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.

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