PermuteDocs
Go to Permute

Write syncs · writeSyncsPreview

Test a write sync

Queues a read-only preview of the full source in bounded pages. Poll getRun until previewComplete or previewError, then inspect every page. Does not write externally, even when the sync is published. Operation outputs are fixed for the capture; direct connector sources use their last synced data.

POST/v1/write-syncs/{writeSyncId}/preview
betaapiKeyworkspace

When to use

Capture proposed changes without writing to the destination.

For agents

Poll getRun until previewComplete or previewError, then inspect every page before approval. Preview remains read-only on enabled syncs. Direct connector sources use their last read sync.

Example

typescript
import { PermuteClient } from '@permute/sdk';

const orgClient = new PermuteClient({
  apiKey: process.env.PERMUTE_API_KEY!,
});

const client = orgClient.withWorkspace(process.env.PERMUTE_WORKSPACE_ID!);

const result = await client.writeSyncs.preview('wsyn_contacts123');

Response

json
{
  "data": {
    "id": "wsrn_abcdefghijklmnopqrstuvwx",
    "writeSyncId": "wsyn_contacts123",
    "definitionVersion": 1,
    "definitionRevisionId": "rvsn_sync123",
    "sourceOperation": {
      "runId": "oprn_contacts123",
      "revisionId": "rvsn_contacts123"
    },
    "previewComplete": false,
    "recordCount": 0,
    "page": 0,
    "pageCount": 0,
    "records": []
  }
}