"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 asource:
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.
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 returns the visible, active campaigns.
{ "items": [...], "nextCursor": ... }. One item, as an example:
What to get right when you show a card:
- The goal and the total use the same unit.
goalUsdE6andstats.totalUsdE6are 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. imageUrlis the image for a card.mediaholds every image and video. An item of typeimagehas the image aturl; an item of typevideohas a page that plays the video aturl.urlis the campaign’s page on donate.gg. Linking to it is welcome.
nextCursor.
Show one campaign
GET /v2/campaigns/{campaignId} returns everything in a list item,
plus the story as plain text in description.
statsis in the answer. Read the campaign again to refresh its total; there is no separate route for it.eligibleistruewhen 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, witheligible: false.- A completed campaign stays readable, with
status: "completed"andeligible: false. It is no longer in the list. - A hidden campaign answers
200withavailable: falseand a stand-in to show in its place: the nameUnavailable campaign, an image, andnullor empty for everything of its own. Its messages, donations and deposit routes answer404. Only an id that names no campaign is a404here.
Show donation messages
GET /v2/campaigns/{campaignId}/messages lists the
public messages donors left, newest first.
amountAtomicis in the smallest unit oftoken. Withdecimals: 9,"13346508"is 0.013346508 SOL.amountUsdE6is 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.
donoris the wallet that gave.name,imageUrlandurlarenullfor a wallet nobody has named: show the address. The API sends no “Anonymous” in its place.coinis set when a coin’s fees made the donation, as{ "chainId", "address" }. The donor’snameis then the coin’s name.statusispendingorsettled.unconfirmedAtis set while the chain no longer shows the donation as final; until that clears, the donation is left out ofstats.limitis 1 to 50 and defaults to 25. The list pages withnextCursor.- A page of messages is shared for a few seconds, so reading faster than every five seconds shows nothing new.
GET /v2/campaigns/{campaignId}/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-chainsitems.2
Get the address for a chain
POST /v2/campaigns/{campaignId}/deposit-addresses
takes the chain in the body. It is a POST because the first request for a chain creates the
address.200 means the address exists. An example, with a placeholder address:202 means the address is being created: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
An example answer:
GET /v2/campaigns/{campaignId}/deposits/{chainId}/{transactionHash}.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.
The address route has its own budget on top of the normal rate limit: 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’sid with "type": "campaign":
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.