Skip to main content
POST
/
api
/
audit-logs
/
export
Create Export Job
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>"
}
'
{}

Authorizations

Authorization
string
header
required

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

X-Org-Name
string | null

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.

X-API-Version
string
default:v1

The API version to use. Set to v1. API version to target for this request.

Body

application/json

Request body for creating a new export job that filters audit logs and writes them in JSON Lines format.

from_date
string<date-time> | null

Lower bound (inclusive) for filtering audit logs by occurred_at. Only events with occurred_at >= from_date are exported.

Example:

"<timestamp>"

q
string[]

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.

search_operator
string
default:or

Logical operator used to combine multiple q filters:

  • or — export logs that match any search condition
  • and — export logs that match all search conditions
to_date
string<date-time> | null

Upper bound (inclusive) for filtering audit logs by occurred_at. Only events with occurred_at <= to_date are exported.

Example:

"<timestamp>"

Response

Request succeeded and an export job identifier is returned.

{key}
string<uuid>