---
title: "Set Connection Write Policy"
method: PUT
path: "/v1/graphs/{graph_id}/connections/{connection_id}/write-policy"
tags: ["Connections"]
---

# Set Connection Write Policy

`PUT /v1/graphs/{graph_id}/connections/{connection_id}/write-policy`

## Request

- Base URL: `https://api.robosystems.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.robosystems.ai/v1/graphs/{graph_id}/connections/{connection_id}/write-policy`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

Choose how a live connection and RoboSystems share the books. 'qb_authoritative', the default, makes QuickBooks the book of record: RoboSystems-originated entries (manual JEs, schedule drafts) publish to QuickBooks when executed or at close. 'shadow' keeps QuickBooks the book of record and writes nothing to it: the close posts nothing locally either, its drafts become shadowed expectations compared with what QuickBooks holds, and its gates are recorded as findings. 'native' is not a choice here: it is what disconnecting or severing leaves, books kept in RoboSystems with no connection to write to. This is the explicit operator opt-in for writing to your books of record.

## Path parameters

- `graph_id` string, required
- `connection_id` string, required: Unique connection identifier

## Request body

- SetWritePolicyRequest: Request to set a connection's source-of-truth write policy. The explicit operator opt-in for outbound write-back. `hybrid` is omitted until its code path ships.
  - `write_policy` 'qb_authoritative' | 'shadow', required: 'qb_authoritative' = QuickBooks authoritative, entries publish to QB; 'shadow' = QuickBooks authoritative and RoboSystems only observes: nothing is written to QuickBooks, the close posts nothing locally, its drafts become shadowed expectations and its gates are findings. 'native', books kept in RoboSystems with no write-back, is what disconnecting or severing leaves, not a choice for a live connection.

## Response `200`

Successful Response

- ConnectionResponse: Connection response model.
  - `connection_id` string, required: Unique connection identifier
  - `provider` string, required: Connection provider type
  - `entity_id` string, nullable: Entity identifier
  - `status` string, required: Connection status
  - `created_at` union, required: Creation timestamp
    - string, date-time
    - string
  - `updated_at` union: Last update timestamp
    - string, date-time
    - string
  - `last_sync` union: Last sync timestamp
    - string, date-time
    - string
  - `write_policy` string, nullable: Source-of-truth write policy: 'native' (RoboSystems is authoritative; no outbound write-back) or 'qb_authoritative' (QuickBooks is authoritative; RoboSystems-originated entries publish to QB). Set via the write-policy endpoint.
  - `source_name` string, nullable: External-provider registered source slug — the value the integration stamps on the events it emits. Null for platform providers.
  - `metadata` object, required: Provider-specific metadata

## Other responses

- `400`: Invalid request
- `401`: Authentication required
- `403`: Access denied
- `404`: Resource not found
- `422`: Validation Error
- `429`: Rate limit exceeded
- `500`: Internal server error

---

[API](https://skmtc.dev/robosystems/apis/robosystems-api.md) · [All operations](https://skmtc.dev/robosystems/apis/robosystems-api/llms.txt) · [OpenAPI document](https://skmtc.dev/robosystems/apis/robosystems-api/revisions/e661e2d5ca6a?raw)
