Skip to main content

Get Audits

GET {{baseUrl}}/audits

Description

Retrieve audit logs based on specified filters.

Request

  • Headers:
    • Accept: /
  • URL: {{baseUrl}}/audits

Query Parameters

  • userId: myUserId
  • event: myEvent
  • entity: myEntity
  • entityId: 123456
  • entityUuid: myUuid
  • from: 2024-01-01
  • to: 2024-04-01
  • locale.baseLocale.language: en
  • locale.baseLocale.script: latin
  • locale.baseLocale.region: US
  • locale.baseLocale.variant: standard
  • page: 1 (One-based page index)
  • size: 20 (The size of the page to be returned)
  • sort: myProperty,asc (Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.)

Response

  • Status: OK (200)
  • Content-Type: /

Sample Request

curl --location -g '{{baseUrl}}/audits?userId=myUserId&event=myEvent&entity=myEntity&entityId=123456&entityUuid=myUuid&from=2024-01-01&to=2024-04-01&locale.baseLocale.language=en&locale.baseLocale.script=latin&locale.baseLocale.region=US&locale.baseLocale.variant=standard&page=1&size=20&sort=myProperty,asc' \
--header 'Accept: */*'

Sample Response

{
"message": "Success",
"data": [
{
"id": "auditId123",
"tenantId": "tenant123",
"merchantId": "merchant456",
"userId": "user789",
"event": "CREATED",
"entity": "product",
"entityId": 123456,
"oldValues": {},
"newValues": {
"name": "Updated Product Name",
"price": 29.99
},
"modified": ["name", "price"],
"uri": "/products/123456",
"ipAddress": "192.168.1.100",
"createdAt": "2024-04-15T12:30:45Z",
"updatedAt": "2024-04-15T12:35:20Z"
}
],
"meta": {
"currentPage": 1,
"from": 1,
"to": 1,
"perPage": 20,
"total": 1,
"lastPage": 1
}
}

LANGUAGE

AUTHORIZATION

Bearer

CURL REQUEST


curl --request GET \ 
--url /audits \
--header 'accept: application/json' \
--header 'content-type: application/json'

RESPONSE


Click Try It! to start a request and see the response here!