Skip to main content
GET
/
api
/
audit-logs
/
{audit-log-id}
Retrieve single audit log
curl --request GET \
  --url https://{tenant}/api/audit-logs/{audit-log-id} \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://{tenant}/api/audit-logs/{audit-log-id}"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://{tenant}/api/audit-logs/{audit-log-id}', 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://{tenant}/api/audit-logs/{audit-log-id}",
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://{tenant}/api/audit-logs/{audit-log-id}"

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://{tenant}/api/audit-logs/{audit-log-id}")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://{tenant}/api/audit-logs/{audit-log-id}")

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
{
  "_id": "672a83e2b0418b224440ce29",
  "req_id": "0462e283-a55f-41ab-6482-60d2eeb1858c",
  "org_id": "66cf7f8db0418b1fbe91852b",
  "date": "Tue, 05 Nov 2024 17:45:22 -03",
  "timestamp": 1730839522,
  "ip": "127.0.0.1",
  "user": "jhon@mail.com",
  "action": "",
  "method": "GET",
  "url": "/api/audit-logs",
  "status": 200
}
{
"Message": "could not retrieve audit record",
"Meta": null,
"Status": "Error"
}
{
"Message": "Not authorised",
"Meta": null,
"Status": "Error"
}
{
"Message": "access denied: You do not have permission to access /api/audit-log",
"Meta": null,
"Status": "Error"
}
{
"Message": "could not retrieve audit record",
"Meta": null,
"Status": "Error"
}
{
"Message": "Failed to fetch audit record.",
"Meta": null,
"Status": "Error"
}

Authorizations

Authorization
string
header
required

The Tyk Dashboard API Access Credentials

Path Parameters

audit-log-id
integer
required

ID of the audit log record to fetch.

Response

Audit Log retrieved successfully

_id
string
Example:

"672a83e2b0418b224440ce29"

req_id
string
Example:

"0462e283-a55f-41ab-6482-60d2eeb1858c"

org_id
string
Example:

"5e9d9544a1dcd60001d0ed20"

date
string
Example:

"Tue, 05 Nov 2024 17:45:22 -03"

timestamp
integer
Example:

1730839522

ip
string
Example:

"127.0.0.1"

user
string
Example:

"jhon@mail.com"

action
string
Example:

"List APIS"

method
string
Example:

"GET"

url
string
Example:

"/api/apis"

status
integer
Example:

200