Skip to navigation

Create an opportunity

View as Markdown

Create an opportunity, optionally linked to an existing lead.

custom.FIELD_ID (optional): Set custom fields by setting custom.FIELD_ID to the field value, where FIELD_ID is the ID of the custom field, e.g.:

{ "custom.cf_v6S011I6MqcbVvB2FA5Nk8dr5MkL8sWuCiG8cUleO9c": "value", "custom.cf_8wtBWsdRU2Fur7GDnEeXQ7ra2Vu7R4hG1SNYdiEhh0F": "other value" }

If a custom field has accepts_multiple_values: true, the entire value will be replaced. For example, given an Opportunity has a Custom Choice Field with value ["A", "B"], adding choice "C" would mean setting the value to ["A", "B", "C"].

Note that using the custom field dict or the custom.FIELD_NAME syntax (instead of custom field IDs) is deprecated and will be removed from the API. See Custom Fields for more details.

Authentication

AuthorizationBasic
Use your API key as the username and leave the password empty.
OR
AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
attachmentslist of objects or nullOptional
confidenceinteger or nullOptional
contact_idstring or nullOptional
created_bystring or nullOptional
date_createddatetime or nullOptional
date_wondatetime or nullOptional

If not set on the resource or in the request, date_won will be set automatically to today's date when setting status_id to a status with type won. The x-tz-offset header, used to pass your timezone's UTC offset, will be taken into account.

lead_idstring or nullOptional

Opportunities belong to exactly one Lead. If not provided, a new lead will be created (appearing as "Untitled" in the UI).

notestring or nullOptional

Plaintext/markdown version of the note. If note_html is also provided in the same request, this value is ignored and note is derived from the HTML instead.

note_htmlstring or nullOptional

Rich-text HTML version of the note. When set, note is automatically populated with the plaintext version (tags become markdown), overriding any note value passed in the same request.

pipeline_idstring or nullOptional

Specify which pipeline this opportunity should belong to. When supplied without status_id, the opportunity will be created with the first available status of that pipeline. When supplied with status_id, the status must belong to the specified pipeline or a 400 error will be returned. If the pipeline does not exist, a 400 error will be returned. See the Pipelines API.

status_idstring or nullOptional

Post a status_id to create an opportunity with a specific status. If omitted, the organization's default (first) status will be used (or the first status of the pipeline_id if provided). See the Opportunity Status API.

user_idstring or nullOptional
valueinteger or nullOptional
value_periodenum or nullOptional
Allowed values:

Response

Successful response
annualized_expected_valueinteger or null
annualized_valueinteger or null
confidenceinteger
contact_idstring or null
created_bystring or null
date_createddatetime
date_lostdatetime or null
date_updateddatetime
date_wondate or null
expected_valueinteger or null
idstring
lead_idstring
notestring or null
note_htmlstring or null
organization_idstring
status_idstring
updated_bystring or null
user_idstring
valueinteger or null
value_periodenum
Allowed values:
attachmentslist of objectsOptional
comment_summaryobject or nullOptional
contact_namestring or nullOptional
created_by_namestring or nullOptional
is_stalledbooleanOptional
lead_namestring or nullOptional
lead_primary_emailobject or nullOptional
lead_primary_phonelist of objects or nullOptional
pipeline_idstring or nullOptional
pipeline_namestring or nullOptional
stall_statusobject or nullOptional
status_display_namestringOptional
status_labelstringOptional
status_typeenumOptional
Allowed values:
suggested_actionobject or nullOptional
updated_by_namestring or nullOptional
user_namestring or nullOptional
value_currencystring or nullOptional
value_formattedstring or nullOptional

Errors

400
Bad Request Error
401
Unauthorized Error
404
Not Found Error