Skip to content
SarvexDocs
Esc
↑↓navigate↵open⌘Jpreview

Merchants per engagement stage over time

GET/operator/timeline-metrics
Authorization
AuthorizationBearer token (JWT) · headerrequired

JWT issued by the external IdP via the OAuth 2.0 authorization-code flow (Kinde in production; a simulator in test). The client obtains it and sends it as a Bearer token on every authenticated call. Sarvex's services verify it — issuer, audience, signature (IdP JWKS), expiry — and read identity and tenant from its claims. Sarvex does not issue or revoke these tokens. merchant_id/store_id are read from the verified claims (and the merchant→store mapping), never from the URL. The operator scope is required for /operator/*. Operators acting on a specific merchant pass the X-Operate-As header, which is recorded in the audit log.

Scopes:operator
Query parameters
merchant_idstring
start_datestring<date>
end_datestring<date>
Responses
200

One datapoint per stage per day.

datapointsobject[]
Show properties
Array of object
datestring
stagestring
countinteger
avg_days_in_stageinteger
countinteger
403

Authenticated but not permitted (e.g. non-operator on an operator route).

errorobjectrequired
Show properties
codestringrequired
messagestringrequired
detailsobject | null
Try it
Server
Authorization
Parameters
Request
curl -X GET "https://api.sarvex.example.com/v1/operator/timeline-metrics" \
  -H "Authorization: Bearer YOUR_TOKEN"
Response
{
  "datapoints": [
    {
      "date": "string",
      "stage": "string",
      "count": 0,
      "avg_days_in_stage": 0
    }
  ],
  "count": 0
}