Skip to content

Deals

Deals represent sales opportunities moving through your pipeline. Assign deals to workflows and stages, track value and currency, map buying-committee contact roles, and forecast revenue.

FieldTypeDescription
iduuidUnique identifier for the lost reason
account_iduuidID of the account that owns the lost reason
labelstringDisplay label for the reason, e.g. Price or Chose a competitor; account-customizable. Closing a deal as lost stores this text in the deal’s closed_reason
display_orderintOrdering position of the reason relative to other reasons
created_atdatetimeISO 8601 timestamp when the reason was created

Endpoint: deal-lost-reasons-create

Appends a reason to the end of the account’s list.

FieldTypeRequiredDescription
labelstringYesDisplay label for the reason, e.g. Price or Chose a competitor
Terminal window
curl -X POST https://api.driftwoodapp.com/api/deal-lost-reasons-create \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"label": "..."}'

Endpoint: deal-lost-reasons-delete

FieldTypeRequiredDescription
idstringYesID of the lost reason to remove. Fails with deal_lost_reasons.in_use while any deal was lost for it
Terminal window
curl -X POST https://api.driftwoodapp.com/api/deal-lost-reasons-delete \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"id": "..."}'

Endpoint: deal-lost-reasons-list

Returns the account’s lost reasons in display order. Clients offer these when a deal moves to a lost stage and send the chosen reason’s ID as lost_reason_id on deals-update. For a reason not in the list, send closed_reason text instead.

Endpoint: deal-lost-reasons-reorder

FieldTypeRequiredDescription
idsstring[]YesLost reason IDs in their new display order
Terminal window
curl -X POST https://api.driftwoodapp.com/api/deal-lost-reasons-reorder \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"ids": []}'

Endpoint: deal-lost-reasons-update

FieldTypeRequiredDescription
idstringYesID of the lost reason to rename
labelstringYesNew label. Deals lost for this reason show the new label
Terminal window
curl -X POST https://api.driftwoodapp.com/api/deal-lost-reasons-update \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"id": "...", "label": "..."}'

Endpoint: deals-calendar

Endpoint: deals-close

Deprecated: use deals-update with a won or lost stage_id (and optionally closed_reason), which closes the deal the same way. This operation is kept for existing clients and behaves identically, except that it requires a reason.

FieldTypeRequiredDescription
idstringNoID of the deal to close
stage_idstringNoID of the won or lost stage to move the deal into
reasonstringNoReason for closing the deal
Terminal window
curl -X POST https://api.driftwoodapp.com/api/deals-close \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'

Endpoint: deals-contacts-add

Endpoint: deals-contacts-list

Endpoint: deals-contacts-remove

Endpoint: deals-create

FieldTypeRequiredDescription
namestringYesName of the deal
descriptionstringNoFree-form description of the deal
stage_idstring?NoID of the workflow stage to place the deal in; defaults to the workflow’s default stage when omitted. A won or lost stage creates the deal closed (closed_at set, probability 100 or 0)
closed_reasonstring?NoReason typed in by hand for a won or lost deal (e.g. Other); saved only when stage_id is a won or lost stage. For a listed lost reason send lost_reason_id instead
lost_reason_idstring?NoID of one of the account’s lost reasons (deal-lost-reasons-list); saved only when the deal ends up in a lost stage. Takes the place of closed_reason
workflow_idstring?NoID of the deal workflow to use; defaults to the account’s default workflow when omitted
company_idstring?NoID of the company to associate with the deal
assigned_tostring?NoID of the user to assign the deal to
valueint?NoMonetary value of the deal in integer minor units (cents) of the currency
probabilityint?NoWin probability as an integer percentage from 0 to 100; values outside the range are clamped. Defaults to the stage’s default probability when omitted
expected_close_datestring?NoExpected close date as an ISO 8601 date (YYYY-MM-DD)
currencystring?NoISO 4217 currency code for the deal value; defaults to the account’s default currency when a value is set and this is omitted One of: USD, EUR, GBP, JPY, CAD, AUD, CHF, CNY, SEK, NOK, DKK, NZD, SGD, HKD, KRW, MXN, BRL, INR, ZAR, TRY, PLN, CZK, HUF, ILS, THB, MYR, PHP, IDR, RON, BGN, ISK
timezonestring?NoIANA timezone name used for interpreting the deal’s dates
notesstringNoFree-form notes about the deal
tagsstring[]NoList of tag labels to apply to the deal
custom_fieldsobject?NoCustom field values keyed by field definition, validated against the account’s deal custom field definitions
Terminal window
curl -X POST https://api.driftwoodapp.com/api/deals-create \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "..."}'

Endpoint: deals-delete

Get a monthly forecast: open deals by expected close month, deals won by month, and overdue deals

Section titled “Get a monthly forecast: open deals by expected close month, deals won by month, and overdue deals”

Endpoint: deals-forecast

FieldTypeRequiredDescription
monthsintNoNumber of months to forecast forward, counting the current month, from 1 to 24; defaults to 12 and is clamped to 24
past_monthsintNoNumber of earlier months to include, so won totals can be compared with the forecast; from 0 to 12, defaults to 0
workflow_idstring?NoOnly count deals in this deal workflow; all workflows when omitted
assigned_tostring?NoOnly count deals assigned to this user; everyone when omitted
Terminal window
curl -X POST https://api.driftwoodapp.com/api/deals-forecast \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'

