Create an opportunity

View as Markdown
**status_id** (optional): Post a `status_id` to create an opportunity with a specific status. If omitted, the organization's default (first) status will be used. See the [Opportunity Status API](/resources/opportunity-statuses/). **lead_id** (optional): Opportunities belong to exactly one Lead. If you do not provide a `lead_id` then a new lead will be created (appearing as "Untitled" in the UI). **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.: ```json { "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](/resources/custom-fields/) for more details.

Authentication

AuthorizationBasic

Basic authentication of the form Basic <base64(username:)>.

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
custom_fieldsmap from strings to any or nullOptional
date_createddatetime or nullOptional
date_wondatetime or nullOptional
lead_idstring or nullOptional
notestring or nullOptional
status_idstring or nullOptional
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
organization_idstring
status_idstring
updated_bystring or null
user_idstring
valueinteger or null
value_periodenum
Allowed values:
attachmentslist of objects
comment_summaryobject or null
contact_namestring or null
created_by_namestring or null
is_stalledboolean
lead_namestring or null
lead_primary_emailobject or null
lead_primary_phonelist of objects or null
pipeline_idstring or null
pipeline_namestring or null
stall_statusobject or null
status_display_namestring
status_labelstring
status_typeenum
Allowed values:
suggested_actionobject or null
updated_by_namestring or null
user_namestring or null
value_currencystring or null
value_formattedstring or null

Errors

400
Bad Request Error
401
Unauthorized Error
404
Not Found Error