> ## Documentation Index
> Fetch the complete documentation index at: https://docs.donate.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# Pagination and formats

> How lists page, and how references, amounts, totals, ids, times and missing values are written

Every operation writes the same kind of value the same way. Learn each rule once.

## Lists

Every operation that returns more than one thing answers with the same object, whether or not
there can be a next page.

```json theme={null}
{
  "items": [],
  "nextCursor": null
}
```

To page, send `nextCursor` back as `cursor`. `null` means there is nothing more.

```bash theme={null}
curl "https://api.donate.gg/api/v2/campaigns?sort=raised&limit=2"
curl "https://api.donate.gg/api/v2/campaigns?sort=raised&limit=2&cursor=<nextCursor>"
```

* **A cursor belongs to one request.** Send it with the same filters and the same `sort` as the
  request that returned it. You may change `limit` between pages.
* **Any other cursor is an error.** A cursor that was edited, cut short, taken from another
  operation, or sent with a different filter answers `400 INVALID_CURSOR`. Start again without a
  cursor. The API never answers a bad cursor with the first page, so a loop cannot run forever on
  a stale one.
* **A cursor is opaque.** Nothing in it can be read, and it is at most 1,024 characters. Do not
  build or edit one.
* **A list of a project's own things is tied to the project.** A cursor from one project's
  `GET /v2/configs` is refused for another project's key.

### Page size

`limit` is a whole number written plainly, such as `25`. `025`, `25.0` and `1e1` are rejected.

| Operation | Default | Maximum | Pages |
| - | - | - | - |
| `GET /v2/beneficiaries` | 25 | 50 | Yes, best first |
| `GET /v2/charities` | 25 | 100 | Yes |
| `GET /v2/charities/{charityId}/donations` | 25 | 50 | Yes |
| `GET /v2/charities/{charityId}/messages` | 25 | 50 | Yes |
| `GET /v2/campaigns` | 25 | 100 | Yes |
| `GET /v2/campaigns/{campaignId}/donations` | 25 | 50 | Yes |
| `GET /v2/campaigns/{campaignId}/messages` | 25 | 50 | Yes |
| `GET /v2/configs` | 25 | 100 | Yes |
| `GET /v2/configs/{configId}/donors` | 25 | 100 | Yes |
| `GET /v2/coins` | 25 | 100 | Yes |
| `GET /v2/coin-creators` | 25 | 100 | Yes |
| `GET /v2/donation-sources/{chainId}/{address}/coins` | 25 | 100 | Yes |

The other lists (chains, categories, registers, register entries, deposit chains, donation
transfers and the beneficiaries of a config) are short, take no `limit`, and always have `nextCursor: null`.

## References

