PermuteDocs
Go to Permute

Write syncs · writeSyncsCreate

Create a write sync

Creates a paused directional sync. Requires write-sync and destination write permission plus source and destination read access. Fields map destination field names to source column names. Operation input revisionId describes the configured schema; each new capture follows the current published revision. Does not send records.

POST/v1/write-syncs
betaapiKeyworkspace

When to use

Save a paused sync from a published Data Table to Quo contacts.

For agents

Publish and run the source first. Use operations.get for its published revision and sources.get for tables and fields; configuration and preview validate the published output. Map destination fields to source columns. Requires write-sync write, destination read/write and source read access. Creation sends no records.

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.create({
  "definition": {
    "source": {
      "resourceId": "oper_contacts123",
      "object": "contacts",
      "scope": ""
    },
    "destination": {
      "resourceId": "conn_quo123",
      "object": "contacts",
      "scope": ""
    },
    "input": {
      "type": "operation",
      "operationId": "oper_contacts123",
      "revisionId": "rvsn_contacts123",
      "table": "contacts"
    },
    "keyColumn": "email",
    "fields": {
      "emails": "email",
      "firstName": "first_name",
      "lastName": "last_name"
    }
  }
});

Request body

json
{
  "definition": {
    "source": {
      "resourceId": "oper_contacts123",
      "object": "contacts",
      "scope": ""
    },
    "destination": {
      "resourceId": "conn_quo123",
      "object": "contacts",
      "scope": ""
    },
    "input": {
      "type": "operation",
      "operationId": "oper_contacts123",
      "revisionId": "rvsn_contacts123",
      "table": "contacts"
    },
    "keyColumn": "email",
    "fields": {
      "emails": "email",
      "firstName": "first_name",
      "lastName": "last_name"
    }
  }
}

Response

json
{
  "data": {
    "id": "wsyn_contacts123",
    "name": "Contacts → Quo contacts",
    "definition": {
      "source": {
        "resourceId": "oper_contacts123",
        "object": "contacts",
        "scope": ""
      },
      "destination": {
        "resourceId": "conn_quo123",
        "object": "contacts",
        "scope": ""
      },
      "input": {
        "type": "operation",
        "operationId": "oper_contacts123",
        "revisionId": "rvsn_contacts123",
        "table": "contacts"
      },
      "keyColumn": "email",
      "fields": {
        "emails": "email",
        "firstName": "first_name",
        "lastName": "last_name"
      }
    },
    "version": 1,
    "isEnabled": false,
    "createdAt": "2026-09-30T12:00:00.000Z",
    "updatedAt": "2026-09-30T12:00:00.000Z"
  }
}