Skip to main content
POST
/
api
/
admin
/
histories
/
charts
/
timeline
Get time-series chart data for histories
curl --request POST \
  --url https://pria.praxislxp.com/api/admin/histories/charts/timeline \
  --header 'Content-Type: application/json' \
  --header 'x-access-token: <api-key>' \
  --data '
{
  "granularity": "month",
  "range": -3,
  "dimension": "count",
  "institution": "65cfebc32f5e1b37d4e52329",
  "account": "<string>",
  "aggregate": false,
  "topsearch": 5
}
'
{
  "success": true,
  "data": [
    {
      "_id": {
        "granularity": "2023-11-07T05:31:56Z",
        "institution": "<string>"
      },
      "dimension": 123
    }
  ]
}

Authorizations

x-access-token
string
header
required

JWT token passed in x-access-token header

Body

application/json
granularity
enum<string>
required

Time granularity for bucketing

Available options:
day,
week,
month,
hour
Example:

"month"

range
integer
required

Time range (negative values for past periods)

Example:

-3

dimension
enum<string>
required

Metric to aggregate

Available options:
count,
credits,
usage,
cached,
price
Example:

"count"

institution
string

Institution ID (optional, filters by institution)

Example:

"65cfebc32f5e1b37d4e52329"

account
string

Account ID (optional, filters by account's institutions)

aggregate
boolean

When true, aggregates across all institutions

Example:

false

topsearch
integer

Number of top institutions to return (default 5, -1 for all)

Example:

5

Response

Successfully retrieved timeline chart data

success
boolean

Indicates if the request was successful

data
object[]

Array of chart data points