Skip to content

Audit log

6 operations in the WP Waterfall API.

Export the company audit log

get/audit/exportPermalink to Export the company audit log

  • Scope: activity:read
  • Permission: activity.read

Streams the audit log of the active company for a date range as CSV (the default) or NDJSON (format=ndjson, one JSON object per line). Needs the activity.read permission, so a member limited to some sites cannot call it. The range starts at from and ends at to (default now), at most 92 days long: a longer span answers 422, and you read it in several requests. Rows come oldest first. Each row has the person or key, the action, the target, the address and browser, the stored details with secrets already removed, and its chain position and hashes (see the audit log help article for what the chain shows). The response is read from the database in steps, so a large log never sits in memory. At most 2 exports for one company run at once (429 past that). Every export writes an audit entry (audit.export) that names the range and format.

Parameters

NameInTypeDescription
from requiredquerystring (date-time)Start of the range, inclusive (RFC 3339).
toquerystring (date-time)End of the range, inclusive. Defaults to now. At most 92 days after from.
formatquerystringOne of: csv, ndjson. Default: csv.
actorquerystringKeep only what one person or API key did (the id on the activity list).
actionquerystringKeep only one action name, such as POST /v1/sites.

Responses

StatusBodyDescription
200stringThe rows as CSV, or as NDJSON when format is ndjson
400ProblemThe request could not be read: bad JSON, a bad header, or a malformed value.
401ProblemThe credentials are missing, expired, or revoked. The WWW-Authenticate header names the Bearer scheme.
403ProblemThe credentials are valid but may not do this: the role, the API key scope, or a required confirmation is missing.
422ProblemThe request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field.
429ProblemA rate limit was reached. Wait Retry-After seconds. Limits are per caller, per company, and per address.
4XXProblemProblem Details (RFC 9457)

List long audit log exports

get/audit/exportsPermalink to List long audit log exports

  • Scope: activity:read
  • Permission: activity.read

The long exports the company asked for, newest first, with their state: queued, building, ready, failed, or expired.

Parameters

NameInTypeDescription
limitqueryintegerHow many rows to return in one page: 1 to 200, and 50 when left out. Default: 50. Range: 1 to 200.
cursorquerystringThe next_cursor of the page before. Leave it out for the first page.

Responses

StatusBodyDescription
200AuditExportRequestListExport requests
400ProblemThe request could not be read: bad JSON, a bad header, or a malformed value.
401ProblemThe credentials are missing, expired, or revoked. The WWW-Authenticate header names the Bearer scheme.
403ProblemThe credentials are valid but may not do this: the role, the API key scope, or a required confirmation is missing.
422ProblemThe request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field.
429ProblemA rate limit was reached. Wait Retry-After seconds. Limits are per caller, per company, and per address.
4XXProblemProblem Details (RFC 9457)

200 response fields

NameTypeDescription
data requiredarray of AuditExportRequest
data[].id requiredstring (uuid)
data[].status requiredstringOne of: queued, building, ready, failed, expired.
data[].format requiredstringOne of: csv, ndjson.
data[].from requiredstring
data[].to requiredstring
data[].actor requiredstring or null
data[].action requiredstring or null
data[].requested_by requiredstring
data[].requested_at requiredstring (date-time)
data[].ready_at requiredstring or null (date-time)
data[].expires_at requiredstring or null (date-time)When the file leaves storage. Null until it is ready.
data[].rows requiredinteger or null
data[].size_bytes requiredinteger or null
data[].truncated requiredbooleanTrue when the file stopped at the row limit of the company's tier.
data[].error requiredstring or nullWhy a failed export failed, in plain words.
data[].download_count requiredinteger
data[].job_id requiredstring or null (uuid)
next_cursorstring or null

Ask for a long export of the company audit log

post/audit/exportsPermalink to Ask for a long export of the company audit log

  • Scope: activity:read
  • Permission: activity.read

Builds the audit log of the active company for a range of up to 396 days (13 months, as long as the log is kept) into a CSV or NDJSON file in the background, for ranges longer than the 92 days GET /audit/export streams. Needs the activity.read permission, so a member limited to some sites cannot call it. Answers 202 with the request. When the file is ready the person who asked gets a notice (and an email, per their notification settings), and POST /audit/exports/{id}/download-link gives a short-lived link. The file stays 48 hours. A start before the retention window answers 422. Limits follow the size of the company: a row limit per file (the file says when it stopped there) and a number of long exports per 24 hours; one export is built at a time (429 past either limit). The export writes an audit.export entry and the job writes its own entries.

Parameters

NameInTypeDescription
Idempotency-Key requiredheaderstringSend a fresh unique value on every POST: a POST without it answers 422. The answer is stored for 24 hours, so a retry with the same key and body returns the first answer, and the same key with a different body returns 422.

Request body application/json, required, StartAuditExportRequest

Fields

NameTypeDescription
from requiredstring (date-time)Start of the range, inclusive (RFC 3339). Not before the retention window.
tostring (date-time)End of the range, inclusive. Defaults to now.
formatstringOne of: csv, ndjson. Default: csv.
actorstringKeep only what one person or API key did (the id on the activity list).
actionstringKeep only one action name, such as POST /v1/sites.

Responses

