Stream Audit Logs
curl --request POST \
--url https://api.flare.io/firework/v4/audit-logs/_search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "<string>",
"order": "<string>",
"size": 123,
"filters": {
"affected_tenant_ids": [
123
],
"created_at": {
"gte": "<string>",
"lte": "<string>"
},
"query": "<string>"
}
}
'import requests
url = "https://api.flare.io/firework/v4/audit-logs/_search"
payload = {
"from": "<string>",
"order": "<string>",
"size": 123,
"filters": {
"affected_tenant_ids": [123],
"created_at": {
"gte": "<string>",
"lte": "<string>"
},
"query": "<string>"
}
}
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({
from: '<string>',
order: '<string>',
size: 123,
filters: {
affected_tenant_ids: [123],
created_at: {gte: '<string>', lte: '<string>'},
query: '<string>'
}
})
};
fetch('https://api.flare.io/firework/v4/audit-logs/_search', 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.flare.io/firework/v4/audit-logs/_search",
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([
'from' => '<string>',
'order' => '<string>',
'size' => 123,
'filters' => [
'affected_tenant_ids' => [
123
],
'created_at' => [
'gte' => '<string>',
'lte' => '<string>'
],
'query' => '<string>'
]
]),
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://api.flare.io/firework/v4/audit-logs/_search"
payload := strings.NewReader("{\n \"from\": \"<string>\",\n \"order\": \"<string>\",\n \"size\": 123,\n \"filters\": {\n \"affected_tenant_ids\": [\n 123\n ],\n \"created_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\"\n },\n \"query\": \"<string>\"\n }\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://api.flare.io/firework/v4/audit-logs/_search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"<string>\",\n \"order\": \"<string>\",\n \"size\": 123,\n \"filters\": {\n \"affected_tenant_ids\": [\n 123\n ],\n \"created_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\"\n },\n \"query\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flare.io/firework/v4/audit-logs/_search")
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 \"from\": \"<string>\",\n \"order\": \"<string>\",\n \"size\": 123,\n \"filters\": {\n \"affected_tenant_ids\": [\n 123\n ],\n \"created_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\"\n },\n \"query\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"items": [
{
"id": 123,
"created_at": "2023-11-07T05:31:56Z",
"type": "event",
"action": "created",
"source": "all",
"affected_tenant_id": 123,
"affected_tenant_name": "<string>",
"affected_user_id": 123,
"performed_by": {
"user_id": 123,
"user_email": "<string>",
"user_name": "<string>",
"tenant_id": 123,
"ip": "<string>",
"user_type": "user"
},
"data": {
"identifier_id": 123,
"identifier_name": "<string>",
"identifier_edit_data": {},
"name": "identifier.edit",
"version": 1
},
"previous_data": {
"identifier_id": 123,
"identifier_name": "<string>",
"identifier_edit_data": {},
"name": "identifier.edit",
"version": 1
}
}
],
"next": "<string>",
"total_count": 123
}
Audit Logs
Stream Audit Logs
POST
/
firework
/
v4
/
audit-logs
/
_search
Stream Audit Logs
curl --request POST \
--url https://api.flare.io/firework/v4/audit-logs/_search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "<string>",
"order": "<string>",
"size": 123,
"filters": {
"affected_tenant_ids": [
123
],
"created_at": {
"gte": "<string>",
"lte": "<string>"
},
"query": "<string>"
}
}
'import requests
url = "https://api.flare.io/firework/v4/audit-logs/_search"
payload = {
"from": "<string>",
"order": "<string>",
"size": 123,
"filters": {
"affected_tenant_ids": [123],
"created_at": {
"gte": "<string>",
"lte": "<string>"
},
"query": "<string>"
}
}
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({
from: '<string>',
order: '<string>',
size: 123,
filters: {
affected_tenant_ids: [123],
created_at: {gte: '<string>', lte: '<string>'},
query: '<string>'
}
})
};
fetch('https://api.flare.io/firework/v4/audit-logs/_search', 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.flare.io/firework/v4/audit-logs/_search",
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([
'from' => '<string>',
'order' => '<string>',
'size' => 123,
'filters' => [
'affected_tenant_ids' => [
123
],
'created_at' => [
'gte' => '<string>',
'lte' => '<string>'
],
'query' => '<string>'
]
]),
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://api.flare.io/firework/v4/audit-logs/_search"
payload := strings.NewReader("{\n \"from\": \"<string>\",\n \"order\": \"<string>\",\n \"size\": 123,\n \"filters\": {\n \"affected_tenant_ids\": [\n 123\n ],\n \"created_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\"\n },\n \"query\": \"<string>\"\n }\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://api.flare.io/firework/v4/audit-logs/_search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"<string>\",\n \"order\": \"<string>\",\n \"size\": 123,\n \"filters\": {\n \"affected_tenant_ids\": [\n 123\n ],\n \"created_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\"\n },\n \"query\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flare.io/firework/v4/audit-logs/_search")
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 \"from\": \"<string>\",\n \"order\": \"<string>\",\n \"size\": 123,\n \"filters\": {\n \"affected_tenant_ids\": [\n 123\n ],\n \"created_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\"\n },\n \"query\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"items": [
{
"id": 123,
"created_at": "2023-11-07T05:31:56Z",
"type": "event",
"action": "created",
"source": "all",
"affected_tenant_id": 123,
"affected_tenant_name": "<string>",
"affected_user_id": 123,
"performed_by": {
"user_id": 123,
"user_email": "<string>",
"user_name": "<string>",
"tenant_id": 123,
"ip": "<string>",
"user_type": "user"
},
"data": {
"identifier_id": 123,
"identifier_name": "<string>",
"identifier_edit_data": {},
"name": "identifier.edit",
"version": 1
},
"previous_data": {
"identifier_id": 123,
"identifier_name": "<string>",
"identifier_edit_data": {},
"name": "identifier.edit",
"version": 1
}
}
],
"next": "<string>",
"total_count": 123
}
Required API key permission: Read Organization Admin
Returns a list of audit logs for the current organization, which can be used to stream all audit logs to an external platform or to search for specific ones.
Body Parameters
string
The
next value from the last response.string
default:"desc"
Available options:
asc, descinteger
default:50
object
Show child attributes
Show child attributes
{
"items": [
{
"id": 123,
"created_at": "2023-11-07T05:31:56Z",
"type": "event",
"action": "created",
"source": "all",
"affected_tenant_id": 123,
"affected_tenant_name": "<string>",
"affected_user_id": 123,
"performed_by": {
"user_id": 123,
"user_email": "<string>",
"user_name": "<string>",
"tenant_id": 123,
"ip": "<string>",
"user_type": "user"
},
"data": {
"identifier_id": 123,
"identifier_name": "<string>",
"identifier_edit_data": {},
"name": "identifier.edit",
"version": 1
},
"previous_data": {
"identifier_id": 123,
"identifier_name": "<string>",
"identifier_edit_data": {},
"name": "identifier.edit",
"version": 1
}
}
],
"next": "<string>",
"total_count": 123
}
Was this page helpful?