---
title: "Update a deal"
method: PATCH
path: "/api/v1/rest/crm/deals/{id}"
tags: ["CRM"]
---

# Update a deal

`PATCH /api/v1/rest/crm/deals/{id}`

## Request

- Base URL: `https://api.custodo.ai`
- URL: `https://api.custodo.ai/api/v1/rest/crm/deals/{id}`
- Auth: HTTP bearer

Corrects what a trattativa says: its title, customer, contact, figure, currency, probability, forecast date, owner or source. It CANNOT move a stage and cannot close the deal — both write the funnel’s append-only stage history, and both belong to crm_advance_deal. Name at least one field. On a WON or LOST deal the figures the reports count — amount, currency, probability and expected_close_date — are locked and a change to them is refused: reopen it with crm_reopen_deal first; its title, customer, contact, owner and source stay editable. Editing a figure is bookkeeping rather than contact with the customer, so this never resets a deal’s idle clock; and pushing `expected_close_date` later is recorded as a slip, so never resend the same values just to «touch» a deal.

## Path parameters

- `id` string, uuid, required

## Headers

- `X-Tenant-Id` string, uuid

## Request body

- object
  - `title` string: Rename it.
  - `party_id` string, uuid: Re-point it at another customer, from anagrafiche_search_parties.
  - `contact_id` string, uuid, nullable: The person at that customer — an anagrafica of kind `person`, from anagrafiche_search_parties.
  - `amount` number: The expected value, in the deal’s own currency.
  - `currency` string: ISO-4217, three uppercase letters — EUR, USD, CHF.
  - `probability` number: 0–100, never 0–1. A stage move does not overwrite a figure typed here.
  - `expected_close_date` string, nullable: A calendar day, YYYY-MM-DD. Call custodo_whoami if you are unsure of today’s date.
  - `owner_user_id` string, uuid: Hand it to another colleague.
  - `source` string, nullable: Where it came from — «sito», «passaparola», «fiera». Free text.

## Response `200`

Done. `data` is the tool’s own answer.

- RestResult
  - `ok` true, required
  - `data` unknown, required

## Other responses

- `400`: The arguments did not validate: `error.message` names the field, what it expects and what arrived.
- `401`: No API key, or one that is malformed, unknown, revoked or expired.
- `403`: The call never ran: the module is off for this organisation, the credential lacks the permission or the module, the tier does not cover it, or the tool is destructive and the key was not minted for that.
- `404`: Nothing with that id in this organisation.
- `409`: The record is in a state that does not allow it — under legal hold, already sent, already closed. `error.code` says which.
- `422`: The tool ran and refused, in a sentence of its own (`TOOL_REFUSED`): the message says what to change. Retrying the same call will not help.
- `429`: The API key has spent its minute, or its day. Every request a key makes counts. See `Retry-After`.

---

[API](https://skmtc.dev/custodo/apis/custodo-integrazioni.md) · [All operations](https://skmtc.dev/custodo/apis/custodo-integrazioni/llms.txt) · [OpenAPI document](https://skmtc.dev/custodo/apis/custodo-integrazioni/revisions/16d336d3ec2a?raw)
