Skip to content

opportunity

Get opportunity pipeline metrics

GET/v1/opportunities/metrics

Computes win rate, average deal size, average time to close and a per-stage value distribution over the caller's tenant's active, PSA-present opportunities, optionally narrowed to a created-at date range. Every pipeline stage lists in stageDistribution even when no opportunity in range is in it, at zero. Every amount is in the workspace's current currency, named by currency; opportunity amounts carry no currency of their own, so a currency switch relabels them without converting them.

Parameters

NameInRequiredTypeDescription
dateFromqueryNostring—
dateToqueryNostring—

Request body

No request body.

Responses and errors

  • 200

    Get opportunity pipeline metrics

    • currency (required): object — The currency of this opportunity's amounts: the workspace's current currency. Null when the workspace currency cannot be read, in which case the amounts have no unit.
    • totalOpportunities (required): integer
    • totalValue (required): number
    • avgDealSize (required): number
    • avgTimeToClose (required): number
    • winRate (required): number
    • lossRate (required): number
    • activeOpportunities (required): integer
    • closedWonOpportunities (required): integer
    • closedLostOpportunities (required): integer
    • pipelineValue (required): number
    • stageDistribution (required): array
  • 400

    Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.

    • ValidationFailedError:
    • allOf: ErrorEnvelope
  • 401

    Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.

    • UnauthorizedError:
    • allOf: ErrorEnvelope
  • 403

    Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.

    • ForbiddenError:
    • allOf: ErrorEnvelope
  • 429

    Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.

    • RateLimitedError:
    • allOf: ErrorEnvelope
  • 503

    Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.

    • UnavailableError:
    • allOf: ErrorEnvelope

Example

curl --request GET \
  --url 'https://api.scopable.io/v1/opportunities/metrics' \
  --header 'Authorization: Bearer $SCOPABLE_API_KEY'

Replace $SCOPABLE_API_KEY with a key created in Settings, API.

View the OpenAPI 3.1 source

Need help with the API? …