Skip to main content
GET
/
api
/
ledger
/
v2
/
{ledger}
/
logs
List the logs from a ledger
curl --request GET \
  --url http://localhost/api/ledger/v2/{ledger}/logs \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{}'
{
  "cursor": {
    "pageSize": 15,
    "hasMore": false,
    "data": [
      {
        "id": 1234,
        "type": "NEW_TRANSACTION",
        "data": {},
        "hash": "9ee060170400f556b7e1575cb13f9db004f150a08355c7431c62bc639166431e",
        "date": "2023-11-07T05:31:56Z"
      }
    ],
    "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
    "next": ""
  }
}
Retrieve the immutable audit log of all ledger operations. Each log entry represents a state change (transaction created, metadata set, etc.).

Parameters

ledger: The name of the ledger to query logs from. (e.g., ledger001) pageSize: Number of logs to return per page. Defaults to 15, maximum 1000. (e.g., 100) cursor: Pagination cursor from a previous response. (e.g., aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==) pit: Point-in-time query. Returns logs as they existed at this timestamp. (e.g., 2024-01-15T10:30:00Z)

Request Body

Filter criteria. Use $match to filter by log type (NEW_TRANSACTION, SET_METADATA, REVERTED_TRANSACTION, DELETE_METADATA). See Filtering Queries for full syntax. Example:
{
  "$match": {
    "type": "NEW_TRANSACTION"
  }
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Path Parameters

ledger
string
required

Name of the ledger.

Example:

"ledger001"

Query Parameters

pageSize
integer<int64>

The maximum number of results to return per page.

Required range: 1 <= x <= 1000
cursor
string

Parameter used in pagination requests. Maximum page size is set to 15. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. No other parameters can be set when this parameter is set.

Example:

"aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="

pit
string<date-time>
sort
string

Sort results using a field name and order (ascending or descending). Format: <field>:<order>, where <field> is the field name and <order> is either asc or desc.

Example:

"id:desc"

Body

application/json

The body is of type object.

Response

OK

cursor
object
required