Opportunities
GET https://leads.qreq.com/api/opportunities
| Parameter | Einzelheiten | Beschreibung |
|---|---|---|
| search | OptionalZeichenfolge | Search by name or description |
| account_id | OptionalGanzzahl | Filter by account ID |
| opportunity_stage_id | OptionalGanzzahl | Filter by opportunity stage ID |
| opportunity_source_id | OptionalGanzzahl | Filter by opportunity source ID |
| status | OptionalZeichenfolge | Filter by status (active/inactive) |
| assigned_to | OptionalGanzzahl | Filter by assigned user ID |
| sort_field | OptionalZeichenfolge | Field to sort by |
| sort_direction | OptionalZeichenfolge | Sort direction (asc/desc) |
| per_page | OptionalGanzzahl | Pagination limit |
curl --request GET \
--url 'https://leads.qreq.com/api/opportunities?search=Test&status=active&per_page=10' \
--header 'Authorization: Bearer {api_key}'
--url 'https://leads.qreq.com/api/opportunities?search=Test&status=active&per_page=10' \
--header 'Authorization: Bearer {api_key}'
{
"status": "success",
"message": "Opportunities retrieved successfully.",
"data": {
"current_page": 1,
"data": [
{
"id": 1,
"name": "Opportunity 1",
"description": "Description",
"amount": 5000,
"close_date": "2025-12-31",
"status": "active",
"account": {"id": 1, "name": "Account 1"},
"contact": {"id": 2, "name": "Contact 1"},
"opportunityStage": {"id": 1, "name": "Qualification"},
"opportunitySource": {"id": 1, "name": "Referral"},
"assignedUser": {"id": 3, "name": "John Doe"},
"products": []
}
],
"per_page": 10,
"total": 1
}
}
GET https://leads.qreq.com/api/opportunities/{opportunity_id}
curl --request GET \
--url 'https://leads.qreq.com/api/opportunities/{opportunity_id}' \
--header 'Authorization: Bearer {api_key}'
--url 'https://leads.qreq.com/api/opportunities/{opportunity_id}' \
--header 'Authorization: Bearer {api_key}'
{
"status": "success",
"message": "Opportunity retrieved successfully.",
"data": {
"opportunity": {
"id": 1,
"name": "Opportunity 1",
"description": "Description",
"amount": 5000,
"close_date": "2025-12-31",
"status": "active",
"account": {"id": 1, "name": "Account 1"},
"contact": {"id": 2, "name": "Contact 1"},
"opportunityStage": {"id": 1, "name": "Qualification"},
"opportunitySource": {"id": 1, "name": "Referral"},
"assignedUser": {"id": 3, "name": "John Doe"},
"products": []
},
"meetings": [],
"activities": []
}
}
POST https://leads.qreq.com/api/opportunities
| Parameter | Einzelheiten | Beschreibung |
|---|---|---|
| name | ErforderlichZeichenfolge | Opportunity name |
| description | OptionalZeichenfolge | Opportunity description |
| amount | OptionalGanzzahl | Opportunity amount |
| close_date | OptionalZeichenfolge | Close date (YYYY-MM-DD) |
| notes | OptionalZeichenfolge | Additional notes |
| account_id | ErforderlichGanzzahl | Related account ID |
| contact_id | OptionalGanzzahl | Related contact ID |
| opportunity_stage_id | ErforderlichGanzzahl | Stage ID |
| opportunity_source_id | ErforderlichGanzzahl | Source ID |
| status | OptionalZeichenfolge | Status (active/inactive) |
| assigned_to | OptionalGanzzahl | Assign to user ID |
| products | OptionalArray | Products array (product_id, quantity, unit_price) |
curl --request POST \
--url 'https://leads.qreq.com/api/opportunities' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
--data-raw '{ "name": "New Opportunity", "description": "Description here", "amount": 5000, "close_date": "2025-12-31", "account_id": 1, "contact_id": 2, "opportunity_stage_id": 1, "opportunity_source_id": 1, "status": "active", "products": [ {"product_id": 1, "quantity": 2, "unit_price": 2500} ] }'
--url 'https://leads.qreq.com/api/opportunities' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
--data-raw '{ "name": "New Opportunity", "description": "Description here", "amount": 5000, "close_date": "2025-12-31", "account_id": 1, "contact_id": 2, "opportunity_stage_id": 1, "opportunity_source_id": 1, "status": "active", "products": [ {"product_id": 1, "quantity": 2, "unit_price": 2500} ] }'
{
"status": "success",
"message": "Opportunity created successfully.",
"data": {
"id": 1,
"name": "New Opportunity",
"description": "Description here",
"amount": 5000,
"close_date": "2025-12-31",
"status": "active",
"account_id": 1,
"contact_id": 2,
"opportunity_stage_id": 1,
"opportunity_source_id": 1,
"created_by": 33,
"assigned_to": 33,
"products": []
}
}
PUT https://leads.qreq.com/api/opportunities/{opportunity_id}
curl --request PUT \
--url 'https://leads.qreq.com/api/opportunities/{opportunity_id}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
--data-raw '{ "name": "Updated Opportunity", "description": "Updated description", "amount": 6000, "close_date": "2026-01-31", "account_id": 1, "contact_id": 2, "opportunity_stage_id": 2, "opportunity_source_id": 1, "status": "active", "products": [ {"product_id": 1, "quantity": 3, "unit_price": 2000} ] }'
--url 'https://leads.qreq.com/api/opportunities/{opportunity_id}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
--data-raw '{ "name": "Updated Opportunity", "description": "Updated description", "amount": 6000, "close_date": "2026-01-31", "account_id": 1, "contact_id": 2, "opportunity_stage_id": 2, "opportunity_source_id": 1, "status": "active", "products": [ {"product_id": 1, "quantity": 3, "unit_price": 2000} ] }'
{
"status": "success",
"message": "Opportunity updated successfully.",
"data": {
"id": 1,
"name": "Updated Opportunity",
"description": "Updated description",
"amount": 6000,
"close_date": "2026-01-31",
"status": "active",
"account_id": 1,
"contact_id": 2,
"opportunity_stage_id": 2,
"opportunity_source_id": 1,
"created_by": 33,
"assigned_to": 33,
"products": []
}
}
DELETE https://leads.qreq.com/api/opportunities/{opportunity_id}
curl --request DELETE \
--url 'https://leads.qreq.com/api/opportunities/{opportunity_id}' \
--header 'Authorization: Bearer {api_key}'
--url 'https://leads.qreq.com/api/opportunities/{opportunity_id}' \
--header 'Authorization: Bearer {api_key}'
{
"status": "success",
"message": "Opportunity deleted successfully."
}
PATCH https://leads.qreq.com/api/opportunities/{opportunity_id}/toggle-status
curl --request PATCH \
--url 'https://leads.qreq.com/api/opportunities/{opportunity_id}/toggle-status' \
--header 'Authorization: Bearer {api_key}'
--url 'https://leads.qreq.com/api/opportunities/{opportunity_id}/toggle-status' \
--header 'Authorization: Bearer {api_key}'
{
"status": "success",
"message": "Opportunity status updated successfully.",
"data": {
"id": 1,
"status": "inactive"
}
}
DELETE https://leads.qreq.com/api/opportunities/{opportunity_id}/activities
curl --request DELETE \
--url 'https://leads.qreq.com/api/opportunities/{opportunity_id}/activities' \
--header 'Authorization: Bearer {api_key}'
--url 'https://leads.qreq.com/api/opportunities/{opportunity_id}/activities' \
--header 'Authorization: Bearer {api_key}'
{
"status": "success",
"message": "All activities deleted successfully."
}
DELETE https://leads.qreq.com/api/opportunities/{opportunity_id}/activities/{activity_id}
curl --request DELETE \
--url 'https://leads.qreq.com/api/opportunities/{opportunity_id}/activities/{activity_id}' \
--header 'Authorization: Bearer {api_key}'
--url 'https://leads.qreq.com/api/opportunities/{opportunity_id}/activities/{activity_id}' \
--header 'Authorization: Bearer {api_key}'
{
"status": "success",
"message": "Activity deleted successfully."
}
PATCH https://leads.qreq.com/api/opportunities/{opportunity_id}/update-status
curl --request PATCH \
--url 'https://leads.qreq.com/api/opportunities/{opportunity_id}/update-status' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
--data-raw '{ "opportunity_stage_id": 2 }'
--url 'https://leads.qreq.com/api/opportunities/{opportunity_id}/update-status' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
--data-raw '{ "opportunity_stage_id": 2 }'
{
"status": "success",
"message": "Opportunity status updated successfully.",
"data": {
"id": 1,
"opportunity_stage_id": 2
}
}