curl --request GET \
--url https://app.synthetic.ai/api/v1/customers \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.synthetic.ai/api/v1/customers"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.synthetic.ai/api/v1/customers', 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://app.synthetic.ai/api/v1/customers",
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://app.synthetic.ai/api/v1/customers"
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://app.synthetic.ai/api/v1/customers")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.synthetic.ai/api/v1/customers")
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": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"billingEmail": "<string>",
"invoiceCcEmails": [
"<string>"
],
"emailPaymentFollowUps": true,
"lastPaymentFollowUpAt": "<string>",
"note": "<string>",
"invoiceNote": "<string>",
"outstandingIssuedAmount": {},
"contractCount": 0,
"contractValueAmount": {},
"remainingToInvoiceAmount": {},
"contractHealth": "RENEWAL_DUE",
"coverageContractId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"coverageContractStartAt": "2023-11-07T05:31:56Z",
"coverageContractEndAt": "2023-11-07T05:31:56Z",
"coverageContractAutoRenew": true,
"coverageContractRenewed": true,
"createdAt": "<string>",
"updatedAt": "<string>"
}
],
"hasMore": true,
"nextCursor": "<string>",
"prevCursor": "<string>"
}{
"code": "BAD_REQUEST",
"message": "Input validation failed",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Unauthorized",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "An unexpected error occurred.",
"issues": []
}List customers
Lists customers that are not deleted, those whose contracts most need attention first unless orderBy asks for another order. Page with limit and the cursors from the previous page; hasMore says whether more rows lie in the direction being read. Keep the same filters and the same orderBy for the whole run. Needs a key holding customers:read.
curl --request GET \
--url https://app.synthetic.ai/api/v1/customers \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.synthetic.ai/api/v1/customers"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.synthetic.ai/api/v1/customers', 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://app.synthetic.ai/api/v1/customers",
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://app.synthetic.ai/api/v1/customers"
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://app.synthetic.ai/api/v1/customers")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.synthetic.ai/api/v1/customers")
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": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"billingEmail": "<string>",
"invoiceCcEmails": [
"<string>"
],
"emailPaymentFollowUps": true,
"lastPaymentFollowUpAt": "<string>",
"note": "<string>",
"invoiceNote": "<string>",
"outstandingIssuedAmount": {},
"contractCount": 0,
"contractValueAmount": {},
"remainingToInvoiceAmount": {},
"contractHealth": "RENEWAL_DUE",
"coverageContractId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"coverageContractStartAt": "2023-11-07T05:31:56Z",
"coverageContractEndAt": "2023-11-07T05:31:56Z",
"coverageContractAutoRenew": true,
"coverageContractRenewed": true,
"createdAt": "<string>",
"updatedAt": "<string>"
}
],
"hasMore": true,
"nextCursor": "<string>",
"prevCursor": "<string>"
}{
"code": "BAD_REQUEST",
"message": "Input validation failed",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Unauthorized",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "An unexpected error occurred.",
"issues": []
}Authorizations
An API key created in Settings, sent as Authorization: Bearer <key>.
Query Parameters
Only customers whose name contains this text, ignoring case.
Only customers with a contract that is not deleted whose current terms bill a subscription this often. A draft or ended contract counts.
MONTHLY, QUARTERLY, SEMI_ANNUAL, ANNUAL Only customers whose contractHealth is one of these, separated by commas — for example RENEWAL_DUE,ENDING. The states are RENEWAL_DUE, ENDING, HEALTHY, UPCOMING, NO_ACTIVE_CONTRACT, DRAFT_ONLY, NO_CONTRACTS; contractHealth on the customer says what each means.
Fields to order by, each written field:ASC or field:DESC and separated by commas, applied in the order written — for example contractHealth:ASC,name:ASC. Order by up to 3 of name, contractHealth, coverageContractStartAt, contractValueAmount, remainingToInvoiceAmount, createdAt. Omit it for the customers whose contracts most need attention first. contractValueAmount and remainingToInvoiceAmount compare the number alone, so 100 USD and 100 EUR sort together; a customer with no amounts counts as 0, and one with amounts in more than one currency, like one with no coverageContractStartAt, sorts last when ascending and first when descending.
The nextCursor of the previous page, to read the page after it.
1 - 1024^[A-Za-z0-9._-]+$The prevCursor of the previous page, to read the page before it.
1 - 1024^[A-Za-z0-9._-]+$Rows per page, 1 to 100.
1 <= x <= 100