Skip to main content
GET
/
auditlogs
List Audit Logs
curl --request GET \
  --url https://api.upstash.com/auditlogs \
  --header 'Authorization: Basic <encoded-value>'
import requests

url = "https://api.upstash.com/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/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/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/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/auditlogs")
.header("Authorization", "Basic <encoded-value>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.upstash.com/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

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Response

200 - application/json

Audit logs retrieved successfully

log_id
string

Unique identifier for the log entry

Example:

"ab9744ed-f51c-4z58-a3cj-e3bs756154du"

customer_id
string

The ID or email of the customer associated with the log

Example:

"example@example.com"

actor
string

The user or system that performed the action

Example:

"example@example.com"

timestamp
integer<int64>

Unix timestamp of when the action occurred

Example:

1764587058

action
integer

Numeric ID representing the specific action type

Example:

13

action_string
string

Human-readable description of the action

Example:

"Delete Team"

source
string

The source method or client used to perform the action

Example:

"API_KEY - system_tests"

entity
string

The primary entity affected by the action

Example:

"test_team"

secondary_entity
string

A secondary entity affected, "" or "NA" if not applicable

Example:

"NA"

third_entity
string

A tertiary entity affected, "" or "NA" if not applicable

Example:

""

readable_format
string

formatted string for display purposes

Example:

""

ip
string<ipv4>

The IP address from which the request originated

Example:

"1.2.3.4"

ttl
integer<int64>

Time to live (expiration) timestamp for this log entry

Example:

1780311858

reason
string

The reason for the action, if provided

Example:

""

notes
string

Additional notes regarding the action

Example:

""