Skip to main content
GET
/
reports
List reports
curl --request GET \
  --url https://api.togai.com/reports \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.togai.com/reports"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.togai.com/reports', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.togai.com/reports",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.togai.com/reports"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.togai.com/reports")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.togai.com/reports")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "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=="
}
{
"message": "<Reason message>"
}
id
string
Unique identifier of the report
account_id
string
Unique identifier of the account associated with the report
status
enum
Status of the report
type
enum
Type of the report
id
string
account_id
string
status
string
type
string
report_template_id
string

Allowed filter combinations

  • id
  • account_id
  • account_id, status
  • account_id, status, type
  • report_template_id
  • report_template_id, status
  • account_id, report_template_id, status
Fields that can be searched on using _search query param
id
string
Search by Unique identifier of the reports
name
string
Search by name of the reports
file_id
string
Search by file id of the reports
account_id
string
Search by account id of the reports
report_template_id
string
Search by report template id of the reports
Fields with which the list response can be sorted using _sort query param
id
string
account_id
string
report_template_id
string
Default sort order:id DESC
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

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

nextToken
string
Example:

"eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ=="

pageSize
number
Example:

10

fetchFor
enum<string>
default:ORGANIZATION

Fetch for flag used to get the reports from:

  1. ALL: Both the organization and accounts
  2. ORGANIZATION: Only the organization
  3. ACCOUNTS: Only accounts, works with account_id filter only.
Available options:
ALL,
ORGANIZATION,
ACCOUNTS

Response

Response for List Report requests

Represents a list response for reports

data
object[]
nextToken
string