Skip to main content
HEAD
/
api
/
ledger
/
v2
/
{ledger}
/
accounts
Count the accounts from a ledger
curl --request HEAD \
  --url http://localhost/api/ledger/v2/{ledger}/accounts \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{}'
{
  "errorCode": "VALIDATION",
  "errorMessage": "[VALIDATION] invalid 'cursor' query param",
  "details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}

Documentation Index

Fetch the complete documentation index at: https://docs.formance.com/llms.txt

Use this file to discover all available pages before exploring further.

Returns the total count of accounts matching the filter criteria. The count is returned in the Count response header.

Parameters

ledger: The name of the ledger to count accounts from. (e.g., ledger001) pit: Point-in-time query. Returns the count as it existed at this timestamp. (e.g., 2024-01-15T10:30:00Z)

Request Body

Filter criteria. Use $match to filter by address pattern or metadata before counting. See Filtering Queries for full syntax. Example:
{
  "$match": {
    "address": "users::wallet"
  }
}

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

pit
string<date-time>

Body

application/json

The body is of type object.

Response

OK