# engagements.save

Save a useful incomplete engagement draft, proposed agreement or review version using stable existing party/contact/project/billing-group IDs and expectedRevision (0 for new). terms is the complete replacement; retrieve first and preserve unrelated fields. Unknown terms stay null or unresolved. Billing, IP ownership and approval are independent: clarify ambiguous split requests before writing. Optional phases are not approved scope. Cannot edit executed terms, send, sign, invoice or pay.

`POST /api/v1/accounting/engagements.save`

Permissions: `accounting:read`, `accounting:write` · Roles: admin, finance · Idempotency key required · Send `expectedRevision`

MCP tool: `accounting_engagements_save`

## Fields

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `id` | string (ID) |  | The record's ID. |
| `projectId` | string (ID) | Yes | The ID of the related record. |
| `name` | string | Yes | A display name. 1–200 characters. |
| `status` | enum | Yes | Only include records with this status. One of: `draft`, `proposed`, `review`. |
| `terms` | object | Yes | No other fields. |
| `terms.parties` | array of objects | Yes | at most 51 items. |
| `terms.parties[].entityId` | "workspace" or string (ID) | Yes | One of: `workspace`. |
| `terms.parties[].contracting` | boolean | Yes |  |
| `terms.parties[].billing` | boolean | Yes |  |
| `terms.parties[].ipBeneficiary` | boolean | Yes |  |
| `terms.parties[].signatoryContactId` | string or null | Yes |  |
| `terms.parties[].signatoryName` | string or null | Yes |  |
| `terms.parties[].signatoryTitle` | string or null | Yes |  |
| `terms.scope` | string | Yes | at most 4000 characters. |
| `terms.phases` | array of objects | Yes | at most 50 items. |
| `terms.phases[].id` | string (ID) | Yes | The record's ID. |
| `terms.phases[].name` | string | Yes | A display name. 1–200 characters. |
| `terms.phases[].scope` | string | Yes | at most 4000 characters. |
| `terms.phases[].coverage` | enum | Yes | One of: `included`, `optional`, `excluded`. |
| `terms.approvals` | object | Yes | No other fields. |
| `terms.approvals.deliverables` | object | Yes | No other fields. |
| `terms.approvals.deliverables.mode` | enum | Yes | One of: `unresolved`, `all`, `primary`. |
| `terms.approvals.deliverables.entityIds` | array of "workspace" or string (ID) | Yes | A list of record IDs. at most 51 items. |
| `terms.approvals.scopeChanges` | object | Yes | No other fields. |
| `terms.approvals.scopeChanges.mode` | enum | Yes | One of: `unresolved`, `all`, `primary`. |
| `terms.approvals.scopeChanges.entityIds` | array of "workspace" or string (ID) | Yes | A list of record IDs. at most 51 items. |
| `terms.ip` | object | Yes | No other fields. |
| `terms.ip.basis` | enum | Yes | One of: `unresolved`, `joint`, `allocated`, `sole`, `custom`. |
| `terms.ip.allocations` | array of objects | Yes | at most 51 items. |
| `terms.ip.allocations[].entityId` | "workspace" or string (ID) | Yes | One of: `workspace`. |
| `terms.ip.allocations[].percent` | number or null | Yes |  |
| `terms.ip.customDeliverables` | string or null | Yes |  |
| `terms.ip.preExistingTools` | string or null | Yes |  |
| `terms.ip.thirdPartyComponents` | string or null | Yes |  |
| `terms.billingGroupIds` | array of strings (ID) | Yes | A list of record IDs. at most 50 items. |
| `terms.envelopeId` | string (ID) or null | Yes | The ID of a document sent for signature, from signing.envelopes.list. |
| `terms.unresolved` | array of objects | Yes | at most 100 items. |
| `terms.unresolved[].id` | string (ID) | Yes | The record's ID. |
| `terms.unresolved[].question` | string | Yes | 1–500 characters. |
| `terms.unresolved[].ownerEntityId` | "workspace" or string (ID) or null | Yes |  |
| `expectedRevision` | integer | Yes | The record's current revision, from the last time you read it. If someone changed the record since, the request is refused with a conflict so you can reload and check before trying again. 0 to 9007199254740991. |
| `idempotencyKey` | string | Yes | Any unique text you generate once per intended change, so a retried request only happens once. Send it as the Idempotency-Key header instead if you prefer; if you send both they must match. 8–200 characters. |

## Example request

```bash
curl https://app.getoatmilk.com/api/v1/accounting/engagements.save \
  -H "Authorization: Bearer $OATMILK_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "projectId": "4d5e6f7a-8b9c-4d0e-8f1a-2b3c4d5e6f7a",
  "name": "Synthetic Ventures Inc.",
  "status": "draft",
  "terms": {
    "parties": [
      {
        "entityId": "workspace",
        "contracting": true,
        "billing": true,
        "ipBeneficiary": true,
        "signatoryContactId": "example",
        "signatoryName": "Synthetic Ventures Inc.",
        "signatoryTitle": "Synthetic services agreement"
      }
    ],
    "scope": "example",
    "phases": [
      {
        "id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
        "name": "Synthetic Ventures Inc.",
        "scope": "example",
        "coverage": "included"
      }
    ],
    "approvals": {
      "deliverables": {
        "mode": "all",
        "entityIds": [
          "workspace"
        ]
      },
      "scopeChanges": {
        "mode": "all",
        "entityIds": [
          "workspace"
        ]
      }
    },
    "ip": {
      "basis": "allocated",
      "allocations": [
        {
          "entityId": "workspace",
          "percent": 1
        }
      ],
      "customDeliverables": "example",
      "preExistingTools": "example",
      "thirdPartyComponents": "example"
    },
    "billingGroupIds": [
      "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d"
    ],
    "envelopeId": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
    "unresolved": [
      {
        "id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
        "question": "example",
        "ownerEntityId": "workspace"
      }
    ]
  },
  "expectedRevision": 3
}'
```

Reference page: https://app.getoatmilk.com/docs/api/engagements.save
