Forecast

Get Forecast Baseline

GET
/v1/forecast/baseline

The monthly baseline the forecast starts from, assembled from the dashboards' own reads: the acquisition funnel, the media investment and the profitability cards of the last 30 São Paulo days, plus the cards of the last 365 days for the trailing revenue.

  • status: "ready" carries the baseline. noFunnel: no configured funnel, nothing measured at the top, or no customer-side stage. noRevenue: a funnel exists but there is no revenue or ticket to anchor the projection. error: the funnel read failed.
  • A failed revenue, investment or 12-month read degrades instead of failing: investment falls back to the cards investment and then to 0 (no media driver), the trailing revenue falls back to the last 30 days × 365/30 with annualized: true.
  • averageTicket is the cards ticket; without it, the last-30-day revenue ÷ the orders of the last chain stage.
  • businessModel comes from the organization record in v4mos-marketing (the caller's Authorization is forwarded, like the diagnosis reads it), falling back to the bowtie configuration; vendas_online → online_sales, inside_sales → inside_sales, pdv → pos. Unknown → null and every floor is null.
  • Cached for 30 minutes without depending on the caller: the reads per organization and São Paulo day, and the organization record model per organization, only once it was read from the record. A caller without Authorization (API client) gets that cached model, else the bowtie configuration; the floors are assembled on every call.

Authorization

ClientIdAuthClientSecretAuth
headerx-client-id<token>

Client ID

headerx-client-secret<token>

Client secret

Query Parameters

organizationId*string

Organization identifier (required). A missing or non-string value is a 400.

Response Body

Baseline do forecast

application/json
  1. response

Discriminated by status. Only ready carries a baseline.

status*string
baseline*
curl -X GET "https://example.com/v1/forecast/baseline?organizationId=c0ad4763-173e-4a05-9cff-5208c8ea5f6a"

{  "status": "ready",  "baseline": {    "windowStart": "2026-10-01",    "funnelKind": "ecommerce",    "businessModel": "online_sales",    "monthlyInvestment": 25000,    "stages": [      {        "stageId": "ATTENTION",        "scale": "media",        "role": "sessions",        "count": 100000,        "rate": null,        "sourceLabel": "GA4 · Sessões",        "floor": null      },      {        "stageId": "INTEREST",        "scale": "customer",        "role": "cart",        "count": 8000,        "rate": 0.08,        "sourceLabel": "Shopify · Add to cart",        "floor": 0.06      },      {        "stageId": "QUALIFICATION",        "scale": "customer",        "role": "checkout",        "count": 4000,        "rate": 0.5,        "sourceLabel": "Shopify · Initiate checkout",        "floor": 0.37      },      {        "stageId": "DECISION",        "scale": "customer",        "role": "purchase",        "count": 2000,        "rate": 0.5,        "sourceLabel": "Shopify · Pedido pago",        "floor": 0.5525      },      {        "stageId": "RETENTION",        "scale": "customer",        "role": "retention",        "count": 300,        "rate": 0.15,        "sourceLabel": "Shopify · Recompra",        "floor": null      }    ],    "averageTicket": 180,    "monthlyRevenue": 342000,    "trailingRevenue": {      "value": 3900000,      "annualized": false    },    "revenueSource": "transactional"  }}