Skip to main content

Audit Log

Read the same audit trail as Settings → Audit log in the Admin Tool. Each entry is one recorded action for the organisation that owns the API key: an API call, a configuration change, a webhook delivery, a GDPR export, or an order import once order-import audit logging is enabled.
This endpoint follows the same switch as recording Management and Public API requests. While that switch is off, an authenticated call returns 404 and the log is not read. Do not rely on this endpoint in production until audit logging is turned on for your organisation’s Management API.
Permission: audit_log:read (Audit log read). A key without it receives 403. A missing or invalid key receives 401.

List audit log entries

The organisation comes from the API key. There is no organisation parameter. A caller cannot read another organisation’s log.

Query parameters

All filters are optional and combined with AND. An unknown parameter, including organisation_uid, returns 400.
string
One log type: api_call, config_change, webhook_delivery, gdpr_export, or order_import. Any other value returns 400.
string
One event type, such as api_read, api_phi_read, api_write, or api_auth_failed. Unknown values return 400.
string
Where the entry was recorded, such as management_api_v1, public_api_v2, or admin_api_v1.
boolean
true or false. Matches the stored success flag. For an order import, both success and success_with_warnings are stored as success=true.
string
success, success_with_warnings, or rejected.success=true includes warnings. outcome=success does not: it matches a successful entry that is not success_with_warnings. outcome=rejected matches a failed entry, or an entry whose payload outcome is rejected.Sending success and outcome together returns 400 when they disagree (success=true with rejected, or success=false with success or success_with_warnings).Warnings and refusals from order import appear only after order-import audit logging is enabled.
integer
Inclusive start, as unix seconds. created_at greater than or equal to this value.
integer
Exclusive end, as unix seconds. created_at less than this value. created_from later than created_to returns 400. Equal values match nothing.
string
Exact match, at most 255 characters. For a committed order import this is the internal order id. A refused import has no entity id and does not match this filter.
string
Exact match of the user who made a configuration change, GDPR export, or telemedicine-provider edit. At most 36 characters. API calls and order imports leave this empty and do not match.
string
Exact match of the API key identifier. This is not the secret, and it is a separate filter from actor_user_uid.
integer
default:"0"
Page number, starting at 0.
integer
default:"50"
Page size. Minimum 1, maximum 200.
Entries are newest first. When two entries share a timestamp, the higher id comes first. There is no default time window. Omit both timestamps to page the newest entries, subject to the cap below.

Pagination

The default page size is 50 and the maximum is 200. At most 10,000 matching entries are counted. When more match, totalRegistries is 10000, totalCapped is true, and totalPages is based on that cap. Pages past that window are empty. Narrow created_from and created_to, or the other filters, to reach older entries.

Rate limit

10 requests per second per IP address, shared with the rest of the Management API. A 429 is an HTML page that says Too Many Requests, not a JSON body, and it has no Retry-After header. See Rate limits.

Example: order import with warnings

order_import entries exist only after order-import audit logging is enabled.

Example: rejected API call

outcome is rejected because success is false, even when payload is null.

What is included

Every entry has the same fields. A field is null when nothing was stored. Included: the event type, outcome, IP address, user agent, API key identifier (never the secret), route template, request path with credential segments already redacted and query names only, the failed error body (at most 2,000 characters), the error message, the related entity id, and the event payload as it was stored.

What is never included

Request bodies, query-parameter values, successful response bodies, API key secrets, customer name or address, and the legacy meta_data bag. The response also omits internal columns expires_at, deleted_at, and updated_at.

Errors

Retention

This endpoint does not change how long entries are kept. Successful API reads that return no patient data are kept for 90 days. Reads of patient data, writes, failed requests, and this audit-log read itself are kept for 1 year. See Audit log.