Skip to main content
The API has two versions. The version is the first segment of every path. Both use the same API key and the same rate limits, and you can call both from one integration. v1 keeps working and does not change. Every guide on this site uses v2.

What v2 is

v2 is not v1 with new paths. It has its own shapes, and every operation in it follows the same rules, so what you learn from one operation holds for the rest. v1 grew one route at a time and does not have that property: its lists have six different shapes, its totals three, and some responses carry placeholder names and logos. Pagination and formats and Errors state the v2 rules in full.

Config ids do not change

A config created on v1 is the same config on v2, with the same id. You do not create anything again or change anything on-chain. v2 reads every config, including one v1 created, and v1 reads every config that names only charities.

From v1 to v2

Each v1 operation and the v2 operation that does its job. The reference page of every v1 operation names its v2 form too. None of these is a rename. Read the v2 reference page before moving a call: the parameters and the response are v2’s own.

What to change when you move a call

  • Lists. Read items and nextCursor. Send nextCursor as cursor.
  • Totals. Read stats.totalUsdE6 where you read usdDonatedE6 or displayedUsdE6.
  • Recipients. Use config beneficiaries for every weighted profile, including the charities a campaign supports. Use lookup for summaries of individual references.
  • A config body. charityBeneficiaries: [{ charityId, weight }] becomes beneficiaries: [{ type: "charity", id, weight }].
  • A config id. id.hex becomes id, and id.base58 becomes idBase58.
  • Errors. Read message where you read error, and check the codes: some are new, and a missing or wrong key is 401 on v2.
  • Nulls. name and imageUrl can be null. Show your own fallback.
  • available. A recipient with available: false and a name is a stand-in: show it as it is.

Move the reads with the writes

v1 cannot describe a campaign. Once one of your configs names a campaign, these v1 reads stop working for it, so move them to v2 at the same time as config creation.

What is only on v1

The feed of new charities

To watch for newly listed charities, v1 has a feed. v2 lists the same charities newest first with GET /v2/charities?sort=newest, without the time each was listed.
  • Items are in the v1 charity shape. Take the id to v2.
  • Poll the feed to watch for new charities. It honours ETag and Last-Modified: an unchanged feed answers 304.

The rest

The reference lists every v1 operation under Earlier version (v1).

Runnable check