Create an audit export
curl --request POST \
--url https://api.example.com/v1/audit/exports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entityType": "credential_access",
"periodFrom": "2026-01-01T00:00:00-03:00",
"periodTo": "2026-01-31T23:59:59.999999-03:00",
"format": "CSV"
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/audit/exports"
payload := strings.NewReader("{\n \"entityType\": \"credential_access\",\n \"periodFrom\": \"2026-01-01T00:00:00-03:00\",\n \"periodTo\": \"2026-01-31T23:59:59.999999-03:00\",\n \"format\": \"CSV\"\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))
}const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
entityType: 'credential_access',
periodFrom: '2026-01-01T00:00:00-03:00',
periodTo: '2026-01-31T23:59:59.999999-03:00',
format: 'CSV'
})
};
fetch('https://api.example.com/v1/audit/exports', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.example.com/v1/audit/exports"
payload = {
"entityType": "credential_access",
"periodFrom": "2026-01-01T00:00:00-03:00",
"periodTo": "2026-01-31T23:59:59.999999-03:00",
"format": "CSV"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"entityType": "<string>",
"format": "<string>",
"id": "<string>",
"periodFrom": "2023-11-07T05:31:56Z",
"periodTo": "2023-11-07T05:31:56Z",
"requestedAt": "2023-11-07T05:31:56Z",
"requestedBy": "<string>",
"status": "<string>",
"completedAt": "2023-11-07T05:31:56Z",
"failureReason": "<string>",
"recordCount": 123,
"sha256Hash": "<string>",
"sizeBytes": 123
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}Create an audit export
Enqueues an asynchronous audit export (status GENERATING) for the given entity type, format, and RFC3339 window. The date range is capped at 365 days; a second concurrent export for the same entity type returns 409. The export generator worker materializes the object.
POST
/
v1
/
audit
/
exports
Create an audit export
curl --request POST \
--url https://api.example.com/v1/audit/exports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entityType": "credential_access",
"periodFrom": "2026-01-01T00:00:00-03:00",
"periodTo": "2026-01-31T23:59:59.999999-03:00",
"format": "CSV"
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/audit/exports"
payload := strings.NewReader("{\n \"entityType\": \"credential_access\",\n \"periodFrom\": \"2026-01-01T00:00:00-03:00\",\n \"periodTo\": \"2026-01-31T23:59:59.999999-03:00\",\n \"format\": \"CSV\"\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))
}const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
entityType: 'credential_access',
periodFrom: '2026-01-01T00:00:00-03:00',
periodTo: '2026-01-31T23:59:59.999999-03:00',
format: 'CSV'
})
};
fetch('https://api.example.com/v1/audit/exports', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.example.com/v1/audit/exports"
payload = {
"entityType": "credential_access",
"periodFrom": "2026-01-01T00:00:00-03:00",
"periodTo": "2026-01-31T23:59:59.999999-03:00",
"format": "CSV"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"entityType": "<string>",
"format": "<string>",
"id": "<string>",
"periodFrom": "2023-11-07T05:31:56Z",
"periodTo": "2023-11-07T05:31:56Z",
"requestedAt": "2023-11-07T05:31:56Z",
"requestedBy": "<string>",
"status": "<string>",
"completedAt": "2023-11-07T05:31:56Z",
"failureReason": "<string>",
"recordCount": 123,
"sha256Hash": "<string>",
"sizeBytes": 123
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}Body
application/json
Audit export creation payload
Response
Accepted
Was this page helpful?