Config and coin reads identify recipients by `type` and `id`. For a coin page,
[read the beneficiaries of the config](https://docs.donate.gg/api-reference/configs/list-beneficiaries.md) to get their profiles and weights together.

```json theme={null}
{
  "id": "0x99fbb793f984a8c5f06693e13af3a2629479beac1c38169ec8b601faad71bce9",
  "idBase58": "BN5zs4C4zce2XBL3QjqV7LTjE51822i2jX4TPQ8DjM3v",
  "beneficiaries": [
    { "type": "charity", "id": "9b4dae4e-d8c1-4322-a594-35a4858296b2", "weight": "100" }
  ],
  "createdAt": "2026-04-29T17:41:06.212Z"
}
```

A config is a permanent split, and a name or a logo is not part of it. To show references, send
them to the lookup, up to 100 in one request. It is public, like the config read:

```bash theme={null}
curl "https://api.donate.gg/api/v2/beneficiaries/lookup?ids=charity:9b4dae4e-d8c1-4322-a594-35a4858296b2,campaign:cmr2icrm701xu04jxvybvmgwn"
```

```json theme={null}
{
  "items": [
    {
      "type": "charity",
      "id": "9b4dae4e-d8c1-4322-a594-35a4858296b2",
      "available": true,
      "name": "Make-A-Wish America",
      "imageUrl": "https://docs.candid.org/edoc/11142134",
      "url": "https://www.donate.gg/charities/make-a-wish-america",
      "source": null
    },
    {
      "type": "campaign",
      "id": "cmr2icrm701xu04jxvybvmgwn",
      "available": true,
      "name": "Kintara for St. Jude",
      "imageUrl": "https://donategg-user-assets-prod.s3.us-east-1.amazonaws.com/image/e6a658a4-ee8a-4428-960d-56e16bfe9c91/1874bf55-7026-40be-a1ff-5fbedb6a0fd1.png",
      "url": "https://www.donate.gg/campaigns/kintara-for-st-jude",
      "source": "donate"
    }
  ],
  "nextCursor": null
}
```

* Send at most 100 references, each `<type>:<id>`, separated by commas.
* The answer has one item for each different reference, in the order you asked. A reference you
  send twice is answered once.
* An id that names nothing comes back with `available: false` and `null` for `name`, `imageUrl`,
  `url` and `source`.
* A `type` can be `charity`, `campaign` or `user`. A config created through the API names
  charities and campaigns; a config created on donate.gg can also pay a person directly.

The same summary is what a search returns, and a charity or a campaign read in full starts with
the same fields, so one component can render all three.

### A recipient that is withheld

A config is permanent, so it can name a charity that has since been hidden or disabled, or that
has opted out of Donate, or a campaign that has since been hidden. Such a recipient still has to
be shown on a page that lists what a coin pays, so the API publishes a stand-in for it and never
its own profile. This is the stand-in for a charity:

```json theme={null}
{
  "type": "charity",
  "id": "5559ef9e-5ee8-535a-8da3-18ffe37aaeb3",
  "available": false,
  "name": "Donate Charity",
  "imageUrl": "https://www.donate.gg/web-app-manifest-512x512.png",
  "url": null,
  "source": null
}
```

* `available: false` with a `name` and an `imageUrl`: show them as they are. Do not link to a
  page, and do not look for more details.
* The stand-in is the same whatever the reason, and the API does not say why.
* A hidden campaign has the same stand-in in the lookup, with `"type": "campaign"` and the name
  `Unavailable campaign`.
* `GET /v2/charities/{charityId}` answers `200` for such a charity too, with the same stand-in,
  `eligible: false`, an empty `description` and `null` for everything else that is the
  charity's own, its `stats` included. Only an id that names no charity is a `404`.
* `GET /v2/campaigns/{campaignId}` answers `200` for a hidden campaign in the same way: the
  stand-in, `eligible: false`, an empty `description`, no `media` and `null` for everything else
  that is the campaign's own, its `status` and `stats` included. Only an id that names no
  campaign is a `404`.
* A withheld recipient cannot be named in a new config, is not in search results or lists, and
  its donations and messages answer `404`.
* One charity that has opted out is shown as itself: the Zoological Society of Cincinnati
  (`6e89a0e4-d663-517b-8934-be9f95f658d2`). The lookup and its own read answer its stored profile
  with `available: true`, `url: null` and `eligible: false`. Everything else above still holds
  for it.

## Money

No amount is ever a JSON number. An amount is an unsigned whole number in a string, and its name
says the unit.

| Name ends in | Unit | Example |
| - | - | - |
| `UsdE6` | US dollars multiplied by 10^6 | `"1250000"` is \$1.25 |
| `Atomic` | The smallest unit of the `token` beside it | `"13346508"` of a 9-decimal token is 0.013346508 |

Parse both with a big integer type. A JavaScript `Number` loses precision above 2^53, which an
18-decimal token passes at about 0.009 of a token.

A `token` says which currency an `Atomic` amount is in:

```json theme={null}
{
  "chainId": 101,
  "address": "So11111111111111111111111111111111111111112",
  "symbol": "SOL",
  "decimals": 9
}
```

Counts, ranks, decimals, basis points and chain ids are JSON integers.

## Totals

Wherever a total appears it is the same object, under the key `stats`.

```json theme={null}
{
  "totalUsdE6": "13999894404",
  "pendingUsdE6": "328679",
  "settledUsdE6": "13999565725",
  "donationCount": 558,
  "pendingCount": 2,
  "settledCount": 556,
  "firstDonationAt": "2026-06-30T21:01:47.000Z",
  "lastDonationAt": "2026-07-27T16:04:31.000Z"
}
```

| Field | Meaning |
| - | - |
| `totalUsdE6` | What to show. It is `pendingUsdE6` plus `settledUsdE6` |
| `pendingUsdE6`, `pendingCount` | Donations received and not yet settled, at the value quoted when they arrived |
| `settledUsdE6`, `settledCount` | Donations settled, at their final value |
| `donationCount` | `pendingCount` plus `settledCount` |
| `firstDonationAt`, `lastDonationAt` | `null` when there has been no donation |

A charity, a campaign and a coin carry their `stats`. A config's totals belong to the project that
created it, so they are a separate, keyed read: `GET /v2/configs/{configId}/stats`.

## Identifiers

| Thing | Form |
| - | - |
| Charity, campaign | An opaque string. Do not parse it or assume a format |
| Config | 32 bytes. `id` is lower-case `0x` hex, the `bytes32` an EVM donation names. `idBase58` is the same bytes as a Solana public key. A path accepts either |
| Chain | A number. `101` is Solana; EVM chains use their EIP-155 id. `GET /v2/chains` lists them |
| Coin | `chainId` and `address` together |
| Category | A short readable string such as `community`. `GET /v2/categories` lists them |
| Register | A short readable string such as `united-states`. `GET /v2/registers` lists them |

An `address` is always on-chain. A link to a page is a `url`.

## Times

Every instant is RFC 3339 in UTC with milliseconds, such as `2026-11-19T09:12:04.118Z`, and its
name ends in `At`.

## Images and links

`imageUrl`, `url` and `websiteUrl` are absolute `http` or `https` URLs, or `null`. `url` is the
thing's page on donate.gg; `websiteUrl` is its own site. When `imageUrl` is `null`, show your own
fallback: the API sends an image in place of a missing one only for a
[withheld recipient](#a-recipient-that-is-withheld).

## Missing values

Every field in the reference is always present in a response. A value that does not exist is
`null`, never a missing key. A list with nothing in it is `[]`. A `description` is always a
string, and is empty when there is none.

## Unknown input is refused

A query parameter or a body field the operation does not know answers `400`, with the name of the
field in `issues`. A misspelled filter cannot return unfiltered results.

## Fields can be added

A response can gain a field at any time. Ignore fields you do not know. A field is not removed or
renamed within a version.

## Runnable check

```bash theme={null}
# A list, and its next page
curl "https://api.donate.gg/api/v2/campaigns?sort=raised&limit=2"

# References to something to show, in one request
curl "https://api.donate.gg/api/v2/beneficiaries/lookup?ids=charity:9b4dae4e-d8c1-4322-a594-35a4858296b2,campaign:cmr2icrm701xu04jxvybvmgwn"

# A parameter the operation does not know is refused
curl "https://api.donate.gg/api/v2/campaigns?orderMode=total"
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.