Skip to content
Dashboard
Theme
Theme

Export audit logs

POST /v1/audit_logs/exports: Export audit logs.

View Markdown

POST /v1/audit_logs/exports

Scope
audit:read
Auth
Secret key (sk_…)
Since
1.0
  • OhAuthCat-Version string

    Minor version; defaults to the environment’s pin.

  • Idempotency-Key string

    Honoured for 24 h; a replay returns the original response.

    min length 1 · max length 255

  • from string (date-time) Required

    RFC 3339, UTC.

  • to string (date-time) Required

    RFC 3339, UTC.

  • actor string

  • action string

  • target string

  • organization string

    Environment exports only (POST /v1/audit_logs/exports); the same organization filter as GET /v1/audit_logs. The account export rejects it.

Errors share one shape; see the error code catalogue.

curl -X POST \
"https://api.ohauthcat.com/v1/audit_logs/exports" \
-H "Authorization: Bearer $OHAUTHCAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "2026-01-15T09:30:00Z",
"to": "2026-01-15T09:30:00Z"
}'
Response 202
{
"id": "aexp_01J9Z3K5V7W8X9Y0Z1A2B3C4D5",
"object": "audit_log_export",
"state": "pending",
"url": "https://app.acme.com/callback",
"expires_at": "2026-01-15T09:30:00Z"
}