curl --request GET \
--url https://api.upstash.com/v2/auditlogs \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.upstash.com/v2/auditlogs"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.upstash.com/v2/auditlogs', 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.upstash.com/v2/auditlogs",
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: Basic <encoded-value>"
],
]);
$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.upstash.com/v2/auditlogs"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
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.upstash.com/v2/auditlogs")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upstash.com/v2/auditlogs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body[
{
"log_id": "ab9744ed-f51c-4z58-a3cj-e3bs756154du",
"customer_id": "example@example.com",
"actor": "example@example.com",
"timestamp": 1764587058,
"action": 13,
"action_string": "Delete Team",
"source": "API_KEY - system_tests",
"entity": "test_team",
"secondary_entity": "NA",
"third_entity": "",
"readable_format": "",
"ip": "1.2.3.4",
"ttl": 1780311858,
"reason": "",
"notes": ""
}
]List Audit Logs
This endpoint lists all audit logs of user.
curl --request GET \
--url https://api.upstash.com/v2/auditlogs \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.upstash.com/v2/auditlogs"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.upstash.com/v2/auditlogs', 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.upstash.com/v2/auditlogs",
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: Basic <encoded-value>"
],
]);
$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.upstash.com/v2/auditlogs"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
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.upstash.com/v2/auditlogs")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upstash.com/v2/auditlogs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body[
{
"log_id": "ab9744ed-f51c-4z58-a3cj-e3bs756154du",
"customer_id": "example@example.com",
"actor": "example@example.com",
"timestamp": 1764587058,
"action": 13,
"action_string": "Delete Team",
"source": "API_KEY - system_tests",
"entity": "test_team",
"secondary_entity": "NA",
"third_entity": "",
"readable_format": "",
"ip": "1.2.3.4",
"ttl": 1780311858,
"reason": "",
"notes": ""
}
]Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Response
Audit logs retrieved successfully
Unique identifier for the log entry
"ab9744ed-f51c-4z58-a3cj-e3bs756154du"
The ID or email of the customer associated with the log
"example@example.com"
The user or system that performed the action
"example@example.com"
Unix timestamp of when the action occurred
1764587058
Numeric ID representing the specific action type
13
Human-readable description of the action
"Delete Team"
The source method or client used to perform the action
"API_KEY - system_tests"
The primary entity affected by the action
"test_team"
A secondary entity affected, "" or "NA" if not applicable
"NA"
A tertiary entity affected, "" or "NA" if not applicable
""
formatted string for display purposes
""
The IP address from which the request originated
"1.2.3.4"
Time to live (expiration) timestamp for this log entry
1780311858
The reason for the action, if provided
""
Additional notes regarding the action
""
Was this page helpful?