sourceLeadId pointing back at it.
Pipelines and stages
A pipeline is an ordered set of stages, and each stage has a type:
A deal’s
status comes from its stage’s type, not from a field on the deal. That’s why GET /v1/pipelines returns stages inline — without them you can’t interpret a stageId or tell which stages mean won.
status is shorthand for “any stage of that type”, so it keeps working when someone renames a stage:
Deal value
value is a decimal string and always travels with its currency:
minValue and maxValue still compare numerically, so ?minValue=9000 behaves the way you’d expect.
Probability and weighted value
Every open deal has an effective close probability, and there are two places it can come from:- The deal’s own override, if someone set one.
- Otherwise its stage’s default.
probability field on the response is already resolved — you don’t need to work out which applied. Weighted value is each deal’s value multiplied by its own probability, then summed, which is what makes it a forecast rather than a wish:
Pipeline value
GET /v1/metrics/pipeline gives you the whole picture in one call — open, won and lost, broken down by stage, pipeline and owner:
GET /v1/opportunities, so any list view you can build you can also total.
winRate is won / (won + lost) across the closed deals in the set, and is null rather than 0 when nothing has closed yet.
Resolving owners
ownerId is a user id. Resolve it with GET /v1/users, which returns each person’s display name, email and title.