Toast
API Reference

Audit

Query the audit trail with filtering and cursor-based pagination.

GET
/api/audit

Query audit logs with optional filters for resource type, actor, action, and date range. Results are returned newest first with cursor-based pagination.

Query Parameters

resourceType?string

Filter by resource type

resourceId?string

Filter by resource ID

actorId?string

Filter by actor ID

action?string

Filter by action

from?string

Start date (ISO 8601)

Formatdate-time
to?string

End date (ISO 8601)

Formatdate-time
limit?integer

Items per page

Range1 <= value <= 100
Default50
cursor?string

Pagination cursor

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/api/audit"
{  "data": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "actorType": "user",      "actorId": "string",      "actorName": "string",      "action": "string",      "resourceType": "string",      "resourceId": "string",      "changes": {        "before": {},        "after": {}      },      "metadata": {},      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "nextCursor": "string"}
{  "error": "string",  "details": [    {      "code": "string",      "message": "string",      "path": [        "string"      ]    }  ]}
{  "error": "string"}
GET
/api/audit/resource/{type}/{id}

Returns all audit events for a specific resource, newest first with cursor-based pagination.

Path Parameters

type*string

Resource type

id*string

Resource ID

Query Parameters

limit?integer
Range1 <= value <= 100
Default50
cursor?string

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/api/audit/resource/string/string"
{  "data": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "actorType": "user",      "actorId": "string",      "actorName": "string",      "action": "string",      "resourceType": "string",      "resourceId": "string",      "changes": {        "before": {},        "after": {}      },      "metadata": {},      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "nextCursor": "string"}
{  "error": "string",  "details": [    {      "code": "string",      "message": "string",      "path": [        "string"      ]    }  ]}
{  "error": "string"}
GET
/api/audit/actor/{id}

Returns all actions performed by a specific actor, newest first with cursor-based pagination.

Path Parameters

id*string

Actor ID

Query Parameters

limit?integer
Range1 <= value <= 100
Default50
cursor?string

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/api/audit/actor/string"
{  "data": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "actorType": "user",      "actorId": "string",      "actorName": "string",      "action": "string",      "resourceType": "string",      "resourceId": "string",      "changes": {        "before": {},        "after": {}      },      "metadata": {},      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "nextCursor": "string"}
{  "error": "string",  "details": [    {      "code": "string",      "message": "string",      "path": [        "string"      ]    }  ]}
{  "error": "string"}