curl --request POST \
--url https://anaconda.com/api/audit-logs/export \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from_date": "<timestamp>",
"q": [],
"search_operator": "or",
"to_date": "<timestamp>"
}
'import requests
url = "https://anaconda.com/api/audit-logs/export"
payload = {
"from_date": "<timestamp>",
"q": [],
"search_operator": "or",
"to_date": "<timestamp>"
}
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_date: '<timestamp>', q: [], search_operator: 'or', to_date: '<timestamp>'})
};
fetch('https://anaconda.com/api/audit-logs/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://anaconda.com/api/audit-logs/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([
'from_date' => '<timestamp>',
'q' => [
],
'search_operator' => 'or',
'to_date' => '<timestamp>'
]),
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://anaconda.com/api/audit-logs/export"
payload := strings.NewReader("{\n \"from_date\": \"<timestamp>\",\n \"q\": [],\n \"search_operator\": \"or\",\n \"to_date\": \"<timestamp>\"\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://anaconda.com/api/audit-logs/export")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from_date\": \"<timestamp>\",\n \"q\": [],\n \"search_operator\": \"or\",\n \"to_date\": \"<timestamp>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://anaconda.com/api/audit-logs/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 \"from_date\": \"<timestamp>\",\n \"q\": [],\n \"search_operator\": \"or\",\n \"to_date\": \"<timestamp>\"\n}"
response = http.request(request)
puts response.read_body{}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Create Export Job
Create a bulk export job that writes audit logs in JSON Lines format. The export is processed asynchronously — use the returned job ID to check status and download the results.
curl --request POST \
--url https://anaconda.com/api/audit-logs/export \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from_date": "<timestamp>",
"q": [],
"search_operator": "or",
"to_date": "<timestamp>"
}
'import requests
url = "https://anaconda.com/api/audit-logs/export"
payload = {
"from_date": "<timestamp>",
"q": [],
"search_operator": "or",
"to_date": "<timestamp>"
}
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_date: '<timestamp>', q: [], search_operator: 'or', to_date: '<timestamp>'})
};
fetch('https://anaconda.com/api/audit-logs/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://anaconda.com/api/audit-logs/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([
'from_date' => '<timestamp>',
'q' => [
],
'search_operator' => 'or',
'to_date' => '<timestamp>'
]),
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://anaconda.com/api/audit-logs/export"
payload := strings.NewReader("{\n \"from_date\": \"<timestamp>\",\n \"q\": [],\n \"search_operator\": \"or\",\n \"to_date\": \"<timestamp>\"\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://anaconda.com/api/audit-logs/export")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from_date\": \"<timestamp>\",\n \"q\": [],\n \"search_operator\": \"or\",\n \"to_date\": \"<timestamp>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://anaconda.com/api/audit-logs/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 \"from_date\": \"<timestamp>\",\n \"q\": [],\n \"search_operator\": \"or\",\n \"to_date\": \"<timestamp>\"\n}"
response = http.request(request)
puts response.read_body{}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer token obtained by authenticating with your organization's service account credentials (client_id and client_secret).
See the Getting started page for the full authentication flow.
Headers
Name of the organization to scope the request to. This header is required in multi-tenant deployments.
Organization name used to resolve the tenant context.
The API version to use. Set to v1.
API version to target for this request.
Body
Request body for creating a new export job that filters audit logs and writes them in JSON Lines format.
Lower bound (inclusive) for filtering audit logs by occurred_at.
Only events with occurred_at >= from_date are exported.
"<timestamp>"
Search filters in the format column_name:search_string1,search_string2.
Multiple values for a single column are separated by commas. To combine
multiple q entries, use search_operator.
Logical operator used to combine multiple q filters:
or— export logs that match any search conditionand— export logs that match all search conditions
Upper bound (inclusive) for filtering audit logs by occurred_at.
Only events with occurred_at <= to_date are exported.
"<timestamp>"
Response
Request succeeded and an export job identifier is returned.
Was this page helpful?