Create an export
Connect a destination and schedule delivery of every closed window from startAt.
POST
/
v1
/
exports
Create an export
curl --request POST \
--url https://api.querying.ai/v1/exports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"destination": {
"bucket": "<string>",
"prefix": "<string>",
"region": "<string>",
"roleArn": "<string>",
"projectId": "<string>",
"datasetId": "<string>"
},
"interval": "daily",
"data": [],
"startAt": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.querying.ai/v1/exports"
payload = {
"destination": {
"bucket": "<string>",
"prefix": "<string>",
"region": "<string>",
"roleArn": "<string>",
"projectId": "<string>",
"datasetId": "<string>"
},
"interval": "daily",
"data": [],
"startAt": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
destination: {
bucket: '<string>',
prefix: '<string>',
region: '<string>',
roleArn: '<string>',
projectId: '<string>',
datasetId: '<string>'
},
interval: 'daily',
data: [],
startAt: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.querying.ai/v1/exports', 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.querying.ai/v1/exports",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'destination' => [
'bucket' => '<string>',
'prefix' => '<string>',
'region' => '<string>',
'roleArn' => '<string>',
'projectId' => '<string>',
'datasetId' => '<string>'
],
'interval' => 'daily',
'data' => [
],
'startAt' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.querying.ai/v1/exports"
payload := strings.NewReader("{\n \"destination\": {\n \"bucket\": \"<string>\",\n \"prefix\": \"<string>\",\n \"region\": \"<string>\",\n \"roleArn\": \"<string>\",\n \"projectId\": \"<string>\",\n \"datasetId\": \"<string>\"\n },\n \"interval\": \"daily\",\n \"data\": [],\n \"startAt\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.querying.ai/v1/exports")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"destination\": {\n \"bucket\": \"<string>\",\n \"prefix\": \"<string>\",\n \"region\": \"<string>\",\n \"roleArn\": \"<string>\",\n \"projectId\": \"<string>\",\n \"datasetId\": \"<string>\"\n },\n \"interval\": \"daily\",\n \"data\": [],\n \"startAt\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.querying.ai/v1/exports")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"destination\": {\n \"bucket\": \"<string>\",\n \"prefix\": \"<string>\",\n \"region\": \"<string>\",\n \"roleArn\": \"<string>\",\n \"projectId\": \"<string>\",\n \"datasetId\": \"<string>\"\n },\n \"interval\": \"daily\",\n \"data\": [],\n \"startAt\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"export": {
"id": "<string>",
"destination": {
"type": "s3",
"bucket": "<string>",
"prefix": "<string>",
"region": "<string>",
"roleArn": "<string>",
"projectId": "<string>",
"datasetId": "<string>",
"path": "<string>",
"tables": [
"<string>"
],
"location": "<string>"
},
"interval": "hourly",
"data": [
"tasks"
],
"enabled": true,
"schemaVersion": 123,
"nextWindowStart": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"deliveredThrough": "2023-11-07T05:31:56Z",
"failedRuns": 123,
"retryingRuns": 123
}
}
Authorizations
Your API key, sent as Authorization: Bearer <key>.
Body
application/json
Where files land. S3 and GCS take bucket and an optional prefix; S3 also takes region and roleArn. BigQuery takes projectId and datasetId. Responses add path (S3, GCS) or tables and location (BigQuery).
Show child attributes
Show child attributes
Window length. Fixed for the life of the export.
Available options:
hourly, daily Data sets to deliver. Default: both.
Available options:
tasks, monitor_results Deliver from the window containing this time, up to 30 days back. Default: now.
⌘I
Create an export
curl --request POST \
--url https://api.querying.ai/v1/exports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"destination": {
"bucket": "<string>",
"prefix": "<string>",
"region": "<string>",
"roleArn": "<string>",
"projectId": "<string>",
"datasetId": "<string>"
},
"interval": "daily",
"data": [],
"startAt": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.querying.ai/v1/exports"
payload = {
"destination": {
"bucket": "<string>",
"prefix": "<string>",
"region": "<string>",
"roleArn": "<string>",
"projectId": "<string>",
"datasetId": "<string>"
},
"interval": "daily",
"data": [],
"startAt": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
destination: {
bucket: '<string>',
prefix: '<string>',
region: '<string>',
roleArn: '<string>',
projectId: '<string>',
datasetId: '<string>'
},
interval: 'daily',
data: [],
startAt: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.querying.ai/v1/exports', 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.querying.ai/v1/exports",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'destination' => [
'bucket' => '<string>',
'prefix' => '<string>',
'region' => '<string>',
'roleArn' => '<string>',
'projectId' => '<string>',
'datasetId' => '<string>'
],
'interval' => 'daily',
'data' => [
],
'startAt' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.querying.ai/v1/exports"
payload := strings.NewReader("{\n \"destination\": {\n \"bucket\": \"<string>\",\n \"prefix\": \"<string>\",\n \"region\": \"<string>\",\n \"roleArn\": \"<string>\",\n \"projectId\": \"<string>\",\n \"datasetId\": \"<string>\"\n },\n \"interval\": \"daily\",\n \"data\": [],\n \"startAt\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.querying.ai/v1/exports")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"destination\": {\n \"bucket\": \"<string>\",\n \"prefix\": \"<string>\",\n \"region\": \"<string>\",\n \"roleArn\": \"<string>\",\n \"projectId\": \"<string>\",\n \"datasetId\": \"<string>\"\n },\n \"interval\": \"daily\",\n \"data\": [],\n \"startAt\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.querying.ai/v1/exports")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"destination\": {\n \"bucket\": \"<string>\",\n \"prefix\": \"<string>\",\n \"region\": \"<string>\",\n \"roleArn\": \"<string>\",\n \"projectId\": \"<string>\",\n \"datasetId\": \"<string>\"\n },\n \"interval\": \"daily\",\n \"data\": [],\n \"startAt\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"export": {
"id": "<string>",
"destination": {
"type": "s3",
"bucket": "<string>",
"prefix": "<string>",
"region": "<string>",
"roleArn": "<string>",
"projectId": "<string>",
"datasetId": "<string>",
"path": "<string>",
"tables": [
"<string>"
],
"location": "<string>"
},
"interval": "hourly",
"data": [
"tasks"
],
"enabled": true,
"schemaVersion": 123,
"nextWindowStart": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"deliveredThrough": "2023-11-07T05:31:56Z",
"failedRuns": 123,
"retryingRuns": 123
}
}