audit-events
Stable. Describes behaviour that is built and covered by tests in this repository.
GET /v1/audit-events #
The audit log of the tenant, newest first
Who did what and when, for the actions that change money or access: API keys created, rotated and revoked; members invited, changed and removed; plan versions published; webhook endpoints created, changed, deleted and their secrets rolled; customers blocked and unblocked; credit notes and refunds; the operator's invoice actions; payment provider accounts connected, replaced, removed and made the default; the tenant's status and settings. Each entry has the actor (a person, an API key, the operator or the system), the target, a one-line summary with no secret in it, a small detail object, the address and the request id. The log is append-only: the database refuses any change to an entry. It is read from several services and merged; when one does not answer, incomplete is true and unavailable_sources names it. Needs the permission audit:read (an admin key has it; the read_only role does not). A person who is a viewer of the account may not read it.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
action | query | string | Action names such as api_key.created, or an area such as api_key.*, separated by commas |
actor | query | string | An actor id (user id, API key id) or an e-mail address |
target_type | query | string | |
target_id | query | string | |
from | query | string · date-time | Inclusive, RFC 3339 |
to | query | string · date-time | Exclusive, RFC 3339 |
page_size | query | integer | |
page_token | query | string |
Responses
| Status | Meaning | Body |
|---|---|---|
200 | OK | ListAuditEventsResponse |
400 | Error envelope | Error |
403 | Error envelope | Error |
Example response
{
"events": [
{
"id": "0192f0b4-6f6e-7c3a-9a3e-6a1f2b3c4d5e",
"tenant_id": "string",
"account_id": "string",
"actor_type": "user",
"actor_id": "string",
"actor_email": "string",
"action": "api_key.created",
"target_type": "string",
"target_id": "string",
"summary": "string",
"detail_json": "string",
"before_hash": "string",
"after_hash": "string",
"source_ip": "string",
"request_id": "string",
"create_time": "2026-11-03T10:15:00Z"
}
],
"next_page_token": "string",
"incomplete": false,
"unavailable_sources": [
"plans"
]
}curl
curl -X GET https://YOUR-API-ADDRESS/v1/audit-events \
-H "Authorization: Bearer $PAYRUDDER_API_KEY"GET /v1/audit-events/export #
The audit log as CSV (the newest 5000 entries of the filter)
The same filter as listAuditEvents, one line per entry with the columns id, create_time, tenant_id, account_id, actor_type, actor_id, actor_email, action, target_type, target_id, summary, detail (JSON), before_hash, after_hash, source_ip, request_id. A cell that starts with =, +, - or @ gets a leading ', so a spreadsheet does not run it. An export that cannot read every service fails with 503 audit.unavailable rather than leave entries out. Needs audit:read.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
action | query | string | Action names such as api_key.created, or an area such as api_key.*, separated by commas |
actor | query | string | An actor id (user id, API key id) or an e-mail address |
target_type | query | string | |
target_id | query | string | |
from | query | string · date-time | Inclusive, RFC 3339 |
to | query | string · date-time | Exclusive, RFC 3339 |
Responses
| Status | Meaning | Body |
|---|---|---|
200 | OK | |
400 | Error envelope | Error |
403 | Error envelope | Error |
503 | Error envelope | Error |
curl
curl -X GET https://YOUR-API-ADDRESS/v1/audit-events/export \
-H "Authorization: Bearer $PAYRUDDER_API_KEY"Models
AuditEvent
| Field | Type | Description |
|---|---|---|
id required | string · uuid | |
tenant_id required | string | Empty for an entry that belongs to no tenant |
account_id required | string | Set for an entry that is an account's and no tenant's (its members) |
actor_type required | user | api_key | operator | system | |
actor_id required | string | |
actor_email required | string | |
action required | string | <area>.<what>, for example api_key.created |
target_type required | string | |
target_id required | string | |
summary required | string | One line for a person; secrets are masked |
detail_json required | string | A small JSON object of what changed, as text; it holds no secret |
before_hash required | string | |
after_hash required | string | |
source_ip required | string | |
request_id required | string | |
create_time required | string · date-time |
Error
| Field | Type | Description |
|---|---|---|
error required | object |
ListAuditEventsResponse
| Field | Type | Description |
|---|---|---|
events required | array of AuditEvent | |
next_page_token required | string | |
incomplete required | boolean | A service that keeps part of the log did not answer: the page may lack its entries |
unavailable_sources required | array of plans | billing | payments |