Get audit logs for team
curl --request GET \
--url https://api.projectdiscovery.io/v1/team/audit_log \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.projectdiscovery.io/v1/team/audit_log"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.projectdiscovery.io/v1/team/audit_log', 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.projectdiscovery.io/v1/team/audit_log",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$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.projectdiscovery.io/v1/team/audit_log"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
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.projectdiscovery.io/v1/team/audit_log")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.projectdiscovery.io/v1/team/audit_log")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"message": "<string>",
"data": [
{
"created_at": "<string>",
"email": "<string>",
"action": "<string>",
"status": 123,
"method": "<string>",
"ip": "<string>",
"path": "<string>",
"source": "api"
}
]
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Export & Logs
Get audit logs for team
GET
/
v1
/
team
/
audit_log
Get audit logs for team
curl --request GET \
--url https://api.projectdiscovery.io/v1/team/audit_log \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.projectdiscovery.io/v1/team/audit_log"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.projectdiscovery.io/v1/team/audit_log', 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.projectdiscovery.io/v1/team/audit_log",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$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.projectdiscovery.io/v1/team/audit_log"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
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.projectdiscovery.io/v1/team/audit_log")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.projectdiscovery.io/v1/team/audit_log")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"message": "<string>",
"data": [
{
"created_at": "<string>",
"email": "<string>",
"action": "<string>",
"status": 123,
"method": "<string>",
"ip": "<string>",
"path": "<string>",
"source": "api"
}
]
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Filtering Audit Logs
This endpoint supports multiple filter parameters to help you narrow down audit log entries:Date Filters
start_dateandend_date: Filter logs by custom date rangetime_range: Use predefined time ranges for quick filteringcurrent_month- Logs from the current monthlast_month- Logs from the previous monthlast_3_months- Logs from the last 3 monthslast_6_months- Logs from the last 6 monthslast_12_months- Logs from the last 12 months
Additional Filters
email: Filter by specific user emailaction: Filter by specific action name (e.g., endpoint path)source: Filter by the source of the audit log entryapi- Actions performed via APIplatform- Actions performed via the web platformunknown- Actions from unknown sources
Pagination
limit: Number of rows to return (default: 100, max: 100)offset: Number of rows to skip for pagination
Example Usage
Filter logs from the last month for a specific user:curl -X GET "https://api.projectdiscovery.io/v1/team/audit_log?time_range=last_month&email=user@example.com" \
-H "X-Api-Key: YOUR_API_KEY"
curl -X GET "https://api.projectdiscovery.io/v1/team/audit_log?source=api&start_date=2024-01-01&end_date=2024-01-31" \
-H "X-Api-Key: YOUR_API_KEY"
Headers
Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team
Query Parameters
Was this page helpful?