Skip to main content
GET
/
audit-logs
C#
using Gr4vy;
using Gr4vy.Models.Components;
using Gr4vy.Models.Requests;

var sdk = new Gr4vySDK(
    id: "example",
    server: SDKConfig.Server.Sandbox,
    bearerAuthSource: Auth.WithToken(privateKey),
    merchantAccountId: "default"
);

ListAuditLogsRequest req = new ListAuditLogsRequest() {};

ListAuditLogsResponse? res = await sdk.AuditLogs.ListAsync(req);

while(res != null)
{
    // handle items

    res = await res.Next!();
}
{
  "items": [
    {
      "resource": {
        "type": "<string>",
        "id": "<string>",
        "name": "<string>"
      },
      "action": "created",
      "user": {
        "name": "<string>",
        "is_staff": true,
        "status": "active",
        "type": "user",
        "id": "14b7b8c5-a6ba-4fb6-bbab-52d43c7f37ef",
        "email_address": "[email protected]"
      },
      "timestamp": "2023-11-07T05:31:56Z",
      "type": "audit-log",
      "id": "8d3fe99b-1422-42e6-bbb3-932d95ae5f79",
      "merchant_account_id": "default"
    }
  ],
  "limit": 20,
  "next_cursor": "ZXhhbXBsZTE",
  "previous_cursor": "Xkjss7asS"
}
This endpoint requires the audit-logs.read scope.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-gr4vy-merchant-account-id
string

The ID of the merchant account to use for this request.

Example:

"default"

Query Parameters

cursor
string | null

A pointer to the page of results to return.

Example:

"ZXhhbXBsZTE"

limit
integer
default:20

The maximum number of items that are at returned.

Required range: 1 <= x <= 100
Example:

20

action
enum<string> | null

Filters the results to only the items for which the audit-log has an action that matches this value.

Available options:
created,
updated,
deleted,
voided,
canceled,
captured
Example:

"created"

user_id
string<uuid> | null

Filters the results to only the items for which the user has an id that matches this value.

Example:

"14b7b8c5-a6ba-4fb6-bbab-52d43c7f37ef"

resource_type
string | null

Filters the results to only the items for which the audit-log has a resource that matches this type value.

Example:

"user"

Response

Successful Response

items
AuditLogEntry · object[]
required

A list of items returned for this request.

limit
integer
default:20

The number of items for this page.

Required range: 1 <= x <= 100
Example:

20

next_cursor
string | null

The cursor pointing at the next page of items.

Required string length: 1 - 1000
Example:

"ZXhhbXBsZTE"

previous_cursor
string | null

The cursor pointing at the previous page of items.

Required string length: 1 - 1000
Example:

"Xkjss7asS"