CRM

Deal Analytics

A pipeline by stage: deal count, value and weighted value (value x probability), plus open, won and lost totals, the win rate and the open deals closing this month. Default: the default pipeline.

API key access

Needs the crm:read scope with an API key (ro_pat_...). A signed-in session uses the caller's role.
GET/api/v1/deals/analytics
AuthorizationBearer <token>

Access token from /api/v1/auth/login, or an API key (ro_pat_..., RO-176) from /api/v1/workspaces/current/api-keys: the key implies its workspace and needs the route's scope. MCP connectors (/api/v1/mcp only) may use an OAuth access token (ro_oat_..., RO-284).

In: header

Query Parameters

pipeline_id?string
Formatuuid

Header Parameters

X-Workspace-Id?string | null

Id of the workspace to act on (must be a member).

Response Body

curl -X GET "http://localhost:8000/api/v1/deals/analytics?pipeline_id=497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "X-Workspace-Id: string"
{
  "pipeline_id": "ec036e81-7903-4e4d-bbfa-ac8516341cf0",
  "pipeline_name": "string",
  "currencies": [
    "string"
  ],
  "stages": [
    {
      "stage_id": "f38d2b9c-0a0a-4eea-91a8-e974413bb670",
      "name": "string",
      "kind": "open",
      "position": 0,
      "probability": 0,
      "count": 0,
      "value": 0.1,
      "weighted_value": 0.1
    }
  ],
  "open_count": 0,
  "open_value": 0.1,
  "weighted_value": 0.1,
  "won_count": 0,
  "won_value": 0.1,
  "lost_count": 0,
  "win_rate": 0,
  "closing_this_month": 0
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}