StatusBodyDescription
202AuditExportRequestThe request that was queued
400ProblemThe request could not be read: bad JSON, a bad header, or a malformed value.
401ProblemThe credentials are missing, expired, or revoked. The WWW-Authenticate header names the Bearer scheme.
403ProblemThe credentials are valid but may not do this: the role, the API key scope, or a required confirmation is missing.
409ProblemThe current state does not allow this: the same change is already running, or another change got there first.
422ProblemThe request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field.
429ProblemA rate limit was reached. Wait Retry-After seconds. Limits are per caller, per company, and per address.
4XXProblemProblem Details (RFC 9457)

202 response fields

NameTypeDescription
id requiredstring (uuid)
status requiredstringOne of: queued, building, ready, failed, expired.
format requiredstringOne of: csv, ndjson.
from requiredstring
to requiredstring
actor requiredstring or null
action requiredstring or null
requested_by requiredstring
requested_at requiredstring (date-time)
ready_at requiredstring or null (date-time)
expires_at requiredstring or null (date-time)When the file leaves storage. Null until it is ready.
rows requiredinteger or null
size_bytes requiredinteger or null
truncated requiredbooleanTrue when the file stopped at the row limit of the company's tier.
error requiredstring or nullWhy a failed export failed, in plain words.
download_count requiredinteger
job_id requiredstring or null (uuid)

Read the limits for long audit log exports

get/audit/exports/limitsPermalink to Read the limits for long audit log exports

  • Scope: activity:read
  • Permission: activity.read

The tier of the company (from the number of sites), the row limit of one file, the long exports allowed in 24 hours and used so far, the retention in days, and how long a finished file stays.

Responses

StatusBodyDescription
200AuditExportLimitsThe limits
401ProblemThe credentials are missing, expired, or revoked. The WWW-Authenticate header names the Bearer scheme.
403ProblemThe credentials are valid but may not do this: the role, the API key scope, or a required confirmation is missing.
429ProblemA rate limit was reached. Wait Retry-After seconds. Limits are per caller, per company, and per address.
4XXProblemProblem Details (RFC 9457)

200 response fields

NameTypeDescription
tier requiredstringOne of: small, medium, large.
max_rows requiredinteger
per_day requiredinteger
used_today requiredinteger
retention_days requiredinteger
file_hours requiredinteger

Read one long audit log export

get/audit/exports/{id}Permalink to Read one long audit log export

  • Scope: activity:read
  • Permission: activity.read

Returns one long export of the audit log: its status (queued, building, ready, failed, or expired), the range and filters, the row count and size, truncated when the file stopped at the row limit, and expires_at, when the file leaves storage. Get the file with POST /audit/exports/{id}/download-link. A Site Admin or Site Developer gets 403.

Parameters

NameInTypeDescription
id requiredpathstring (uuid)The id of the audit log export.

Responses

StatusBodyDescription
200AuditExportRequestThe export request
400ProblemThe request could not be read: bad JSON, a bad header, or a malformed value.
401ProblemThe credentials are missing, expired, or revoked. The WWW-Authenticate header names the Bearer scheme.
403ProblemThe credentials are valid but may not do this: the role, the API key scope, or a required confirmation is missing.
404ProblemThe thing in the path does not exist, or it belongs to another company. The answer is the same for both.
422ProblemThe request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field.
429ProblemA rate limit was reached. Wait Retry-After seconds. Limits are per caller, per company, and per address.
4XXProblemProblem Details (RFC 9457)

200 response fields

NameTypeDescription
id requiredstring (uuid)
status requiredstringOne of: queued, building, ready, failed, expired.
format requiredstringOne of: csv, ndjson.
from requiredstring
to requiredstring
actor requiredstring or null
action requiredstring or null
requested_by requiredstring
requested_at requiredstring (date-time)
ready_at requiredstring or null (date-time)
expires_at requiredstring or null (date-time)When the file leaves storage. Null until it is ready.
rows requiredinteger or null
size_bytes requiredinteger or null
truncated requiredbooleanTrue when the file stopped at the row limit of the company's tier.
error requiredstring or nullWhy a failed export failed, in plain words.
download_count requiredinteger
job_id requiredstring or null (uuid)

Get a download link for a finished audit log export

post/audit/exports/{id}/download-linkPermalink to Get a download link for a finished audit log export

  • Scope: activity:read
  • Permission: activity.read

A signed link that works for 15 minutes and downloads the file. Answers 409 until the export is ready, 410 once it expired, and 503 where the server has no download storage. Each call is written to the audit log.

Parameters

NameInTypeDescription
id requiredpathstring (uuid)The id of the audit log export.
Idempotency-Key requiredheaderstringSend a fresh unique value on every POST: a POST without it answers 422. The answer is stored for 24 hours, so a retry with the same key and body returns the first answer, and the same key with a different body returns 422.

Responses

StatusBodyDescription
200AuditExportDownloadLinkThe link
400ProblemThe request could not be read: bad JSON, a bad header, or a malformed value.
401ProblemThe credentials are missing, expired, or revoked. The WWW-Authenticate header names the Bearer scheme.
403ProblemThe credentials are valid but may not do this: the role, the API key scope, or a required confirmation is missing.
404ProblemThe thing in the path does not exist, or it belongs to another company. The answer is the same for both.
409ProblemThe current state does not allow this: the same change is already running, or another change got there first.
422ProblemThe request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field.
429ProblemA rate limit was reached. Wait Retry-After seconds. Limits are per caller, per company, and per address.
4XXProblemProblem Details (RFC 9457)

200 response fields

NameTypeDescription
url requiredstring (uri)
expires_at requiredstring (date-time)
filename requiredstring