API Reference

# List Credit Ledger

Page through the organization credit ledger, newest first: grants, purchases, refunds, adjustments, and every debit with its actor kind and the action...

Server URL`https://api.rankhog.com/`

POST

``/`agent`/`v1`/`credits`/`ledger`

Send

Authorization

Body

Page through the organization credit ledger, newest first: grants, purchases, refunds, adjustments, and every debit with its actor kind and the action, warm-up, purchase, or opportunity it paid for. Member names and user ids are never included. Cache policy: live. Idempotency: none. Auth modes: api\_key, mcp\_oauth, session\_bearer.

## [Authorization](/content/docs/api/reference/list_credit_ledger/index.html#authorization)

`apiKeyAuth`

AuthorizationBearer <token>

Rankhog organization API key sent as `Authorization: Bearer rhog_...`.

In: `header`

## [Request Body](/content/docs/api/reference/list_credit_ledger/index.html#request-body)

`application/json`

TypeScript Definitions

Use the request body type in TypeScript.

Copy

cursor?string

Opaque cursor from a previous response's nextCursor. Omit for the first page.

Length`1 <= length <= 1000`

limit?integer

Default`25`Range`1 <= value <= 100`

organizationId\*string

Length`1 <= length <= 160`

websiteId?string

Length`1 <= length <= 160`

## [Response Body](/content/docs/api/reference/list_credit_ledger/index.html#response-body)

### 200  `application/json`

### 400  `application/json`

### 401  `application/json`

### 403  `application/json`

### 404  `application/json`

### 500  `application/json`

cURL

JavaScript

Go

Python

Java

C#

```
curl -X POST "https://api.rankhog.com/agent/v1/credits/ledger" \
  -H "Authorization: Bearer " \
  -H "Content-Type: application/json" \
  -d '{
    "limit": 25,
    "organizationId": "org_2x9rnkhdemo",
    "websiteId": "site_2x9rnkhdemo"
  }'
```

200400401403404500

```
{
  "items": [\
    {\
      "actorKind": "system",\
      "bucket": "period",\
      "createdAt": "2026-06-17T11:46:08.000Z",\
      "entryType": "consumption",\
      "id": "cl_2x9consumption",\
      "quantity": -1,\
      "reason": null,\
      "reference": {\
        "opportunityId": "opp_2x9opportunity",\
        "plannedRedditActionId": "act_2x9planned",\
        "purchaseId": null,\
        "redditActionId": "ract_2x9rnkhdemo",\
        "warmupCreditId": null\
      },\
      "resourceKind": "comment",\
      "websiteId": "site_2x9rnkhdemo"\
    },\
    {\
      "actorKind": "user",\
      "bucket": "bank",\
      "createdAt": "2026-06-10T09:12:00.000Z",\
      "entryType": "purchase",\
      "id": "cl_2x9purchase",\
      "quantity": 250,\
      "reason": null,\
      "reference": {\
        "opportunityId": null,\
        "plannedRedditActionId": null,\
        "purchaseId": "pur_2x9rnkhdemo",\
        "redditActionId": null,\
        "warmupCreditId": null\
      },\
      "resourceKind": null,\
      "websiteId": null\
    },\
    {\
      "actorKind": "system",\
      "bucket": "period",\
      "createdAt": "2026-06-01T00:00:00.000Z",\
      "entryType": "period_grant",\
      "id": "cl_2x9periodgrant",\
      "quantity": 100,\
      "reason": null,\
      "reference": {\
        "opportunityId": null,\
        "plannedRedditActionId": null,\
        "purchaseId": null,\
        "redditActionId": null,\
        "warmupCreditId": null\
      },\
      "resourceKind": null,\
      "websiteId": "site_2x9rnkhdemo"\
    }\
  ],
  "nextCursor": "eyJjcmVhdGVkQXQiOiIyMDI2LTA2LTAxVDAwOjAwOjAwLjAwMFoiLCJpZCI6ImNsXzJ4OXBlcmlvZGdyYW50In0"
}
```

```
{
  "error": {
    "code": "agentic_invalid_input",
    "details": {
      "issues": [\
        {\
          "code": "invalid_type",\
          "message": "Expected string, received undefined.",\
          "path": [\
            "organizationId"\
          ]\
        }\
      ]
    },
    "message": "Request body did not match the agentic capability schema."
  }
}
```

### Missing authentication

```
{
  "error": {
    "code": "agentic_unauthorized",
    "message": "Authenticate before using Rankhog agentic capabilities."
  }
}
```

### Invalid API key

### Missing OAuth scope

```
{
  "error": {
    "code": "agentic_missing_scope",
    "details": {
      "missingScopes": [\
        "rankhog:read",\
        "credits:read"\
      ]
    },
    "message": "Missing required scope: rankhog:read, credits:read."
  }
}
```

### API key organization mismatch

### Organization access denied

```
{
  "error": {
    "code": "agentic_website_not_found",
    "message": "Website workspace not found."
  }
}
```

```
{
  "error": {
    "code": "agentic_internal_error",
    "message": "Rankhog could not complete this agentic request."
  }
}
```

[Get Credit BalancePOST\\
\\
Return the credit balance for an organization, or for one product when websiteId is set: period credits, organization bank, committed and spendable...](/content/docs/api/reference/get_credit_balance/index.html)
