Magidoc

getOpportunities
Query

List CRM opportunities. Each node includes owner (workspace member) and account when selected in the query.

Arguments

#

aggregateMetrics

Aggregate all matching records in the database, ignoring pagination. At most 10 metrics; omit for normal records.

workspaceId

ID !
Non-null

specificIds

[ID !]

first = 50

last

before

after

searchParams

sortField = "modifiedAt"

sortOrder = -1

accountId

accountIds

[ID !]

ownerId

ownerIds

[ID !]

excludeOwnerIds

[ID !]

Exclude opportunities owned by these users.

ownerIdIsNull

includeUnownedRecords

Include unassigned opportunities alongside selected owners.

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

selector

Response

#

Returns OpportunityConnection .

Example

#