BetterUnite API
Connect your website, data warehouse or your own tools to BetterUnite with the BetterUnite API. It lets an application read your organization's contacts, donations, campaigns and memberships.
The API is read-only. It reads records but can't create or change them. To have BetterUnite send you data the moment something happens, such as a new payment, use Webhook Integrations - Outbound. For no-code automations, see Zapier integration.
What you can read
| Area | What's included |
|---|---|
| Campaigns | Your campaigns, each campaign's ticket and gift options, its guests and participants, and its auction items with their bids |
| Contacts | Contact search, a single contact, a contact's donations, and your contact custom fields |
| Donations | Donation search, a single donation with its checkout custom fields, and your checkout custom-field definitions |
| Memberships | Membership plans, subscriptions and invoices |
The full list of endpoints, with every field and filter, is in the API reference (see below).
Step 1: Generate your API key
You need to be an administrator of your organization.
- Click the settings icon in the top navigation bar.
- Open Integrations, then the API Settings tab.
- Under Private API Key, click Generate key.
- Copy the key right away. It starts with
bu_live_.
We store your key hashed, so we can't show it to you again. If you lose it, click Regenerate to get a new one.
| 🔐 Treat your API key like a password. It can read all of your organization's contacts, donations and memberships. Keep it on your server or in your integration tool, and never put it in your website's code, where visitors can see it. If you think it has been exposed, click Regenerate: the old key stops working within a minute. |
|---|
The API Settings tab shows the start and last four characters of your current key, when it was created and when it was last used.
Step 2: Open the API reference
The API reference lists every endpoint you can call, what each returns and the filters it accepts. You can try calls from it, too.
- Open it from the link on the API Settings tab, or go to
https://app.betterunite.com/apiswagger. - It opens for administrators who are signed in to BetterUnite, and for requests that send your API key.
- To share it with a developer who doesn't have a BetterUnite login, click download it on the API Settingstab. It downloads an OpenAPI (Swagger) file that most API tools, such as Postman, can import.
Step 3: Make your first request
Send your key in the Authorization header of every request:
Authorization: Bearer bu_live_your_key_here
To check that your key works, call the ping endpoint:
curl https://app.betterunite.com/api/v1/ping \ -H "Authorization: Bearer bu_live_your_key_here"
Then, for example, list your active campaigns:
curl "https://app.betterunite.com/api/v1/campaigns?status=Active" \ -H "Authorization: Bearer bu_live_your_key_here"
Your key belongs to your organization, so every request only ever returns your organization's data. You never pass an organization id.
Paging through results
List endpoints return results one page at a time.
- Use
page(starting at 1) andpageSize(default 50, maximum 200). - Each response includes the page of results and the
Totalnumber of matching records, so you know how many pages there are.
Keeping your data in sync
The campaign and contact lists accept updatedSince. Pass the date and time of your last successful sync to get back only what changed since then, instead of reading everything again.
For donations, filter by startDate and endDate. For a real-time feed of new payments, use webhooks.
Limits
You can make up to 100 requests per minute for your organization. Past that, the API answers 429. Wait a moment and try again.
If a request fails
| Status | What it means |
|---|---|
| 400 | The request was malformed, for example a filter value the API doesn't recognize. |
| 401 | The key is missing, mistyped or no longer valid (for example, it was regenerated). |
| 403 | The credential isn't allowed to do this. |
| 404 | No such record in your organization. |
| 429 | Too many requests in the last minute. |
Errors include a traceId. If you contact support about a failed call, include the trace id: it lets us find that exact request.
Building an app for other organizations?
If you're building an application that other nonprofits will connect to their BetterUnite accounts, don't ask them for their API keys. The API also supports OAuth, where an administrator approves your app and chooses exactly what it can read. The API reference describes how it works.
Frequently asked questions
Can I add or update records through the API? Not yet. The API is read-only today.
Can I use the API to show a donation form or event on our website? You don't need the API for that. Use the campaign's embed codes or an embedded donation form. See How to embed donation pages to your website? and Embed Forms & Buttons.
Will changes to the API break my integration? The version is part of the address (/api/v1/). Within a version we only add things: new endpoints, new optional filters and new fields in responses. Make sure your integration ignores fields it doesn't recognize. Anything that would require you to change your code ships as a new version, and we give at least 12 months' notice before retiring a version that's in use.
Is a Postman collection available? Download the OpenAPI file from the API Settings tab and import it into Postman. Postman builds the collection from it.
Related articles
- Webhook Integrations - Outbound
- Zapier integration
- Embed Forms & Buttons
- BetterUnite AI Connector for Claude & ChatGPT