Magidoc

getOpportunityStats
Query

Gets aggregate counts for CRM opportunities matching supplied filters.

Arguments

#

workspaceId

ID !
Non-null

searchParams

accountId

accountIds

[ID !]

ownerId

ownerIds

[ID !]

excludeOwnerIds

[ID !]

Exclude opportunities owned by these users.

ownerIdIsNull

pipelineIds

[ID !]

excludeStageIds

[ID !]

Exclude opportunities in these stages. Matches the stage id, or the stage key on records without one.

stageIds

[ID !]

stageKeys

excludeStageStates

Exclude opportunities in these open/closed states.

isWon

isLost

Only deals whose stage outcome is explicitly lost (true), or every other deal (false). Dormant and other no-outcome closed deals are not lost; isWon: false still includes them.

forecastCategories

excludeForecastCategories

Exclude opportunities in these forecast categories.

types

excludeTypes

typeIds

Business type option ids from the workspace's business type setting (settings.crmFieldOptions.opportunityType).

excludeTypeIds

Exclude opportunities with these business type option ids.

minAmount

maxAmount

closeDateAfter

closeDateBefore

includeUnownedRecords

Include opportunities with no owner, on its own or alongside ownerIds. Insights uses this for its Unassigned option.

Response

#

Returns OpportunityStats !.

Example

#