Skip to content

Audit Logs & Data Exports

BoxBilling provides two operational features for visibility and data portability: audit logs record every change made to billing entities, and data exports let you extract billing data as CSV files for reporting, compliance, or migration.

Audit logs capture a trail of actions performed on billing resources. Every create, update, and delete operation is recorded with the actor, timestamp, and a snapshot of what changed.

FieldTypeDescription
iduuidUnique audit log entry identifier
organization_iduuidOrganization this entry belongs to
resource_typestringType of resource (e.g., customer, invoice, subscription)
resource_iduuidID of the affected resource
actionstringAction performed (e.g., create, update, delete)
changesobjectSnapshot of field changes
actor_typestringWho performed the action (e.g., user, system, api)
actor_idstring?ID of the actor, if applicable
metadata_object?Additional context about the action
created_atdatetimeWhen the action occurred

Query audit logs with optional filters to narrow results by resource, action, actor, or time range.

Terminal window
curl "/v1/audit_logs/?resource_type=invoice&action=update&start_date=2026-03-01T00:00:00Z&end_date=2026-03-08T23:59:59Z" \
-H "Authorization: Bearer $API_KEY"

Response (200):

[
{
"id": "a10e8400-e29b-41d4-a716-446655440000",
"organization_id": "org-uuid",
"resource_type": "invoice",
"resource_id": "inv-uuid-001",
"action": "update",
"changes": {
"status": {"old": "draft", "new": "finalized"}
},
"actor_type": "api",
"actor_id": "api-key-uuid",
"metadata_": null,
"created_at": "2026-03-05T14:30:00Z"
}
]

Filter parameters:

ParameterTypeDescription
resource_typestringFilter by resource type
resource_iduuidFilter by specific resource
actionstringFilter by action type
actor_typestringFilter by actor type
start_datedatetimeStart of time range
end_datedatetimeEnd of time range
skipintegerPagination offset (default: 0)
limitintegerPage size (default: 100, max: 1000)

Retrieve the full audit history for a specific resource by type and ID.

Terminal window
curl /v1/audit_logs/customer/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer $API_KEY"

This returns all audit log entries for that resource, ordered by time. Supports skip and limit for pagination.

Data exports let you extract billing data as CSV files. Exports run as background jobs — you create an export, monitor its progress, and download the file when it completes.

Create export ──► Processing (background)
Track progress (%)
Download CSV file
FieldTypeDescription
iduuidUnique export identifier
organization_iduuidOrganization this export belongs to
export_typestringType of data being exported
statusstringCurrent status (e.g., pending, processing, completed, failed)
filtersobject?Optional filters applied to the export
file_pathstring?Path to the generated file (set on completion)
record_countinteger?Number of records in the export
progressinteger?Completion percentage (0–100)
error_messagestring?Error details if the export failed
started_atdatetime?When processing began
completed_atdatetime?When processing finished
created_atdatetimeWhen the export was requested
TypeDescription
invoicesAll invoices
customersAll customers
subscriptionsAll subscriptions
eventsUsage and billing events
feesIndividual fee line items
credit_notesAll credit notes
audit_logsAudit log entries

Before creating an export, you can estimate how many records it will include.

Terminal window
curl -X POST /v1/data_exports/estimate \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"export_type": "invoices",
"filters": {
"start_date": "2026-01-01",
"end_date": "2026-03-08"
}
}'

Response (200):

{
"export_type": "invoices",
"record_count": 1250
}
Terminal window
curl -X POST /v1/data_exports/ \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"export_type": "invoices",
"filters": {
"start_date": "2026-01-01",
"end_date": "2026-03-08"
}
}'

Response (201):

{
"id": "b20e8400-e29b-41d4-a716-446655440000",
"organization_id": "org-uuid",
"export_type": "invoices",
"status": "pending",
"filters": {
"start_date": "2026-01-01",
"end_date": "2026-03-08"
},
"file_path": null,
"record_count": null,
"progress": 0,
"error_message": null,
"started_at": null,
"completed_at": null,
"created_at": "2026-03-08T10:00:00Z"
}

The export starts processing in the background. Poll the export by ID to check progress.

Terminal window
curl /v1/data_exports/b20e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer $API_KEY"

The progress field shows completion percentage and status transitions from pendingprocessingcompleted (or failed).

Once the export status is completed, download the CSV file.

Terminal window
curl /v1/data_exports/b20e8400-e29b-41d4-a716-446655440000/download \
-H "Authorization: Bearer $API_KEY" \
-o invoices-export.csv

Returns 400 if the export has not yet completed.

Terminal window
curl /v1/data_exports/ \
-H "Authorization: Bearer $API_KEY"

Supports pagination with skip and limit query parameters (default: 100 items, max: 1000). Use order_by to sort results.

MethodPathDescription
GET/v1/audit_logs/List audit logs with filters
GET/v1/audit_logs/{resource_type}/{resource_id}Get audit trail for a resource
POST/v1/data_exports/Create a data export
GET/v1/data_exports/List data exports
POST/v1/data_exports/estimateEstimate export size
GET/v1/data_exports/{export_id}Get export status
GET/v1/data_exports/{export_id}/downloadDownload export CSV