v3

latestSwagger 2.02026-08-067506752.0 MB
report

Return timeseries data from arbitrary queries

post/v1/org/{orgId}/report/query

Path parameters

orgIdstring required

Org identifier (either id or slug)

Request body

contentstring

content block to evaluate as a Carrot Template, as an alternative to using series

startDatestring

start date, in either relative (-7d) or exact (YYYY-MM-DD) format

endDatestring

end date, in either relative (-7d) or exact (YYYY-MM-DD) format; if not present, defaults to today

interval'DAY' | 'WEEK' | 'MONTH' | 'QUARTER' | 'FISCAL_QUARTER' | 'YEAR' | 'FISCAL_YEAR'

interval, if the query is a timeseries; if no interval, query is crosstabbed

intervalDatesstring[]

interval dates, if a specific set of irregular dates are being queried in a timeseries

optionsobject required

options, including format, filter, scenarioId, projectHires, and numerous display options

Example request

{
  "series": [
    {
      "y": "sum{headcount, gender:f} / sum{headcount}",
      "groupByConfigs": [
        {
          "fieldId": "588f7ee98f138b19220041a7",
          "questionId": "588f7ee98f138b19220041a7"
        }
      ]
    }
  ]
}

Response

successful operation

idstring required

globally unique id

orgIdstring required

parent org id

keystring required

identifying key for this report result

startDatestring date required

date that the report result interval begins, inclusive

endDatestring date required

date that the report result interval ends, exclusive

optionsobject required

options that were used for the query

buildStartAtstring

start time of last build

buildEndAtstring

end time of last build

messagestring

status or error message

progressnumber double

percent progress so far

viewIdstring

viewer user id

createIdstring required

created by user id

createBehalfIdstring

created on behalf of user id

createAtstring required

created timestamp

status'OK' | 'LOCKED' | 'RETRY' | 'ERROR' required

status of the report result

reportIdstring

corresponding report id for the built query

chartIdstring

corresponding chart id for the built query

Example response

[
  {
    "id": "588f7ee98f138b19220041a7",
    "orgId": "588f7ee98f138b19220041a7",
    "queries": [
      {
        "series": [
          {
            "y": "sum{headcount, gender:f} / sum{headcount}",
            "groupByConfigs": [
              {
                "fieldId": "588f7ee98f138b19220041a7",
                "questionId": "588f7ee98f138b19220041a7"
              }
            ]
          }
        ]
      }
    ],
    "results": [
      {
        "groupBys": [
          {
            "keys": [
              {
                "orgId": "588f7ee98f138b19220041a7"
              }
            ]
          }
        ]
      }
    ],
    "buildStartAt": "2017-01-24T13:57:52Z",
    "buildEndAt": "2017-01-24T13:57:52Z",
    "viewId": "588f7ee98f138b19220041a7",
    "createId": "588f7ee98f138b19220041a7",
    "createBehalfId": "588f7ee98f138b19220041a7",
    "createAttribution": {
      "principalUserId": "588f7ee98f138b19220041a7",
      "agentUserIds": [
        "588f7ee98f138b19220041a7"
      ],
      "eventId": "588f7ee98f138b19220041a7",
      "aiChatId": "588f7ee98f138b19220041a7"
    },
    "createAt": "2017-01-24T13:57:52Z",
    "reportId": "588f7ee98f138b19220041a7",
    "chartId": "588f7ee98f138b19220041a7"
  }
]