---
title: "Trigger a marketing platform sync"
method: POST
path: "/assets/{asset_id}/marketing-platform-syncs"
tags: ["Assets"]
---

# Trigger a marketing platform sync

`POST /assets/{asset_id}/marketing-platform-syncs`

## Request

- Base URL: `https://enterprise.knak.io/api/published/v1`
- URL: `https://enterprise.knak.io/api/published/v1/assets/{asset_id}/marketing-platform-syncs`
- Auth: none declared
- TypeScript: <https://skmtc.dev/knak/apis/knak-enterprise-api/docs/assets/:asset_id/marketing-platform-syncs/post.ts> (a function with typed inputs; its response is checked against the schema)

Trigger a sync of an asset to a marketing platform. Returns 202 Accepted with a [marketing platform sync](#tag/marketing_platform_sync) record whose `id` can be polled via `GET /marketing-platform-syncs/{id}`.

**Platform support:** only integrations with platform `marketing_cloud` (Salesforce Marketing Cloud) are currently supported. Requests targeting other platforms return `422 Unprocessable Entity` with a validation error on `integration_id`. Additional platforms will be enabled in future releases.

Returns `409 Conflict` when another sync is already pending or in progress for the same asset + integration pair. The conflict response includes `meta.existing_sync_id` so the caller can poll that sync instead.

Returns `422 Unprocessable Entity` when `sync_type` is `resync` but the asset has never been successfully synced to the target integration.

## Pre-sync Audit Validation

Before queuing a sync, Knak runs a pre-sync audit against the asset. When the audit finds blocking errors, the request returns `422 Unprocessable Entity` with a `meta.pre_sync_validation` block. When the audit passes (with or without non-blocking warnings), the request returns `202 Accepted` and the same `meta.pre_sync_validation` block is included with details. Privileged callers can opt out of audit enforcement by setting `skip_optimize_validation: true` (requires the `emails_bypass_optimize_sync` permission).

**Note:** "pre-sync audit" refers to Knak's structural and content checks on the asset (image alt text, email size, expired modules, etc.). It is *not* the LLM-based brand-voice "Optimize Checks" feature, which shares a name in the product UI but does not run on the Sync API today.

### Audit Result Shape

Each entry in `errors[]`, `warnings[]`, and `asset_exceptions[]` has the shape `{ id, message, assets }`:

- `id` — stable string identifier for the audit rule that fired (for example, `alt-text`). Treat the set as open; Knak may add new IDs over time. Callers that want to filter on specific rules should match against `id`; everyone else should ignore it.

- `message` — human-readable description of the violation. Surface this directly to your end users.

- `assets` — array of asset IDs the violation applies to.

See the response examples below for concrete payloads.

## Path parameters

- `asset_id` string, required

## Request body

- object
  - `integration_id` string, required: ID of the target integration. Must belong to the authenticated company and have platform `marketing_cloud`.
  - `sync_type` 'sync' | 'resync', required
  - `template_name` string, nullable: Optional override for the template/email name surfaced on the target platform. Falls back to the asset's name.
  - `platform_parameters` object: Platform-specific sync configuration. Required when `sync_type` is `sync`. For `marketing_cloud` integrations, expects `folder_id` and `email_asset_type`.
  - `skip_optimize_validation` boolean: When `true`, bypasses the pre-sync audit validation and queues the sync even if the asset has audit errors or warnings. Requires the `emails_bypass_optimize_sync` permission on the authenticated user — callers without this permission will have the flag silently ignored (audit will still run). Use this to retry a sync after reviewing audit results that returned `can_skip_optimize: true`. Defaults to `false`.

## Response `202`

Accepted. Sync has been queued. When the pre-sync audit runs, the response includes `meta.pre_sync_validation` with any non-blocking warnings or asset exceptions. The block is omitted when audit was bypassed via `skip_optimize_validation`.

- MarketingPlatformSyncItem
  - `data` MarketingPlatformSync
    - `type` string
    - `id` string
    - `attributes` MarketingPlatformSyncAttributes
      - `id` string
      - `asset_id` string
      - `integration_id` string
      - `platform` string
      - `sync_type` 'sync' | 'resync'
      - `status` 'pending' | 'in_progress' | 'complete' | 'failed' | 'confirmation_requested': Wire value; the database stores `error` for failed syncs but the API response maps that to `failed` for consistency.
      - `platform_asset_id` string, nullable
      - `platform_asset_url` string, nullable
      - `error_message` string, nullable
      - `created_at` string, date-time
      - `updated_at` string, date-time

## Other responses

- `400`: Bad Request
- `401`: Unauthenticated
- `403`: Unauthorized
- `409`: A sync is already in progress for this asset + integration pair.
- `422`: Validation failed. Two distinct cases produce this response: 1. **Resync precondition** — `sync_type` was `resync` but the asset has never been successfully synced to the target integration. 2. **Pre-sync audit failure** — the asset has audit errors that block the sync. See the `meta.pre_sync_validation` example below. Inspect the `errors[].title` field to disambiguate (`Unprocessable Entity` vs. `PreSyncValidationFailed`).

---

[API](https://skmtc.dev/knak/apis/knak-enterprise-api.md) - [All operations](https://skmtc.dev/knak/apis/knak-enterprise-api/llms.txt) - [OpenAPI document](https://skmtc.dev/knak/apis/knak-enterprise-api/revisions/31d2c94edfcc?raw)
