Reports
List reports
Introduction
APIs
- Authentication
- Customers
- Accounts
- Aliases
- Event Schemas
- Usage Meters
- AddOns
- Licenses
- Feature
- (Deprecated) Price Plans
- Price Plan V2
- Settings
- Price Experimentation
- Jobs
- Event Ingestion
- Entitlements
- Event Management
- Metrics
- Credits
- Invoices
- Payments
- Wallet
- InvoiceGroups
- Alerts
- Reports
Reports
List reports
List reports
GET
/
reports
curl --request GET \
--url https://api.togai.com/reports \
--header 'Authorization: Bearer <token>'
{
"data": [
{
"id": "report.23Xx0Jkc2DM.FgysO",
"name": "acme-2024-09-18.csv",
"status": "COMPLETED",
"createdAt": "2024-09-18T01:30:08.216867Z",
"updatedAt": "2024-09-18T01:30:08.350259Z",
"accountId": null,
"fileId": "file.23Xx0JkTljo.4JN5B",
"queryInput": null,
"reportTemplateId": null,
"preSignedUrl": null,
"type": "CUSTOM"
},
{
"id": "report.231kfXmrPq7.YJkpy",
"name": "Demo Report",
"status": "COMPLETED",
"createdAt": "2024-06-28T16:38:05.517189Z",
"updatedAt": "2024-06-28T16:38:20.533519Z",
"accountId": null,
"fileId": "file.231kfo14hqu.7ejfb",
"queryInput": {
"selects": [
{
"columnName": "name",
"dataSource": null,
"alias": " cus1-account",
"functions": null,
"aggregator": null
}
],
"baseDataSource": "customers",
"sort": [
{
"column": {
"columnName": "name",
"dataSource": null,
"alias": " cus1-account",
"functions": [],
"aggregator": null
},
"sortOrder": "ASC"
}
],
"limit": "1000,",
"queryFilters": null,
"seekValues": null
},
"reportTemplateId": "report_template.231kfPGCpoQ.SSeyY",
"preSignedUrl": null,
"type": "TEMPLATE"
}
],
"nextToken": "eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ=="
}
Fields that can be searched on using
_search
query paramSearch by Unique identifier of the reports
Search by name of the reports
Search by file id of the reports
Search by account id of the reports
Search by report template id of the reports
Downloading Reports:
Reports can be downloaded using the fileId
parameter of the Report
entity using the Files API.
Sharing Reports:
Sharable links can be generated using the Generate download URL API which are S3 signed URLs valid for 1 hour and do not require authentication.
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Query Parameters
Example:
"eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ=="
Example:
10
Fetch for flag used to get the reports from:
- ALL: Both the organization and accounts
- ORGANIZATION: Only the organization
- ACCOUNTS: Only accounts, works with account_id filter only.
Available options:
ALL
, ORGANIZATION
, ACCOUNTS
Response
200
application/json
Response for List Report requests
Represents a list response for reports
Represents a Report
Available options:
QUEUED
, RUNNING
, FAILED
, UPLOAD_PENDING
, COMPLETED
Available options:
TEMPLATE
, QUERY
, CUSTOM
curl --request GET \
--url https://api.togai.com/reports \
--header 'Authorization: Bearer <token>'
{
"data": [
{
"id": "report.23Xx0Jkc2DM.FgysO",
"name": "acme-2024-09-18.csv",
"status": "COMPLETED",
"createdAt": "2024-09-18T01:30:08.216867Z",
"updatedAt": "2024-09-18T01:30:08.350259Z",
"accountId": null,
"fileId": "file.23Xx0JkTljo.4JN5B",
"queryInput": null,
"reportTemplateId": null,
"preSignedUrl": null,
"type": "CUSTOM"
},
{
"id": "report.231kfXmrPq7.YJkpy",
"name": "Demo Report",
"status": "COMPLETED",
"createdAt": "2024-06-28T16:38:05.517189Z",
"updatedAt": "2024-06-28T16:38:20.533519Z",
"accountId": null,
"fileId": "file.231kfo14hqu.7ejfb",
"queryInput": {
"selects": [
{
"columnName": "name",
"dataSource": null,
"alias": " cus1-account",
"functions": null,
"aggregator": null
}
],
"baseDataSource": "customers",
"sort": [
{
"column": {
"columnName": "name",
"dataSource": null,
"alias": " cus1-account",
"functions": [],
"aggregator": null
},
"sortOrder": "ASC"
}
],
"limit": "1000,",
"queryFilters": null,
"seekValues": null
},
"reportTemplateId": "report_template.231kfPGCpoQ.SSeyY",
"preSignedUrl": null,
"type": "TEMPLATE"
}
],
"nextToken": "eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ=="
}