Create a New Opportunities
Contents
Create Contact Opportunity
Base URL
https://apimobile.callproof.com
Endpoint
/api/contacts/{id}/opportunities
Purpose
Creates a new sales opportunity for a specific contact. The request can include opportunity name, stage, type, owner, value, probability, closing date, notes, linked accounts, linked people, and custom field data. On success, the opportunity is saved for the contact and related activity is recorded.
HTTP Method
POST
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | Bearer access token |
Security
- Yes – Requires Bearer Token authentication.
Parameters
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | integer | Yes | Unique identifier of the contact for which the opportunity is created |
Query Parameters
None.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| opportunity_stage_id | string / integer | Yes | Opportunity stage identifier. Must exist in the company’s opportunity stages |
| opportunity_type_id | string / integer | Yes | Opportunity type identifier. Must exist in the company’s opportunity types |
| owner_id | string / integer | Yes | User identifier of the opportunity owner. Must exist as a valid user |
| form_data | string | Yes | Custom field values for the opportunity, typically provided as a JSON string |
| opportunity_name | string | No | Name of the opportunity |
| linked_accounts | string | No | JSON array of related account / contact IDs to link to the opportunity. The primary contact ID is included automatically if omitted |
| linked_contacts | string | No | JSON array of people / personnel IDs to link to the opportunity |
| value | number | No | Opportunity value / amount. If provided below 1, it is treated as 1. Validated with a minimum of 1 and maximum of 9 |
| probability | string / number | No | Win probability percentage (0–100) |
| close_date | string | No | Expected closing date. Must be a valid date when provided |
| notes | string | No | Notes associated with the opportunity |
cURL Example for Android
curl --location --request POST 'https://apimobile.callproof.com/api/contacts/{id}/opportunities' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--form 'opportunity_stage_id=1' \
--form 'opportunity_type_id=1' \
--form 'owner_id=1' \
--form 'form_data={}'
cURL Example for iOS
curl --location --request POST 'https://apimobile.callproof.com/api/contacts/{id}/opportunities' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--form 'opportunity_stage_id=1' \
--form 'opportunity_type_id=1' \
--form 'owner_id=1' \
--form 'form_data={}'
Successful Response (200)
Indicates that the opportunity was created successfully for the specified contact.
| Field | Type | Description |
|---|---|---|
| clientStatusCode | integer | Status indicator for the client (for example, 200) |
| user_id | integer | Identifier of the authenticated user |
| company_id | integer | Identifier of the authenticated user’s company |
| message | string | Confirmation message (for example, "The new opportunity was successfully added.") |
| uri | string | Requested resource URI |
Error Responses
| Status Code | Meaning |
|---|---|
| 200 | Validation failure – request body failed validation (returned with an error payload and clientStatusCode 401)
|
| 400 | Bad Request – the opportunity could not be created (for example, contact not found or processing error) |
| 401 | Unauthorized – missing, invalid, or expired Bearer token |
- 200 (validation failure) – Required fields are missing or invalid (for example, missing stage, type, owner, or form data; invalid close date; probability outside 0–100; or invalid value).
- 400 – The contact was not found, custom field processing failed, or another error occurred while creating the opportunity.
- 401 – Authentication failed or the access token is missing/expired.