ERROR: stageId is a duplicate of a stageId in another pipeline

deals

#1

I’m getting this error when trying to create a deal pipeline via API.

In this case, I have already created this exact deal pipeline and then I deleted it, then tried again via API.

Perhaps it’s possible that the old one wasn’t really deleted?

It no longer shows up in the UI, nor when I get all pipelines via GET https://api.hubapi.com/deals/v1/pipelines

Alternately, if I then append a “1” to these stageId values, I get this error:

Error: all stages must reference pipelineId which must exist in the deals_pipelines table

But of course, I don’t have the pipelineId, nor do the API documents tell me to supply a pipelineId.

And if I try to set the pipelineId value when I add the pipeline, I get this:

Error: pipelineId must not be set when inserting new pipeline

Any ideas?


#2

I was able to get this to work, but only if I DO NOT set the stageId for the individual stages.

Perhaps this has something to do with deleting the Pipelines? Maybe when you delete a Pipeline, the stages remain and are somehow just “unattached” or something like that?

Not sure, but would certainly like to be able to set the stageId values…


#3

@cre We usually don’t perform a hard delete for 30 days or so. The reason for this is in the case someone accidentally deletes a pipeline or a deal,contact,company etc… they can call in to support and we can “un-delete” the object. It happens often that someone will delete something in the system by mistake and needs the object to be revised.


#4

that makes sense. is that triggered by the DEAL STAGE NAME though, matching a string? seems like that is what’s going on here…

also, when i pull a list of all the deal stages, i don’t get the deleted ones with an isDeleted flag or anything.

now i have code that can add and also delete, and they don’t seem to be “sticking” anymore… so might be something with just that deal stage on this particular account.


#5

@cre I’m not sure on your first question. On the second question, we would filter out the deleted and not return it to you.


#6

Sorry to rehash this topic but is there no way to a "hard delete" programmatically? I'm creating all my pipelines/stages programmatically anyways.

Also, the uniqueness of stage names across all pipelines has to be an oversight. It should only be unique per pipeline.