Export audit logs
curl --request POST \
--url https://{notifuseDomain}/api/auditLogs.export \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"scope": "workspace",
"workspace_id": "<string>",
"format": "csv",
"actions": [
"<string>"
],
"categories": [
"<string>"
],
"actor_id": "<string>",
"actor_email": "<string>",
"actor_type": "<string>",
"target_type": "<string>",
"target_id": "<string>",
"ip_address": "<string>",
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://{notifuseDomain}/api/auditLogs.export"
payload = {
"scope": "workspace",
"workspace_id": "<string>",
"format": "csv",
"actions": ["<string>"],
"categories": ["<string>"],
"actor_id": "<string>",
"actor_email": "<string>",
"actor_type": "<string>",
"target_type": "<string>",
"target_id": "<string>",
"ip_address": "<string>",
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
scope: 'workspace',
workspace_id: '<string>',
format: 'csv',
actions: ['<string>'],
categories: ['<string>'],
actor_id: '<string>',
actor_email: '<string>',
actor_type: '<string>',
target_type: '<string>',
target_id: '<string>',
ip_address: '<string>',
from: '2023-11-07T05:31:56Z',
to: '2023-11-07T05:31:56Z'
})
};
fetch('https://{notifuseDomain}/api/auditLogs.export', 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://{notifuseDomain}/api/auditLogs.export",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'scope' => 'workspace',
'workspace_id' => '<string>',
'format' => 'csv',
'actions' => [
'<string>'
],
'categories' => [
'<string>'
],
'actor_id' => '<string>',
'actor_email' => '<string>',
'actor_type' => '<string>',
'target_type' => '<string>',
'target_id' => '<string>',
'ip_address' => '<string>',
'from' => '2023-11-07T05:31:56Z',
'to' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{notifuseDomain}/api/auditLogs.export"
payload := strings.NewReader("{\n \"scope\": \"workspace\",\n \"workspace_id\": \"<string>\",\n \"format\": \"csv\",\n \"actions\": [\n \"<string>\"\n ],\n \"categories\": [\n \"<string>\"\n ],\n \"actor_id\": \"<string>\",\n \"actor_email\": \"<string>\",\n \"actor_type\": \"<string>\",\n \"target_type\": \"<string>\",\n \"target_id\": \"<string>\",\n \"ip_address\": \"<string>\",\n \"from\": \"2023-11-07T05:31:56Z\",\n \"to\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{notifuseDomain}/api/auditLogs.export")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"scope\": \"workspace\",\n \"workspace_id\": \"<string>\",\n \"format\": \"csv\",\n \"actions\": [\n \"<string>\"\n ],\n \"categories\": [\n \"<string>\"\n ],\n \"actor_id\": \"<string>\",\n \"actor_email\": \"<string>\",\n \"actor_type\": \"<string>\",\n \"target_type\": \"<string>\",\n \"target_id\": \"<string>\",\n \"ip_address\": \"<string>\",\n \"from\": \"2023-11-07T05:31:56Z\",\n \"to\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{notifuseDomain}/api/auditLogs.export")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"scope\": \"workspace\",\n \"workspace_id\": \"<string>\",\n \"format\": \"csv\",\n \"actions\": [\n \"<string>\"\n ],\n \"categories\": [\n \"<string>\"\n ],\n \"actor_id\": \"<string>\",\n \"actor_email\": \"<string>\",\n \"actor_type\": \"<string>\",\n \"target_type\": \"<string>\",\n \"target_id\": \"<string>\",\n \"ip_address\": \"<string>\",\n \"from\": \"2023-11-07T05:31:56Z\",\n \"to\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body"<string>"{
"error": "<string>"
}{
"error": "<string>"
}Audit logs
Export audit logs
Streams the entries the filter selects, newest first, as a CSV or NDJSON file download, up to 100 000 rows. When the cap is reached the response ends with an export.truncated marker row; narrow the date range for the rest. The same authorisation as auditLogs.list applies, before the first byte is written. The export is itself recorded as auditLogs.export.
POST
/
api
/
auditLogs.export
Export audit logs
curl --request POST \
--url https://{notifuseDomain}/api/auditLogs.export \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"scope": "workspace",
"workspace_id": "<string>",
"format": "csv",
"actions": [
"<string>"
],
"categories": [
"<string>"
],
"actor_id": "<string>",
"actor_email": "<string>",
"actor_type": "<string>",
"target_type": "<string>",
"target_id": "<string>",
"ip_address": "<string>",
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://{notifuseDomain}/api/auditLogs.export"
payload = {
"scope": "workspace",
"workspace_id": "<string>",
"format": "csv",
"actions": ["<string>"],
"categories": ["<string>"],
"actor_id": "<string>",
"actor_email": "<string>",
"actor_type": "<string>",
"target_type": "<string>",
"target_id": "<string>",
"ip_address": "<string>",
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
scope: 'workspace',
workspace_id: '<string>',
format: 'csv',
actions: ['<string>'],
categories: ['<string>'],
actor_id: '<string>',
actor_email: '<string>',
actor_type: '<string>',
target_type: '<string>',
target_id: '<string>',
ip_address: '<string>',
from: '2023-11-07T05:31:56Z',
to: '2023-11-07T05:31:56Z'
})
};
fetch('https://{notifuseDomain}/api/auditLogs.export', 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://{notifuseDomain}/api/auditLogs.export",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'scope' => 'workspace',
'workspace_id' => '<string>',
'format' => 'csv',
'actions' => [
'<string>'
],
'categories' => [
'<string>'
],
'actor_id' => '<string>',
'actor_email' => '<string>',
'actor_type' => '<string>',
'target_type' => '<string>',
'target_id' => '<string>',
'ip_address' => '<string>',
'from' => '2023-11-07T05:31:56Z',
'to' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{notifuseDomain}/api/auditLogs.export"
payload := strings.NewReader("{\n \"scope\": \"workspace\",\n \"workspace_id\": \"<string>\",\n \"format\": \"csv\",\n \"actions\": [\n \"<string>\"\n ],\n \"categories\": [\n \"<string>\"\n ],\n \"actor_id\": \"<string>\",\n \"actor_email\": \"<string>\",\n \"actor_type\": \"<string>\",\n \"target_type\": \"<string>\",\n \"target_id\": \"<string>\",\n \"ip_address\": \"<string>\",\n \"from\": \"2023-11-07T05:31:56Z\",\n \"to\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{notifuseDomain}/api/auditLogs.export")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"scope\": \"workspace\",\n \"workspace_id\": \"<string>\",\n \"format\": \"csv\",\n \"actions\": [\n \"<string>\"\n ],\n \"categories\": [\n \"<string>\"\n ],\n \"actor_id\": \"<string>\",\n \"actor_email\": \"<string>\",\n \"actor_type\": \"<string>\",\n \"target_type\": \"<string>\",\n \"target_id\": \"<string>\",\n \"ip_address\": \"<string>\",\n \"from\": \"2023-11-07T05:31:56Z\",\n \"to\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{notifuseDomain}/api/auditLogs.export")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"scope\": \"workspace\",\n \"workspace_id\": \"<string>\",\n \"format\": \"csv\",\n \"actions\": [\n \"<string>\"\n ],\n \"categories\": [\n \"<string>\"\n ],\n \"actor_id\": \"<string>\",\n \"actor_email\": \"<string>\",\n \"actor_type\": \"<string>\",\n \"target_type\": \"<string>\",\n \"target_id\": \"<string>\",\n \"ip_address\": \"<string>\",\n \"from\": \"2023-11-07T05:31:56Z\",\n \"to\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body"<string>"{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
API token for authentication
Body
application/json
Available options:
workspace, deployment Available options:
csv, ndjson Available options:
success, failure, denied Response
The file, as text/csv or application/x-ndjson with a Content-Disposition attachment header
The response is of type string.
