salesPerformanceAnalytics
Requires permission analytics:sales:read.
Sales performance analytics over a date range, limited to what your role may see: sales reps see their own records, admins see everything by default, and other staff see their team.. Needs the sales analytics read permission.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
query SalesPerformanceAnalytics($range: AnalyticsRangeInput!) {
salesPerformanceAnalytics(range: $range) {
teamSize
leaderboard {
repName
commissionEarned
commissionPending
orders
quotes
repId
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query SalesPerformanceAnalytics($range: AnalyticsRangeInput!) {\n salesPerformanceAnalytics(range: $range) {\n teamSize\n leaderboard {\n repName\n commissionEarned\n commissionPending\n orders\n quotes\n repId\n }\n }\n}",
"variables": {
"range": {
"from": "2025-01-15T00:00:00Z",
"to": "2025-01-15T00:00:00Z"
}
}
}
EOF
Variables:
{
"range": {
"from": "2025-01-15T00:00:00Z",
"to": "2025-01-15T00:00:00Z"
}
}
Response:
{
"data": {
"salesPerformanceAnalytics": {
"teamSize": 0,
"leaderboard": [
{
"repName": "string",
"commissionEarned": 0,
"commissionPending": 0,
"orders": 0,
"quotes": 0,
"repId": "string"
}
]
}
}
}
salesPerformanceAnalytics(
range: AnalyticsRangeInput!
): SalesPerformanceAnalytics!
Arguments
salesPerformanceAnalytics.range ● AnalyticsRangeInput! non-null input
The date range and, optionally, the visibility scope.
Type
SalesPerformanceAnalytics object
Sales results by rep.