# Writes

> Change data in a portal: submit forms, report claims, request certificates and policy changes, safely.

Any portal can take writes: operations that change data in the user's account, such as submitting a form, reporting a claim, asking for a certificate or a policy change. Built-in connectors list theirs in `GET /v1/portals` (`"writes": true` on the operation); a portal you [build](https://sidelatch.com/docs/guides/build-a-portal) keeps what you submit while recording when you start the build with `"writes": true`. Writes run through the same `/run` call as reads, with stricter rules.

### The rules

- **A `read_write` key.** A `read` key gets `read_only_key`.
- **The user agreed.** The connect window tells the user whether you may make changes in their account. Mint the link token with `"writes": false` for a read-only connection: the window says you can only read, and writes on it answer `connection_read_only`. `GET /v1/connections` shows `writes` per connection, and the consent record keeps what the user was shown.
- **Never twice.** A write is never cached and never retried for you. Send an `Idempotency-Key` header: a retry with the same key and request gets the first answer back (`Idempotent-Replayed: true`). The key is claimed before anything is sent, so a retry that arrives while the first is still running, or after a failure that left the outcome unknown, gets `idempotency_in_progress` instead of a second write. Read the portal to see whether it happened.
- **Dry runs.** `"dry_run": true` checks the key, the connection and the params and sends nothing. Use it to build against live connections.
- **Async.** `"async": true` works for writes too, and the `Idempotency-Key` then replays the same `run_id`.
- **Agents.** On MCP, write tools carry `destructiveHint` and appear only to a `read_write` key or a link minted with `allow_writes`.

**POST /v1/connections/{id}/run  (Idempotency-Key: coi-7731)**

```
{
  "operation": "request_certificate",
  "dry_run": false,
  "params": {
    "policy_number": "GL-220918",
    "holder_name": "Lakeview Property Mgmt",
    "holder_street": "400 Shore Dr",
    "holder_city": "Austin",
    "holder_state": "TX",
    "holder_postal_code": "78701"
  }
}
```

**Response**

```json
{
  "data": {
    "certificate_id": "COI-004417",
    "policy_number": "GL-220918",
    "carrier": "Demo Carrier",
    "holder_name": "Lakeview Property Mgmt",
    "status": "issued",
    "issued_date": "2026-11-27",
    "additional_insured": false,
    "waiver_of_subrogation": false
  },
  "retrieved_at": "2026-11-27T15:04:05+00:00",
  "run_id": "run_5d1e..."
}
```

Try them in the sandbox: Demo Carrier and Demo Mutual take every [carrier write](https://sidelatch.com/docs/api#insurance-writes), kept for your session only.

---

Sidelatch docs: [Docs](https://sidelatch.com/docs.md) · [Quick start](https://sidelatch.com/docs/quickstart.md) · [Concepts](https://sidelatch.com/docs/concepts.md) · [The connect window](https://sidelatch.com/docs/guides/connect-window.md) · [Webhooks](https://sidelatch.com/docs/guides/webhooks.md) · [MCP for AI agents](https://sidelatch.com/docs/guides/mcp.md) · [Writes](https://sidelatch.com/docs/guides/writes.md) · [Build a portal](https://sidelatch.com/docs/guides/build-a-portal.md) · [Events](https://sidelatch.com/docs/events.md) · [Errors](https://sidelatch.com/docs/errors.md) · [API reference](https://sidelatch.com/docs/api.md)
