latestOpenAPI 3.1.02026-08-21468220497.9 KB

292f0c9a098f

prospecting

Create Deal Link

Attach a proposal / invoice / booking to a deal.

Promotes a fallback-matched ref to an explicit entity_links row, or swaps in a different target. The kanban resolver picks the most-recent linked entity, so creating a new link with the user's chosen target automatically wins over older links of the same type. Removing stale links is a separate DELETE endpoint.

Delegates to services.deal_link_service.link_deal_item — the same use case the chat agent's link_deal_item tool calls, so org-scoping, idempotency, the archived-deal refusal, and deal.item_linked emission live in exactly one place.

post/api/prospecting/deals/{deal_id}/links

Query parameters

user_idstring nullable
org_idstring nullable

Request body

link_typestring required

proposal | invoice | booking

target_idstring required

Target entity id (proposal/invoice/booking row).

titlestring nullable

Response

Successful Response

{"stackTrail":"paths:/api/prospecting/deals/{deal_id}/links:post:responses:200:content:application/json:schema","oasType":"schema","type":"unknown"}