curl --request GET \
--url https://api.example.com/api/v1/users/{user_id}/sync/history \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/users/{user_id}/sync/history"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/v1/users/{user_id}/sync/history', 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.example.com/api/v1/users/{user_id}/sync/history",
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.example.com/api/v1/users/{user_id}/sync/history"
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.example.com/api/v1/users/{user_id}/sync/history")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/users/{user_id}/sync/history")
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[
{
"run_key": "<string>",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider": "<string>",
"source": "pull",
"scope": "historical",
"status": "in_progress",
"started_at": "2023-11-07T05:31:56Z",
"trace_id": "<string>",
"window_start": "2023-11-07T05:31:56Z",
"window_end": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"items_inserted": 0,
"items_updated": 0,
"error": "<string>"
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}List Stored Sync Runs
Stored sync runs for a user, newest first.
Unlike /sync/runs this reads from the database rather than the Redis event buffer, so it is not limited to the last 24 hours. Only historical runs are stored by default. Use /sync/history/ for the per-data-type breakdown.
since filters on when a run executed. covered_from / covered_to filter on the span
of data it was meant to cover, which is what answers “what ran that was supposed to cover
March” — a backfill started yesterday covering March matches. A run matches when its own
window overlaps the range or when any of its data types covered a span that does; runs
with no recorded window on either level are excluded, since overlap is undecidable.
curl --request GET \
--url https://api.example.com/api/v1/users/{user_id}/sync/history \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/users/{user_id}/sync/history"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/v1/users/{user_id}/sync/history', 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.example.com/api/v1/users/{user_id}/sync/history",
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.example.com/api/v1/users/{user_id}/sync/history"
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.example.com/api/v1/users/{user_id}/sync/history")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/users/{user_id}/sync/history")
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[
{
"run_key": "<string>",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider": "<string>",
"source": "pull",
"scope": "historical",
"status": "in_progress",
"started_at": "2023-11-07T05:31:56Z",
"trace_id": "<string>",
"window_start": "2023-11-07T05:31:56Z",
"window_end": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"items_inserted": 0,
"items_updated": 0,
"error": "<string>"
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Headers
Path Parameters
Query Parameters
1 <= x <= 200Filter by historical or live. Whether the run backfills history or delivers current data.
historical, live Only runs started at or after this time.
Filter by provider name.
Only runs whose covered data window ends after this time.
Only runs whose covered data window starts before this time.
Response
Successful Response
How the sync was initiated / what transport delivers data.
pull, webhook, sdk, backfill, xml_import, linked_account Whether the run backfills history or delivers current data.
historical, live Overall outcome state for the run.
in_progress, success, partial, failed, cancelled, skipped, unfinished, stale Was this page helpful?