Endpoint: deals-get

Get deal pipeline insights with summary, win rate, and breakdowns

Section titled “Get deal pipeline insights with summary, win rate, and breakdowns”

Endpoint: deals-insights

FieldTypeRequiredDescription
start_datestringYesStart of the reporting period as an ISO 8601 date (YYYY-MM-DD)
end_datestringYesEnd of the reporting period as an ISO 8601 date (YYYY-MM-DD), inclusive
compare_start_datestringNoStart of an optional comparison period as an ISO 8601 date (YYYY-MM-DD); supply with compare_end_date to include comparison metrics
compare_end_datestringNoEnd of an optional comparison period as an ISO 8601 date (YYYY-MM-DD), inclusive
Terminal window
curl -X POST https://api.driftwoodapp.com/api/deals-insights \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"start_date": "...", "end_date": "..."}'

Endpoint: deals-list

FieldTypeRequiredDescription
searchstringNoText to match against deal name and related fields
tagsstring[]NoFilter to deals having all of these tag labels
stage_idstring?NoFilter to deals in this workflow stage
company_idstring?NoFilter to deals associated with this company
assigned_tostring?NoFilter to deals assigned to this user
is_closedbool?NoFilter by closed state; true returns closed deals, false returns open deals, omit for all
cursorstringNoOpaque pagination cursor returned by a previous list response
limitintNoMaximum number of deals to return in the page
Terminal window
curl -X POST https://api.driftwoodapp.com/api/deals-list \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'

Get pipeline value and deal counts broken down by stage

Section titled “Get pipeline value and deal counts broken down by stage”

Endpoint: deals-pipeline-stats

FieldTypeRequiredDescription
workflow_idstring?NoID of the workflow to compute pipeline stats for; defaults to the account’s default workflow when omitted
Terminal window
curl -X POST https://api.driftwoodapp.com/api/deals-pipeline-stats \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'

Endpoint: deals-reopen

Deprecated: use deals-update with an open stage_id, which reopens the deal the same way (clears closed_at and closed_reason, resets probability to the stage default). Kept for existing clients.

Endpoint: deals-update

FieldTypeRequiredDescription
idstringNoID of the deal to update
workflow_idstring?NoID of the workflow to move the deal to; when changed without a stage_id the deal moves to the new workflow’s default stage
namestring?NoNew name for the deal
descriptionstring?NoNew description for the deal
stage_idstring?NoID of the workflow stage to move the deal to. Moving into a won or lost stage closes the deal: closed_at is set and probability becomes 100 (won) or 0 (lost). Moving into an open stage reopens it: closed_at and closed_reason are cleared and probability resets to the stage default
closed_reasonstring?NoReason typed in by hand for a won or lost deal (e.g. Other); saved only when the deal ends up in a won or lost stage, ignored otherwise. Clears lost_reason_id
lost_reason_idstring?NoID of one of the account’s lost reasons (deal-lost-reasons-list); saved only when the deal ends up in a lost stage. Takes the place of closed_reason
company_idstring?NoID of the company to associate; pass an empty string to clear the association
assigned_tostring?NoID of the user to assign; pass an empty string to clear the assignment
valueint?NoMonetary value of the deal in integer minor units (cents) of the currency
probabilityint?NoWin probability as an integer percentage from 0 to 100; values outside the range are clamped
expected_close_datestring?NoExpected close date as an ISO 8601 date (YYYY-MM-DD)
currencystring?NoISO 4217 currency code for the deal value One of: USD, EUR, GBP, JPY, CAD, AUD, CHF, CNY, SEK, NOK, DKK, NZD, SGD, HKD, KRW, MXN, BRL, INR, ZAR, TRY, PLN, CZK, HUF, ILS, THB, MYR, PHP, IDR, RON, BGN, ISK
timezonestring?NoIANA timezone name used for interpreting the deal’s dates
notesstring?NoNew notes for the deal
tagsstring[]NoReplacement list of tag labels for the deal
custom_fieldsobject?NoCustom field values to merge, validated against the account’s deal custom field definitions
Terminal window
curl -X POST https://api.driftwoodapp.com/api/deals-update \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'
CodeDescription
deal_lost_reasons.label_requiredLabel required
deal_lost_reasons.label_too_longLabel too long
deal_lost_reasons.duplicateDuplicate
deal_lost_reasons.invalid_idInvalid id
deal_lost_reasons.not_foundNot found
deal_lost_reasons.in_useIn use
deals.invalid_idInvalid id
deals.invalid_stage_idInvalid stage id
deals.invalid_stageInvalid stage
deals.stage_not_closedStage not closed
deals.reason_requiredReason required
deals.not_foundNot found
deals.name_requiredName required
deals.invalid_workflow_idInvalid workflow id
deals.invalid_company_idInvalid company id
deals.invalid_assigned_toInvalid assigned to
deals.invalid_custom_fieldsInvalid custom fields
deals.dates_requiredDates required
deals.invalid_start_dateInvalid start date
deals.invalid_end_dateInvalid end date
deals.invalid_compare_start_dateInvalid compare start date
deals.invalid_compare_end_dateInvalid compare end date
deals.stage_not_openStage not open