curl --request GET \
--url https://caretly.dev/console/api/v1/usage/events \
--header 'Authorization: Bearer <token>'import requests
url = "https://caretly.dev/console/api/v1/usage/events"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://caretly.dev/console/api/v1/usage/events', 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://caretly.dev/console/api/v1/usage/events",
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://caretly.dev/console/api/v1/usage/events"
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://caretly.dev/console/api/v1/usage/events")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://caretly.dev/console/api/v1/usage/events")
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{
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"events": [
{
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "live",
"labels": 3,
"requests": 6,
"format": "pdf",
"at": "2023-11-07T05:31:56Z",
"until": "2023-11-07T05:31:56Z"
}
],
"next_cursor": "<string>"
}{
"error": "`from` and `to` may be at most 31 days apart."
}{
"error": "This API key has been revoked. Send one of your API keys as `Authorization: Bearer <key>`; manage keys at https://caretly.dev/console/keys"
}List usage events
Usage events, newest first, a page at a time. Pass next_cursor as cursor to get the next page, with the same from and to; it is null on the last page. Pages stay stable while new usage arrives.
from and to may be at most 31 days apart. Leave both out for the last 31 days; give one and the window is 31 days from or up to it.
Usage is recorded about once a second: an event counts the requests one key made in one format in that window (requests, from at to until). Requests with an Idempotency-Key are events of their own, so a retry counts once. Older events, from before usage was added up per second, are one request each.
curl --request GET \
--url https://caretly.dev/console/api/v1/usage/events \
--header 'Authorization: Bearer <token>'import requests
url = "https://caretly.dev/console/api/v1/usage/events"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://caretly.dev/console/api/v1/usage/events', 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://caretly.dev/console/api/v1/usage/events",
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://caretly.dev/console/api/v1/usage/events"
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://caretly.dev/console/api/v1/usage/events")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://caretly.dev/console/api/v1/usage/events")
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{
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"events": [
{
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "live",
"labels": 3,
"requests": 6,
"format": "pdf",
"at": "2023-11-07T05:31:56Z",
"until": "2023-11-07T05:31:56Z"
}
],
"next_cursor": "<string>"
}{
"error": "`from` and `to` may be at most 31 days apart."
}{
"error": "This API key has been revoked. Send one of your API keys as `Authorization: Bearer <key>`; manage keys at https://caretly.dev/console/keys"
}Authorizations
One of your API keys (zpl_live_… or zpl_test_…), created at https://caretly.dev/console/keys. Revoked keys are refused immediately.
Query Parameters
Start of the window (inclusive), RFC 3339. URL-encode a + offset as %2B, or use Z.
"2026-10-01T00:00:00Z"
End of the window (exclusive), RFC 3339.
"2026-10-15T00:00:00Z"
Events per page.
1 <= x <= 1000The next_cursor of the previous page, unchanged.