Analytics

Forecast

Open deals with an explainable win probability (stage probability adjusted by activity, replies, meetings, next step, close date, plan progress and signature) and the weighted forecast by close-date month, with totals per currency (never converted) and per owner (RO-367).

API key access

Needs the analytics:read scope with an API key (ro_pat_...). A signed-in session uses the caller's role.
GET/api/v1/analytics/forecast
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

months?integer

Default 6

Formatint64
Range1 <= value <= 12
owner_id?string

Only this owner's deals: a member's id or me (RO-367).

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/analytics/forecast?months=1&owner_id=string" \  -H "X-Workspace-Id: string"
{
  "currency": "string",
  "months": [
    {
      "month": "string",
      "deals": 0,
      "value": 0.1,
      "weighted": 0.1
    }
  ],
  "unscheduled": {
    "deals": 0,
    "value": 0.1,
    "weighted": 0.1
  },
  "later": {
    "deals": 0,
    "value": 0.1,
    "weighted": 0.1
  },
  "other_currency_deals": 0,
  "currencies": [
    {
      "currency": "string",
      "deals": 0,
      "value": 0.1,
      "weighted": 0.1
    }
  ],
  "owners": [
    {
      "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05",
      "owner_name": "string",
      "deals": 0,
      "currencies": [
        {
          "currency": "string",
          "deals": 0,
          "value": 0.1,
          "weighted": 0.1
        }
      ]
    }
  ],
  "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05",
  "total_value": 0.1,
  "total_weighted": 0.1,
  "deals": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "name": "string",
      "stage_name": "string",
      "company_name": "string",
      "value": 0,
      "currency": "string",
      "close_date": "2019-08-24",
      "month": "string",
      "stage_probability": 0,
      "win_probability": 0,
      "weighted_value": 0,
      "factors": [
        {
          "label": "string",
          "effect": 0
        }
      ],
      "last_activity_at": "2019-08-24T14:15:22Z",
      "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05",
      "owner_name": "string"
    }
  ],
  "generated_at": "2019-08-24T14:15:22Z"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}