Sidelatch Docs
Docs menu

View as Markdown

Writes

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 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{
  "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, kept for your session only.