Assert / Upsert

Assert Deal

Create or update a deal. Matches by name + company_id.

Deliberately NOT wired into the closed-stage gates or the completeness rule: assert is the sync-shaped surface (external systems pushing state, no human to answer a 400), the same category the internal router excludes for POST /v1/deals/webhook/sync and the CRM pull worker (#15530 "Out of scope"). Only input hygiene applies here: ids must exist and close_date must parse.

#16060: a stage move made here now emits deal.stage_changed and writes cb_deal_stage_history, like every other stage writer. background_tasks is injected (not a body field, so the request schema is unchanged) and the publish is queued only after the session context has exited — a rolled-back assert publishes nothing. Because assert is the sync-shaped surface, the SAME stage arrives on every tick of the caller's poll loop: the event fires only on an actual transition, never on a re-assert of the current stage.

put/deals/assert

Request

  • Base URL: https://be.graph8.com/api/v1
  • URL: https://be.graph8.com/api/v1/deals/assert
  • Auth: HTTP bearer

Headers

Authorizationstring nullable
X-Target-Org-Idstring nullable

Request body

namestring required

Deal name (match key)

company_idstring nullable

Company ID (match key, combined with name)

amountnumber nullable
currencystring nullable
stage_idstring nullable
pipeline_idstring nullable
descriptionstring nullable
close_datestring nullable

Response

Successful Response

Changes

No recorded changes to this operation across all 2 revisions of this API.