Update a deal
ProRead & write keyAvailable on the Pro and Enterprise plans (beta).
PATCHhttps://app.reshta.ir/api/v1/public…/public/deals/{id}
Changes only the fields you send and sends the deal.updated event to your webhooks. The response is the updated record.
Request
curl https://app.reshta.ir/api/v1/public/deals/0192c4e8-7b1a-7c3e-9f20-5d6a1b2c3d4e \ -X PATCH \ -H "Authorization: Bearer $RESHTA_API_KEY" \ -H "Idempotency-Key: 7f3c2b1e-4a5d-4c6f-9e1a-2b3c4d5e6f70" \ -H "Content-Type: application/json" \ -d '{"stage_id":"0192b002-2d3e-7f40-9b5c-6d7e8f9a0b1c"}'Headers
AuthorizationstringrequiredBearer followed by the business API key (rk_live_…).
Idempotency-KeystringrequiredA unique ID for this operation, such as a fresh UUID; retrying with the same key does nothing twice.
Content-Typeapplication/jsonrequiredThe body is UTF-8 JSON.
Path parameters
idstringrequiredThe record ID (UUID).
Body parameters
titlestringoptionalDeal title.
from_titlestringoptionalThe value you expect now; the update is refused if it changed.
from_owner_iduuid | nulloptionalThe value you expect now; the update is refused if it changed.
from_expected_close_datestring | nulloptionalThe value you expect now; the update is refused if it changed.
from_value_amountintegeroptionalThe value you expect now; the update is refused if it changed.
pipeline_iduuidoptionalOnly deals in this pipeline.
stage_iduuidoptionalOnly deals in this stage.
statusstringoptionalopen, won or lost.values:openwonlost
won_atstringoptionalWhen it was won, ISO 8601.
lost_atstringoptionalWhen it was lost, ISO 8601.
value_amountintegeroptionalAmount, an integer in rials.
currencystringoptionalCurrency, such as IRR.
expected_close_datestring | nulloptionalExpected close date, YYYY-MM-DD.
owner_iduuid | nulloptionalOnly records owned by this teammate.
company_iduuid | nulloptionalThe company this record belongs to.
contact_iduuid | nulloptionalThe related contact.
lost_reason_iduuid | nulloptionalThe lost reason.
customobjectoptionalCustom fields, keyed by field key.
Responses and errors
200—Done; the body is the record.
400validation_errorInvalid body, or no Idempotency-Key; details names the field.
401unauthorizedThe key is missing, wrong or revoked, or its creator is no longer active.
403forbiddenThe key has no write access.
404not_foundNo such record in this business.
409conflictThis Idempotency-Key came with another body, or is still in progress.
429rate_limitedOver 120 requests per minute; Retry-After says how many seconds to wait.
Response
400
{ "error": { "code": "validation_error", "message": "Idempotency-Key header is required", "details": [ { "field": "idempotency_key", "message": "idempotency_key_required" } ] }}Related webhook: deal.updated