API3
scottb at August 23rd, 2025 13:22 — #1
I have a series of steps that need to be performed for a lead. Once those are done (in our internal software), I would like to call the API to move the deal to the next stage in the pipeline. I can't find an endpoint that allows me to do that.
If I try the PUT deals/{id}, I get back a response that the deal already has deal items and it can't be edited.
Thanks.
PS. Would it make things more or less likely to get a response if I attach some fun cat pictures to the forum request? This will be my third so far, and I am not having any luck getting a response.
scottb at August 23rd, 2025 20:08 — #2
When dragging a deal from one stage to another in the UI, it works great. It appears to be calling this endpont, which is exactly what I need to do.
https://app.onepagecrm.com/pipeline/kanban/deals/68a9...4797/move_to_stage/40
Is there any way for me to call that endpoint from my code? Or, is there something like that already in the API and I am just missing it?
Thanks!
jameswood32 at August 25th, 2025 02:54 — #3
Yes, you can change the pipeline stage for a deal using the API.
If you're using a CRM like Pipedrive, HubSpot, or a similar platform, their APIs typically allow updating deal properties, including the stage within a pipeline.
Here's how you can do it (example in Pipedrive):
You'd use the Update a deal endpoint:
PUT /deals/{id}
Request Body:
{
"stage_id": YOUR_STAGE_ID
}
Replace YOUR_STAGE_ID with the ID of the stage you want to move the deal to.
Make sure:
You have the correct deal ID
The stage ID belongs to the same pipeline (or handle pipeline change if your API supports it)
For HubSpot:
Use the CRM API - Update a deal:
PATCH /crm/v3/objects/deals/{dealId}
Request Body:
{
"properties": {
"dealstage": "new_stage_id"
}
}
You’ll need to know the internal ID of the stage (dealstage) you want to move it to.
scottb at August 26th, 2025 05:23 — #4
Thanks so much for your reply, but I am confused. I was expecting this forum to be specific to the OnePageCRM API (https://developer.onepagecrm.com/api/). I am not using HubSpot.
I am trying the url: https://app.onepagecrm.com/api/v3/deals/{dealId}.
However, I get back this message:
{
"status": 400,
"message": "Invalid request data",
"error_name": "invalid_request_data",
"error_message": "As there are deal items for this deal, you are not able to edit it.",
"errors": {}
}
You are right that a patch method here would be awesome! Or, even a specific endpoint like OnePageCRM uses in the UI like I posted above.
Thanks again for trying to help. If you know any way to change the stage in the OnePageCRM API, I would love to have it.
sajedalmorsy at August 26th, 2025 12:29 — #5
Thanks, @ScottB, for getting in touch.
First of all, we apologize for the late reply.
It's definitely possible to update the deal's stage through the API in OnePgaeCRM.
To do that, you can send a PUT
request to the following endpoint:
https://app.onepagecrm.com/api/v3/deals/<DEAL_ID>?partial=true&has_deal_items=true
Where <DEAL_ID>
should be replaced by the deal's id that you are trying to update
and the body can be:
{
"stage": <VALUE>
}
where <VALUE>
should be replaced by the stage to which you are moving the deal (as an integer), for example to move the deal to the 40%
stage, the value should be 40
, hence the body should be:
{
"stage": 40
}
Notes: the partial=true
parameter indicates that you are updating only some fields in the body, so the other fields should remain the same.
has_deal_items
indicates that this deal has deal items, which is needed for some internal measures.
I hope this helps
Sajed Almorsy
OnePageCRM
scottb at August 27th, 2025 13:08 — #6
Thanks for the response. This partial=true&has_deal_items=true is VERY HELPFUL. Is the partial=true common for other endpoints too? This really seems like something worth putting in the documentation somewhere. Or, is it documented somewhere, and I just missed it?
Thanks
Powered by Discourse, best viewed with JavaScript enabled