List Logs
curl --request GET \
--url https://api.example.com/logsimport requests
url = "https://api.example.com/logs"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/logs', 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/logs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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/logs"
req, _ := http.NewRequest("GET", url, nil)
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/logs")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/logs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": [
{}
],
"pagination": {}
}Logs
List Logs
Get request logs
List Logs
curl --request GET \
--url https://api.example.com/logsimport requests
url = "https://api.example.com/logs"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/logs', 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/logs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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/logs"
req, _ := http.NewRequest("GET", url, nil)
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/logs")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/logs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": [
{}
],
"pagination": {}
}Description
Get a historical record of all API requests made to Sendly.Parameters
number
Results per page. Default: 20. Maximum: 100
number
Page number. Default: 1
number
Filter by HTTP status code. Example:
200, 400, 500string
Filter by HTTP method.
string
Sort order. Default:
descResponse
array
Array of logs.
object
Pagination information.
Examples
curl "https://api.usesendly.app/v1/logs?limit=50&sortOrder=desc" \
-H "Authorization: Bearer se_your_api_key"
const response = await client.logs.list({
limit: 50,
sortOrder: 'desc'
})
response.data.forEach(log => {
console.log(`[${log.created_at}] ${log.method} ${log.url} - ${log.status}`)
})
// Access logs via SDK
import { Sendly } from '@sendlyapp/sdk'
const client = new Sendly()
const response = await client.logs.list()
Filter by Status
const response = await client.logs.list({
status: 200,
limit: 100
})
console.log(`Successful requests: ${response.data.length}`)
curl "https://api.usesendly.app/v1/logs?status=200&limit=100" \
-H "Authorization: Bearer se_your_api_key"
Use Cases
- Audit: Track who did what and when
- Debugging: Understand why something failed
- Monitoring: Detect unusual patterns
- Compliance: Maintain audit trails
Retention
Logs are retained for 90 days. After that they’re automatically deleted.Need help? Contact support@usesendly.app