> For the complete documentation index, see [llms.txt](https://docs.anedot.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.anedot.com/integrations/crm-donor-management/nationbuilder.md).

# NationBuilder

Connect NationBuilder to Anedot to add or update donors as people in your nation, record their donations, and relay fund and commitment data from Action Pages.

The **NationBuilder** integration adds or updates each donor as a person in your nation and records their donations from your Action Pages, and you set it up in **Settings > Integrations**. This article covers how to connect Anedot to NationBuilder, manage your connection, understand the data Anedot sends, find your data in NationBuilder, and troubleshoot requests.

## Before You Begin

* You need **Integrations: Edit permissions** in Anedot to add, edit, push, or delete a connection. Integrations: Edit permissions also require **Action Pages: View permissions** and **Integrations: View permissions**. See [Permission Sets](https://docs.anedot.com/settings/access/permission-sets.md).
* The NationBuilder user who approves the connection needs a permission set with **Sign into apps** turned on (under Integrations), or the admin permission set. Permission sets are in **Settings > Defaults > Permission sets** in NationBuilder.
* Have your nation slug ready. This is the part of your nation address before `.nationbuilder.com`.
* If you plan to send fund or commitment data, your nation needs custom fields. Custom fields are available as add-ons in NationBuilder, so contact NationBuilder if your nation doesn't have them.

{% hint style="info" %}
Anedot connects to your nation as the NationBuilder user who approves access. If that user can see only part of the people database, Anedot can read and update only those records.
{% endhint %}

## Connect Anedot to NationBuilder

### Step 1: Create Custom Fields in NationBuilder

You need this step only if you plan to check **Send fund data** or **Send commitment data** on the connection, or if you want to store the Anedot transaction ID and commitment ID on each donation. Create the fields before you connect in Anedot.

To create a custom field in NationBuilder:

1. Go to **Settings > Defaults > Custom fields** in your NationBuilder control panel.
2. Select the **Donations** tab for a field tied to a donation, or the **People** tab for a field stored on a person's profile.
3. Enter the field name. The name can match the slug.
4. Enter the slug exactly as shown in the tables below. Slugs can't contain spaces.
5. Choose the type shown in the tables below.
6. Click **Create field**.

The custom field is added to your nation and is ready to receive data from Anedot.

![NationBuilder: Settings, Custom fields, New custom field](https://1576281756-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQuNikYKWprVDzRjF4GER%2Fuploads%2FCKvt34GxyRMlsBopJ7ZR%2Fnb-new-custom-field.png?alt=media)

{% hint style="warning" %}
Once created, a custom field's slug and field type can't be changed. Check each slug before you click **Create field**.
{% endhint %}

{% hint style="danger" %}
Deleting a custom field in NationBuilder deletes all values stored in it.
{% endhint %}

Create these fields on the **Donations** tab:

| Name                       | Slug                       | Type | Filled When                       |
| -------------------------- | -------------------------- | ---- | --------------------------------- |
| `fund_id`                  | `fund_id`                  | Text | **Send fund data** is checked     |
| `fund_internal_identifier` | `fund_internal_identifier` | Text | **Send fund data** is checked     |
| `transaction_id`           | `transaction_id`           | Text | Always                            |
| `commitment_id`            | `commitment_id`            | Text | Always (empty for one-time gifts) |

![NationBuilder: Donations custom fields for fund data](https://1576281756-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQuNikYKWprVDzRjF4GER%2Fuploads%2FjAdpdfhz5TYgy8IvbBiv%2Fnb-donations-custom-fields.png?alt=media)

Create these fields on the **People** tab:

| Name               | Slug               | Type   | Filled When                         |
| ------------------ | ------------------ | ------ | ----------------------------------- |
| `cancelled_on`     | `cancelled_on`     | Text   | **Send commitment data** is checked |
| `created_on`       | `created_on`       | Text   | **Send commitment data** is checked |
| `frequency`        | `frequency`        | Text   | **Send commitment data** is checked |
| `action_page_name` | `action_page_name` | Text   | **Send commitment data** is checked |
| `amount`           | `amount`           | Number | **Send commitment data** is checked |
| `status`           | `status`           | Text   | **Send commitment data** is checked |

![NationBuilder: People custom fields for commitment data](https://1576281756-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQuNikYKWprVDzRjF4GER%2Fuploads%2FHkwTT9Z4BhSk2eXg4OZ2%2Fnb-people-custom-fields.png?alt=media)

{% hint style="info" %}
If your nation is on a network plan and the HQ nation shares custom field settings, new custom fields can only be created in the HQ nation.
{% endhint %}

### Step 2: Connect NationBuilder in Anedot

To connect NationBuilder in Anedot:

1. Go to **Settings > Integrations**.
2. Click **New integration**.
3. Choose **NationBuilder**. You'll find it under the **Supporter DB** category, or you can enter "NationBuilder" in the search box. The card reads "Authorize NationBuilder and send Action Page data to a nation."
4. Choose the Action Page scope:
   * Keep **All Action Pages** checked to include every Action Page, including pages you add later. (Optional) In **Exclude Pages**, enter a comma-separated list of Action Page IDs with no spaces.
   * Uncheck **All Action Pages** and choose **Selected pages** to pick specific pages.
5. Leave **Team** set to **All teams**.
6. Enter your nation slug in **Nation name**. Enter only the part before `.nationbuilder.com`. For example, for `yournation.nationbuilder.com`, enter `yournation`.
7. (Optional) Under **Custom fields**, check **Send fund data**, **Send commitment data**, or both.
8. Click **Continue to provider**.
9. Log in to NationBuilder.
10. Approve Anedot's access to your nation.

Anedot finishes the setup and returns you to **Settings > Integrations**, where your NationBuilder connection is listed.

{% hint style="info" %}
You can limit the connection to one Team after setup by editing it. See [Manage Your Connection](#manage-your-connection).
{% endhint %}

{% hint style="warning" %}
If the setup is interrupted, Anedot shows "OAuth setup failed" or "OAuth setup is missing information". Start again from **New integration**.
{% endhint %}

## Manage Your Connection

Each connection in **Settings > Integrations** has three actions: **Edit**, **Push unsent**, and **Delete**.

### Edit Your Connection

To edit your connection:

1. Go to **Settings > Integrations**.
2. Click **Edit** on the NationBuilder connection.
3. Update the Action Page scope, **Team**, **Name**, or the **Enabled** checkbox. To limit the connection to one Team, see [Teams](https://docs.anedot.com/settings/access/teams.md).
4. Click **Save integration**.

Your new settings apply to records sent from then on.

{% hint style="info" %}
Editing a connection doesn't re-send records that were already sent.
{% endhint %}

### Push Unsent Records

**Push unsent** resends submissions and recurring donations that failed or were never sent for a date range you choose.

* The date range can be up to 31 days.
* The start date must be within the last 12 months.
* Wait about five minutes between pushes.
* Commitment updates aren't included in a push.

The confirmation reads "Only failed relays will be sent; successful relays are not re-sent." For full steps, see [Push Unsent in Webhooks (API)](https://docs.anedot.com/integrations/integration-automation-tools/webhooks.md#push-unsent).

### Change Your Nation or Custom Field Options

To change the nation, the **Send fund data** or **Send commitment data** options, or the NationBuilder user Anedot connects as, delete the connection and connect again.

### Delete Your Connection

To delete your connection:

1. Go to **Settings > Integrations**.
2. Click **Delete** on the NationBuilder connection.
3. Confirm "Delete this integration?".

Anedot stops sending data to NationBuilder for this connection.

{% hint style="info" %}
Deleting the connection doesn't change data that's already in NationBuilder.
{% endhint %}

## Data Relays

Anedot sends records from Action Pages in the connection's scope when:

* A Lead Page submission is created.
* A donation submission on a Donation Page or Event Page is completed.
* A recurring donation (commitment payment) succeeds.
* A commitment is updated.

### People

For each submission or recurring donation, Anedot first adds or updates the donor as a person in NationBuilder. NationBuilder matches on the person data, such as email. If no person matches, NationBuilder creates a new person. Otherwise, it updates the existing person.

* Anedot sends `birthdate` on the person from a birthday-type custom field on the Action Page, whether or not **Send commitment data** is checked.
* When **Send commitment data** is checked and the record has a commitment, the person also includes `cancelled_on`, `created_on`, `frequency`, `action_page_name`, `amount`, and `status`. The `cancelled_on` and `created_on` values are ISO 8601 timestamps, and `amount` is the commitment amount in dollars as a number.
* When **Send commitment data** is unchecked, these commitment keys are left out.

{% hint style="warning" %}
If Anedot can't add or update the person, it doesn't send that submission's donations. The failed attempt appears in [Integration Requests](https://docs.anedot.com/integrations/relay-data-troubleshooting/integration-requests.md).
{% endhint %}

### Donations

After the person step, Anedot records each donation on that person for a Donation Page or Event Page submission or a recurring donation.

* A gift split across several [Funds](https://docs.anedot.com/settings/finance/funds.md) arrives as one NationBuilder donation per Fund.
* Donations to conduit Funds aren't sent.
* Lead Page submissions send only the person, with no donation.
* Every donation includes `transaction_id` (the Anedot transaction ID) and `commitment_id` (the Anedot commitment ID, empty for one-time gifts). To store these in NationBuilder, create the `transaction_id` and `commitment_id` donation custom fields.
* When **Send fund data** is checked, each donation also includes `fund_id` (the Fund's ID in Anedot) and `fund_internal_identifier` (the Fund's internal identifier from the Fund settings). When it's unchecked, these keys are left out.

### Recurring Tag

While the donor's commitment is active and has another payment scheduled, Anedot sends the tag "recurring" on the person. When the donor no longer has any active commitments, Anedot removes the "recurring" tag the next time it sends a submission or recurring donation for that donor. See [Commitments](https://docs.anedot.com/finance/management-and-reporting/commitments.md).

### Commitment Updates

When a commitment is updated, such as a cancellation or a change to the commitment, Anedot updates the person only. No donation is sent.

### Custom Field Labels

Anedot reads these custom field labels from the Action Page and sends their values on the donation. Add them as [Custom Form Fields](https://docs.anedot.com/action-pages/page-builder/custom-form-fields.md) or [Hidden Fields](https://docs.anedot.com/action-pages/page-builder/hidden-fields.md) with the exact label shown. Other custom fields aren't sent to NationBuilder.

* **note**: The donation note. If it's missing, Anedot sends "Received via Anedot Hosted.", where the word after Anedot is the donation's origin.
* **election\_cycle**, **election\_period**, **election\_period\_ngp\_code**: Sent inside `election` as `cycle`, `period`, and `period_ngp_code`.
* **is\_private**: Sent with the same name.
* **recruiter\_name\_or\_email**: Sent with the same name.
* **recruiter\_id**: A NationBuilder person ID. Anedot looks up that person in NationBuilder and sends their email as `recruiter_name_or_email`.
* **tracking\_code\_slug**: If it's missing, Anedot uses the source code of the original donation, then the submission's source code, then the Action Page's default source code, then "Anedot". See [Tracking Codes for Action Pages](https://docs.anedot.com/action-pages/advanced-features/tracking-codes-for-action-pages.md).
* **membership\_name**: Sent as the membership name.
* **actblue\_order\_number**: Sent with the same name.

The `mailing_slug` value comes from the UTM campaign (`utm_campaign`) on the page URL, not from a custom field.

### Delivery And Retries

* Each record is sent once per nation. Anedot doesn't resend a record that already reached the same nation successfully, unless you use **Push unsent** for records that failed.
* Every request is logged in **Settings > Integrations > Integration Requests** with its status (**Success**, **Failure**, or **Error**), request, and response. See [Integration Requests](https://docs.anedot.com/integrations/relay-data-troubleshooting/integration-requests.md).
* If NationBuilder limits requests or can't be reached, Anedot tries again automatically.
* Users with the **Integration sync failed** notification turned on get an email when Anedot can't add or update the person in NationBuilder. See [Notifications](https://docs.anedot.com/get-started/security/notifications.md).
* Repeated authorization errors from NationBuilder (401, 403, or 404) turn the connection off.
* Anedot sends requests to `https://<nation slug>.nationbuilder.com` using the NationBuilder API.

## Find Your Data in NationBuilder

Donors appear as people in your nation, and each donation is recorded on that person. Custom field values display within the person's profile for **People** fields and within the donation record for **Donations** fields.

{% hint style="success" %}
To see exactly what Anedot sent and how NationBuilder responded, open the request in **Settings > Integrations > Integration Requests** in Anedot.
{% endhint %}

## Field Mapping

### Person Fields

| Anedot Value                                                 | NationBuilder Field                                                                |
| ------------------------------------------------------------ | ---------------------------------------------------------------------------------- |
| Email                                                        | `email`                                                                            |
| First name                                                   | `first_name`                                                                       |
| Last name                                                    | `last_name`                                                                        |
| Phone                                                        | `phone`                                                                            |
| Birthday-type custom field response                          | `birthdate`                                                                        |
| Address line 1, line 2, city, postal code, region, country   | `mailing_address` (`address1`, `address2`, `city`, `zip`, `state`, `country_code`) |
| "recurring" when the commitment is active, otherwise empty   | `tags`                                                                             |
| Commitment canceled time (with **Send commitment data**)     | `cancelled_on`                                                                     |
| Commitment created time (with **Send commitment data**)      | `created_on`                                                                       |
| Commitment frequency (with **Send commitment data**)         | `frequency`                                                                        |
| Action Page name (with **Send commitment data**)             | `action_page_name`                                                                 |
| Commitment amount in dollars (with **Send commitment data**) | `amount`                                                                           |
| Commitment status (with **Send commitment data**)            | `status`                                                                           |

The `birthdate` value goes to NationBuilder's standard person birthdate field, so you don't need a custom field for it.

### Donation Fields

| Anedot Value                                                                              | NationBuilder Field                                                                                                            |
| ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Donation amount in cents                                                                  | `amount_in_cents`                                                                                                              |
| Anedot transaction ID                                                                     | `transaction_id`                                                                                                               |
| Anedot commitment ID (empty for one-time gifts)                                           | `commitment_id`                                                                                                                |
| NationBuilder person ID from the person step                                              | `donor_id`                                                                                                                     |
| Email, first name, last name                                                              | `email`, `first_name`, `last_name`                                                                                             |
| Employer, occupation                                                                      | `employer`, `occupation`                                                                                                       |
| Employer address line 1, city, state, ZIP                                                 | `work_address` (`address1`, `city`, `state`, `zip`)                                                                            |
| Donation address line 1, line 2, city, state, ZIP, country                                | `billing_address` (`address1`, `address2`, `city`, `state`, `zip`, `country_code`). Left out when the donation has no address. |
| Time the donation posted                                                                  | `succeeded_at`                                                                                                                 |
| Payment method                                                                            | `payment_type_ngp_code`                                                                                                        |
| UTM campaign                                                                              | `mailing_slug`                                                                                                                 |
| **note** custom field, or the default "Received via Anedot Hosted."                       | `note`                                                                                                                         |
| **tracking\_code\_slug** custom field, or the fallback order above                        | `tracking_code_slug`                                                                                                           |
| **election\_cycle**, **election\_period**, **election\_period\_ngp\_code** custom fields  | `election` (`cycle`, `period`, `period_ngp_code`)                                                                              |
| **is\_private**, **recruiter\_name\_or\_email**, **actblue\_order\_number** custom fields | `is_private`, `recruiter_name_or_email`, `actblue_order_number`                                                                |
| **membership\_name** custom field                                                         | `membership` (`name`)                                                                                                          |
| Fund ID (with **Send fund data**)                                                         | `fund_id`                                                                                                                      |
| Fund internal identifier (with **Send fund data**)                                        | `fund_internal_identifier`                                                                                                     |

### Payment Type Codes

| Payment Method | `payment_type_ngp_code` |
| -------------- | ----------------------- |
| Bank account   | E                       |
| Cash           | C                       |
| Check          | K                       |
| Credit card    | D                       |
| In-kind        | I                       |
| Offline card   | O                       |
| PayPal         | O                       |

## Payload Data

### Request Headers

Anedot sends these headers on every request. The access token is sent as the `access_token` query parameter, not as a header.

```json
{"User-Agent":"Anedot/b17216ad","Content-Type":"application/json","X-Integration-Id":"n6d219f500afcc547b61c"}
```

### Person Request Body

This example shows a person with **Send commitment data** checked and an active monthly commitment.

```json
{"person":{"email":"annie@anedot.com","last_name":"Dot","first_name":"Annie","phone":"2015550123","birthdate":"1995-03-29","mailing_address":{"address1":"1340 Poydras St","address2":null,"city":"New Orleans","zip":"70112","state":"LA","country_code":"US"},"tags":["recurring"],"cancelled_on":null,"created_on":"2026-03-29T13:18:42Z","frequency":"monthly","action_page_name":"Monthly Giving","amount":25.0,"status":"active"}}
```

### Donation Request Body

This example shows a credit card donation with **Send fund data** checked.

```json
{"donation":{"actblue_order_number":null,"amount_in_cents":2500,"commitment_id":null,"election":{"cycle":null,"period":null,"period_ngp_code":null},"email":"annie@anedot.com","employer":null,"first_name":"Annie","is_private":null,"last_name":"Dot","mailing_slug":null,"note":"Received via Anedot Hosted.","occupation":null,"payment_type_ngp_code":"D","recruiter_name_or_email":null,"succeeded_at":"2026-03-29T13:18:42Z","tracking_code_slug":"Anedot","transaction_id":"d3f9a1c27b84e5d60a1b2","work_address":{"address1":null,"city":null,"state":null,"zip":null},"billing_address":{"address1":"1340 Poydras St","address2":null,"city":"New Orleans","state":"LA","zip":"70112","country_code":"US"},"fund_id":"52681d6f-a6dd-4103-b84b-ddc0ae2be0a8","fund_internal_identifier":"1001","membership":{"name":null},"donor_id":14579}}
```

### Authorization Failure

This is the response NationBuilder returns when Anedot's access no longer works or the approving user lacks permission.

```json
{"code":"unauthorized","message":"You are not authorized to access this content. Your access token may be missing. The resource owner also may not have a permission level sufficient to grant access."}
```

## Troubleshooting

### No Request in Integration Requests

* Confirm the Action Page is in the connection's Action Page scope, and in its Team if one is set.
* Confirm the record is a type Anedot sends. See [Data Relays](#data-relays).

### Requests Show Failure

Open the request in **Settings > Integrations > Integration Requests** and read NationBuilder's response. A 401 or 403 "unauthorized" response means the access Anedot was given no longer works or the approving user lacks permission. Fix the user in NationBuilder, then delete the connection in Anedot and connect again.

### Missing Custom Field Values

* Confirm the NationBuilder custom field slugs match the slugs in this article exactly.
* Confirm **Send fund data** or **Send commitment data** is checked on the connection.
* For label-based fields, confirm the custom field label on the Action Page matches exactly.

After you fix the cause, use **Push unsent** to resend failed records.

### Connection Stops Sending

If the connection stops sending, or records keep failing after you confirm your setup, contact our Support team at <help@anedot.com>.

## Related Articles

* [Integrations](https://docs.anedot.com/integrations.md)
* [Integration Requests](https://docs.anedot.com/integrations/relay-data-troubleshooting/integration-requests.md)
* [Notifications](https://docs.anedot.com/get-started/security/notifications.md)
* [Custom Form Fields](https://docs.anedot.com/action-pages/page-builder/custom-form-fields.md)
* [Hidden Fields](https://docs.anedot.com/action-pages/page-builder/hidden-fields.md)
* [Commitments](https://docs.anedot.com/finance/management-and-reporting/commitments.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.anedot.com/integrations/crm-donor-management/nationbuilder.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
