---
title: "Get Sync Target"
method: GET
path: "/api/connections/{id}/modelsync/target/fields"
tags: ["Model Sync"]
---

# Get Sync Target

`GET /api/connections/{id}/modelsync/target/fields`

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.

## Path parameters

- `id` string, uuid, required — Unique identifier of the connection.

## Query parameters

- `target` string — Identifier of the target object (e.g. schema.table for a database destination, object name for a SaaS destination). Required unless properties is supplied.
- `refresh` boolean — When true, force a cache refresh of the target's schema before returning its fields. Ignored when properties is supplied.
- `properties` object — 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.

## Headers

- `X-Polytomic-Version` string

## Response `200`

OK

- TargetResponseEnvelope
  - `data` TargetResponse
    - `fields` TargetField[], nullable — Fields available for mapping on this target. Empty for backends where the new target's columns are user-defined (e.g. SQL databases).
      - `association` boolean — True if this field is an association (foreign key) to another object rather than a value column.
      - `createable` boolean — True if this field can be written when creating a new record.
      - `description` string — Description of the field, when the backend provides one.
      - `encryptable` boolean — True if this field supports field-level encryption.
      - `filterable` boolean — True if this field can be used in a target filter.
      - `id` string — Backend-specific identifier of the field; use this value when configuring field mappings.
      - `identity_functions` IdentityFunction[], nullable — Identity match functions supported when this field is used as the sync identity (e.g. exact match, hashed match).
        - `id` string — Identifier of the identity function; use this value when configuring the sync identity.
        - `label` string — Human-readable label for the identity function.
      - `name` string — Human-readable name of the field.
      - `required` boolean — True if a model sync must map a value to this field for records to be accepted.
      - `source_type` string — Native type reported by the destination system.
      - `supports_identity` boolean — True if this field may be used as the identity (match key) for syncs that require one.
      - `type` string — Polytomic-normalized type used when mapping values to this field.
      - `updateable` boolean — True if this field can be written when updating an existing record.
    - `id` string — Backend-specific identifier of the target object. For not-yet-created targets, this is an internal placeholder identifier that callers should not rely on.
    - `modes` Mode[], nullable — Sync modes the target supports (e.g. create, update, upsert). The chosen mode determines which operations the sync may perform.
      - `description` string — Description of the operations performed in this mode.
      - `label` string — Human-readable label for the sync mode.
      - `mode` string — Identifier of the sync mode; use this value when configuring a sync.
      - `requires_identity` boolean — True if this mode requires a sync identity to match records on.
      - `supports_field_sync_mode` boolean — True if per-field sync modes (e.g. write-once vs. always-update) may be configured under this mode.
      - `supports_target_filters` boolean — True if this mode allows target filters to constrain which destination records are touched.
    - `name` string — Human-readable name of the target object.
    - `properties` SyncDestinationProperties
      - `does_not_report_operation_counts` boolean — True if execution reports for this destination will not break record counts out by operation (insert vs. update); typical for upsert-only destinations.
      - `mappings_not_required` boolean — True if a sync may be configured with only a target identity and no field mappings.
      - `new_target_label` string — Label to display when prompting for the name of a newly-created target (e.g. "Audience name", "Table name").
      - `optional_target_mappings` boolean — True if a sync may pick source fields without mapping each one to a specific target field (used by webhooks and target creators).
      - `primary_metadata_object` string — For destinations with multiple metadata dictionaries, identifies which dictionary new custom properties should be added to.
      - `requires_configuration` boolean — True if the destination requires target-level configuration before a sync can run.
      - `supports_field_creation` boolean — True if a sync may create new fields on this target as part of mapping.
      - `supports_field_encryption` boolean — True if the destination supports field-level encryption.
      - `supports_field_type_selection` boolean — True if the type of a newly-created field can be chosen at sync configuration time.
      - `supports_identity_field_creation` boolean — True if a sync may create a new field on this target to use as the sync identity.
      - `supports_target_filters` boolean — True if target filters are supported on this destination; the chosen sync mode may further constrain availability.
      - `target_creator` boolean — True if writing to this target will create a new object in the destination system rather than write to an existing one.
      - `use_field_names_as_labels` boolean — True if field IDs (rather than display names) should be used when labeling records in previews and logs.
    - `refreshed_at` string, date-time — Timestamp the target's cached schema was last refreshed. Zero for targets that do not have a cached schema (including not-yet-created targets).

## Other responses

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

---

[API](https://skmtc.net/polytomic/apis/polytomic-api.md) · [All operations](https://skmtc.net/polytomic/apis/polytomic-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/polytomic/polytomic-api/versions/5e9bcd4cfb2d/schema)
