> ## 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.

# Work with campaigns

> List fundraisers, show one with its goal and messages, give it a deposit address and follow a deposit

A campaign is a fundraiser. It has a name, a story, images, and usually a goal. People create
campaigns on donate.gg; the API reads them. A campaign is also a beneficiary: you can name one in a
config like a charity, with `"type": "campaign"`.

Every call on this page is public and on `https://api.donate.gg/api/v2`. The examples use a real
campaign, `cmr2icrm701xu04jxvybvmgwn`.

## Where a campaign comes from

Each campaign has a `source`:

| `source` | Meaning | `goalUsdE6` | `sourceUrl` |
| - | - | - | - |
| `donate` | Created on donate.gg | The campaign's goal, or `null` when it has none | `null` |
| `tiltify` | Imported from a campaign on Tiltify | Always `null` | The campaign's page at Tiltify |

An imported campaign's goal is `null` because the provider's goal counts support Donate does not
see. `stats` on any campaign is what was raised **through Donate**. More providers can be added, so
treat a `source` you do not know as an imported campaign.

> [!NOTE]
>
> Campaign imports from Tiltify are not open in production yet. Until they are, `source=tiltify`
> returns an empty list there.

## List campaigns

[`GET /v2/campaigns`](https://docs.donate.gg/api-reference/campaigns/list) returns the visible, active campaigns.

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

The answer is `{ "items": [...], "nextCursor": ... }`. One item, as an example:

```json theme={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",
  "sourceUrl": null,
  "goalUsdE6": "10000000000",
  "status": "active",
  "eligible": true,
  "categoryId": "community",
  "media": [
    {
      "type": "image",
      "url": "https://donategg-user-assets-prod.s3.us-east-1.amazonaws.com/image/e6a658a4-ee8a-4428-960d-56e16bfe9c91/1874bf55-7026-40be-a1ff-5fbedb6a0fd1.png"
    }
  ],
  "stats": {
    "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"
  },
  "createdAt": "2026-07-01T20:08:14.287Z"
}
```

| Parameter | Values |
| - | - |
| `sort` | `newest` (default), `oldest`, or `raised` for the highest `stats.totalUsdE6` first |
| `source` | `donate` or `tiltify`. Omit for both |
| `categoryId` | A category `id` from [`GET /v2/categories`](https://docs.donate.gg/api-reference/reference/categories/list), such as `community`. Any other value answers `400` |
| `limit` | 1 to 100. Default 25 |
| `cursor` | The `nextCursor` of the previous page, with the same `sort` and filters |

What to get right when you show a card:

* **The goal and the total use the same unit.** `goalUsdE6` and `stats.totalUsdE6` are both US
  dollars times 10^6 in a string: `"10000000000"` is $10,000 and `"13999894404"` is $13,999.89.
  Divide one by the other for a progress bar, with a big integer type.
* **`imageUrl` is the image for a card.** `media` holds every image and video. An item of type
  `image` has the image at `url`; an item of type `video` has a page that plays the video at `url`.
* **`url` is the campaign's page on donate.gg.** Linking to it is welcome.

[Pagination and formats](https://docs.donate.gg/api/pagination-and-formats.md#lists) explains `nextCursor`.

## Show one campaign

[`GET /v2/campaigns/{campaignId}`](https://docs.donate.gg/api-reference/campaigns/get) returns everything in a list item,
plus the story as plain text in `description`.

```bash theme={null}
curl "https://api.donate.gg/api/v2/campaigns/cmr2icrm701xu04jxvybvmgwn"
```

* `stats` is in the answer. Read the campaign again to refresh its total; there is no separate
  route for it.
* `eligible` is `true` when the campaign can be named in a new config. A list item has it too: an
  active campaign is listed before its recipients can be paid, with `eligible: false`.
* A completed campaign stays readable, with `status: "completed"` and `eligible: false`. It is no
  longer in the list.
* A hidden campaign answers `200` with `available: false` and a
  [stand-in](https://docs.donate.gg/api/pagination-and-formats.md#a-recipient-that-is-withheld) to show in its place:
  the name `Unavailable campaign`, an image, and `null` or empty for everything of its own. Its
  messages, donations and deposit routes answer `404`. Only an id that names no campaign is a
  `404` here.

[The coin page guide](https://docs.donate.gg/guides/coin-page.md#3-the-details-view) has the full response and the field
for each part of a details view.

## Show donation messages

[`GET /v2/campaigns/{campaignId}/messages`](https://docs.donate.gg/api-reference/campaigns/list-messages) lists the
public messages donors left, newest first.

```bash theme={null}
curl "https://api.donate.gg/api/v2/campaigns/cmr2icrm701xu04jxvybvmgwn/messages?limit=2"
```

One item, as an example. The donor's address is a placeholder nobody holds:

```json theme={null}
{
  "id": "cmrpkayih000a04ky4kc4pu57",
  "status": "settled",
  "message": "Kintara Wishing Well",
  "donor": {
    "chainId": 101,
    "address": "ExampLeWa11et1111111111111111111111111111111",
    "name": null,
    "imageUrl": null,
    "url": null
  },
  "coin": null,
  "amountAtomic": "13346508",
  "token": {
    "chainId": 101,
    "address": "So11111111111111111111111111111111111111112",
    "symbol": "SOL",
    "decimals": 9
  },
  "amountUsdE6": "1000184",
  "donatedAt": "2026-07-17T23:21:25.000Z",
  "unconfirmedAt": null
}
```

* `amountAtomic` is in the smallest unit of `token`. With `decimals: 9`, `"13346508"` is
  0.013346508 SOL. `amountUsdE6` is the same amount in US dollars times 10^6: `"1000184"` is \$1.00.
* Both amounts are **this campaign's part** of the donation. When a donation went through a config
  that splits between several beneficiaries, you see only the part attributed to this campaign.
* `donor` is the wallet that gave. `name`, `imageUrl` and `url` are `null` for a wallet nobody has
  named: show the address. The API sends no "Anonymous" in its place.
* `coin` is set when a coin's fees made the donation, as `{ "chainId", "address" }`. The donor's
  `name` is then the coin's name.
* `status` is `pending` or `settled`. `unconfirmedAt` is set while the chain no longer shows the
  donation as final; until that clears, the donation is left out of `stats`.
* `limit` is 1 to 50 and defaults to 25. The list pages with `nextCursor`.
* A page of messages is shared for a few seconds, so reading faster than every five seconds shows
  nothing new.

For every donation to the campaign, including the ones with no message and the ones still on their
way from another chain, use
[`GET /v2/campaigns/{campaignId}/donations`](https://docs.donate.gg/guides/track-a-donation#show-recent-donations). A
donation's row there has the same `message`, `amountAtomic`, `token` and `amountUsdE6` as its
message here.

## Give a campaign a deposit address

A campaign can have an address a donor sends tokens to directly, with no contract call. Donate
forwards what arrives as a donation to the campaign.

**1. List the chains the campaign accepts**

[`GET /v2/campaigns/{campaignId}/deposit-chains`](https://docs.donate.gg/api-reference/campaigns/list-deposit-chains)

```bash theme={null}
curl "https://api.donate.gg/api/v2/campaigns/cmr2icrm701xu04jxvybvmgwn/deposit-chains"
```

An example answer:

```json theme={null}
{
  "items": [{ "chainId": 1 }, { "chainId": 8453 }, { "chainId": 101 }],
  "nextCursor": null
}
```

A campaign that accepts no direct deposit returns an empty `items`.

**2. Get the address for a chain**

[`POST /v2/campaigns/{campaignId}/deposit-addresses`](https://docs.donate.gg/api-reference/campaigns/create-deposit-address)
takes the chain in the body. It is a `POST` because the first request for a chain creates the
address.

```bash theme={null}
curl -i -X POST "https://api.donate.gg/api/v2/campaigns/cmr2icrm701xu04jxvybvmgwn/deposit-addresses" \
  -H "content-type: application/json" \
  -d '{"chainId": 8453}'
```

`200` means the address exists. An example, with a placeholder address:

```json theme={null}
{
  "chainId": 8453,
  "status": "ready",
  "address": "0x1111111111111111111111111111111111111111",
  "retryAfterSeconds": null
}
```

`202` means the address is being created:

```json theme={null}
{ "chainId": 8453, "status": "provisioning", "address": null, "retryAfterSeconds": 3 }
```

Wait `retryAfterSeconds`, which is also the `Retry-After` header, and send the same request
again until you get `200`. Repeating the request never creates a second address, so keep the
address once it is ready. Show it only for the chain you asked about.

**3. Follow a deposit**

When the donor has sent, look up their transaction with
[`GET /v2/campaigns/{campaignId}/deposits/{chainId}/{transactionHash}`](https://docs.donate.gg/api-reference/campaigns/get-deposit).

```bash theme={null}
curl "https://api.donate.gg/api/v2/campaigns/cmr2icrm701xu04jxvybvmgwn/deposits/8453/0x8d2f6a1c4e7b9053d1a8c6e4f2b0d9a7c5e3f1b8d6a4c2e0f9b7d5a3c1e8f6b4"
```

An example answer:

```json theme={null}
{
  "chainId": 8453,
  "transactionHash": "0x8d2f6a1c4e7b9053d1a8c6e4f2b0d9a7c5e3f1b8d6a4c2e0f9b7d5a3c1e8f6b4",
  "status": "forwarding"
}
```

| `status` | Meaning |
| - | - |
| `not-detected` | Nothing has been recorded for this transaction **yet** |
| `detected` | The deposit has been seen |
| `forwarding` | Donate is sending it on as a donation |
| `delivering` | The donation is confirmed on-chain and is being recorded |
| `received` | The donation has been recorded for the campaign |
| `needs-review` | A person at Donate has to look at it before it continues |
| `reorged` | The chain replaced the block that held the transaction. Nothing is counted unless it lands again |

`not-detected` does not prove the transfer failed, so never treat it as a reason to send
again. Keep the transaction and ask again. This read keeps answering after a campaign ends or
is hidden, so a donor can always follow funds already sent.

What these three can answer besides a success:

| Status | `code` | When |
| - | - | - |
| `400` | `VALIDATION_ERROR` | The body or path is invalid, or the campaign takes no deposits on this chain |
| `404` | `NOT_FOUND` | No campaign has this id, or the campaign is hidden |
| `409` | `DEPOSITS_CLOSED` | The campaign exists and is not accepting deposits, such as one that has ended |
| `429` | `RATE_LIMIT_EXCEEDED` | The address route has its own budget. Wait for `Retry-After` seconds |
| `503` | `PROVIDER_UNAVAILABLE` | The address or the chains could not be read right now. Try again shortly |

The address route has its own budget on top of the normal [rate limit](https://docs.donate.gg/api/rate-limits.md): 10
requests a minute for one campaign and 100 an hour in all, counted per IP address. Store each
address you get instead of asking for it again.

## Name a campaign in a config

Use the campaign's `id` with `"type": "campaign"`:

```bash theme={null}
curl -X POST "https://api.donate.gg/api/v2/configs" \
  -H "donate-api-key: $DONATE_API_KEY" \
  -H "content-type: application/json" \
  -d '{"beneficiaries":[{"type":"campaign","id":"cmr2icrm701xu04jxvybvmgwn","weight":1}]}'
```

A campaign created on donate.gg passes its share on to its own receivers, so it can count for more
than one of the five receivers a config may reach. See
[configs and weights](https://docs.donate.gg/concepts.md#configs-and-weights).

## What the API does not do

* It does not create or edit campaigns. People do that on donate.gg.
* It does not import a Tiltify campaign from a link.
* It does not push updates. There are no webhooks; read again when you need newer data.

## Runnable sequence

```bash theme={null}
CAMPAIGN="cmr2icrm701xu04jxvybvmgwn"

# List, most raised first, and the categories for the categoryId filter
curl "https://api.donate.gg/api/v2/campaigns?sort=raised&limit=2"
curl "https://api.donate.gg/api/v2/categories"

# One campaign in full, with its total in stats
curl "https://api.donate.gg/api/v2/campaigns/$CAMPAIGN"

# Messages
curl "https://api.donate.gg/api/v2/campaigns/$CAMPAIGN/messages?limit=2"

# Deposit address: the chains first, then the address for one (200 ready, 202 being created)
curl "https://api.donate.gg/api/v2/campaigns/$CAMPAIGN/deposit-chains"
curl -i -X POST "https://api.donate.gg/api/v2/campaigns/$CAMPAIGN/deposit-addresses" \
  -H "content-type: application/json" \
  -d '{"chainId": 8453}'

# Follow a deposit. With a transaction nobody sent, the answer is not-detected.
curl "https://api.donate.gg/api/v2/campaigns/$CAMPAIGN/deposits/8453/0x8d2f6a1c4e7b9053d1a8c6e4f2b0d9a7c5e3f1b8d6a4c2e0f9b7d5a3c1e8f6b4"
```


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