> 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 Anedot to NationBuilder to sync donation and lead data, create or update supporter records, and relay custom field information from Action Pages.

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

## NationBuilder

**NationBuilder** is a powerful CRM and CMS platform widely used by nonprofits and political organizations to manage supporters, campaigns, and content.

### Connecting Anedot to NationBuilder

Follow these steps to connect Anedot to NationBuilder:

1. In your Anedot account, navigate to Settings -> Integrations -> Directory.
2. Choose Action Pages:
   * All Action Pages are included by default.
   * To include only specific pages, enter their IDs (comma-separated).
3. Optionally, limit the connection to Team-specific data.
4. Enter your Nation Name.
5. Optionally, check the boxes to send Fund Data or Commitment Data.
   * Note: These options require extra setup.
6. Click Save. You'll be redirected to NationBuilder to log in and approve the connection.

You can update pages, Team settings, or login details anytime.

### Setup Custom Fields in NationBuilder

In order to relay the Transaction ID, Fund, and/or Commitment custom field data to NationBuilder, custom fields must be set up within NationBuilder.

#### Create Custom Fields in NationBuilder

![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)

1. Access the Settings tab in NationBuilder.
2. Under Nation defaults, select the Custom Fields tab.
3. Click the New Custom Field button in the top right corner.
4. Select the object you would like to add custom fields to.
   * Donations to Send Fund Data.
   * People (Signup) to Send Commitment Data.
5. Enter the Name, Slug, and Field Type (use the charts below).
6. Click Create Field to complete the setup.

> If you do not have access to create Custom Fields within NationBuilder, please contact NationBuilder Support directly.

#### Donations Send Fund Data

![NationBuilder — Custom fields → Donations with fund fields](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)

| Field Name                 | Slug                       | Field Type |
| -------------------------- | -------------------------- | ---------- |
| fund\_id                   | fund\_id                   | Text       |
| fund\_internal\_identifier | fund\_internal\_identifier | Text       |
| transaction\_id            | transaction\_id            | Text       |
| commitment\_id             | commitment\_id             | Text       |

#### People Send Commitment Data

![NationBuilder — Custom fields → People with commitment fields](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)

| Field Name         | Slug               | Field Type |
| ------------------ | ------------------ | ---------- |
| cancelled\_on      | cancelled\_on      | Text       |
| created\_on        | created\_on        | Text       |
| frequency          | frequency          | Text       |
| action\_page\_name | action\_page\_name | Text       |
| amount             | amount             | Number     |
| status             | status             | Text       |
| birthdate          | birthdate          | Text       |

### Data Relays

Anedot sends data to NationBuilder based on the type of Action Page used:

**1. Financial Pages&#x20;*****(Donation Pages)***

* Anedot relays **all donation details** along with any **custom field data**.
* A **"Person" event** is triggered for each submission:
  * If the donor is new, a **new contact** is created in NationBuilder.
  * If the donor already exists, their contact record is **updated**.

**2. Non-Financial Pages (Lead Pages)**

* Anedot sends only a **"Person" event**-no donation data is included.

**3. Viewing Donor Data in NationBuilder**

* Donor information will appear in the **People** tab and on the **NationBuilder Dashboard**.
* If a donor starts a recurring gift, NationBuilder will automatically apply a **"recurring" tag** to their profile when the commitment is created.

### Field Mapping

The Anedot Fields match the Submission's Raw Data, and the NationBuilder Fields match the Request Body relay.

#### Person Fields

| Anedot Field                                                   | NationBuilder Field                                                                        |
| -------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| "recurring" or null                                            | tags                                                                                       |
| email                                                          | email                                                                                      |
| lastName                                                       | last\_name                                                                                 |
| firstName                                                      | first\_name                                                                                |
| address (postalCode) (city) (region) (line1) (line2) (country) | mailing\_address (zip) (city) (state) (address1) (address2) (country\_code)                |
| birthdate (birthday custom field)                              | birthdate (birthday custom field response, appears under Demographics)                     |
| \*cancelled\_on                                                | cancelled\_on (timestamp of when the commitment was cancelled (e.g. 2024-03-29T12:38:38Z)) |
| \*created\_at                                                  | created\_on (timestamp of when the commitment was created (e.g. 2024-03-29T12:34:11Z))     |
| \*frequency                                                    | frequency (commitment frequency (e.g. monthly))                                            |
| \*action\_page\_name                                           | action\_page\_name (name of the commitment's AP (e.g. Page 6))                             |
| \*amount                                                       | amount (commitment amount (e.g. 25 ))                                                      |
| \*status                                                       | status (commitment status (e.g. active or inactive))                                       |

*\*Fields associated with the Send Commitment Data functionality.*

#### Donation Fields

The Anedot Fields match the Submission's Raw Data *(or the \*custom hidden fields)* and the NationBuilder Fields match the Request Body relay.

| Anedot Field                                                                                                                        | NationBuilder Field                                                                         |
| ----------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| \*note                                                                                                                              | note                                                                                        |
| email                                                                                                                               | email                                                                                       |
| person id (from the NB Person Relay Response Body)                                                                                  | donor\_id                                                                                   |
| \*election\_cycle                                                                                                                   | election\_cycle                                                                             |
| \*election\_period                                                                                                                  | election\_period                                                                            |
| \*election\_period\_ngp\_code                                                                                                       | election\_period\_ngp\_code                                                                 |
| employerName                                                                                                                        | employer                                                                                    |
| lastName                                                                                                                            | last\_name                                                                                  |
| firstName                                                                                                                           | first\_name                                                                                 |
| \*is\_private                                                                                                                       | is\_private                                                                                 |
| \*membership\_name                                                                                                                  | membership\_name                                                                            |
| occupation                                                                                                                          | occupation                                                                                  |
| \*\*utm\_campaign                                                                                                                   | mailing\_slug                                                                               |
| paymentRequests responseTime                                                                                                        | succeeded\_at                                                                               |
| donations (employerAddressPostalCode) (employerAddressCity) (employerAddressRegion) (employerAddressLine1) (employerAddressLine2)   | work\_address (zip) (city) (state) (address1) (address2)                                    |
| amount                                                                                                                              | amount\_in\_cents                                                                           |
| paymentMethod (postalCode) (city) (region) (line1) (line2) (country)                                                                | billing\_address (zip) (city) (state) (address1) (address2) (country\_code)                 |
| \*tracking\_code\_slug                                                                                                              | tracking\_code\_slug                                                                        |
| \*actblue\_order\_number                                                                                                            | actblue\_order\_number                                                                      |
| depends on the payment method: bank\_account: "E" cash: "C" check: "K" credit\_card: "D" in\_kind: "I" offline\_card or paypal: "O" | payment\_type\_ngp\_code                                                                    |
| \*recruiter\_name\_or\_email                                                                                                        | recruiter\_name\_or\_email                                                                  |
| \*\*\*fund\_id                                                                                                                      | fund\_id (fund UID (system generated) (e.g. 52681d6f-a6dd-4103-b84b-ddc0ae2be0a8 ))         |
| \*\*\*fund\_internal\_identifier                                                                                                    | fund\_internal\_identifier (fund internal identifier (set up in Fund Settings, e.g. 1001 )) |
| transaction\_id                                                                                                                     | transaction\_id                                                                             |
| commitment\_id                                                                                                                      | commitment\_id                                                                              |

> *\*Custom Hidden Fields must be added to the Anedot Action Page in order to be relayed.*
>
> *\*\* UTM Campaign can be added to the Page URL in the Action Page Builder.*
>
> *\*\*\*Fields associated with the Send Fund Data functionality.*

### Donation Payload

#### Request Headers

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

#### Request Body

Includes `Send Fund Data` fields (`fundID` and `fundInternalIdentifier`). If `Send Fund Data` is not enabled, the fields are set to `null`.

```json
{"donation":{"note":"Received via Anedot Hosted.","email":"annie@anedot.com","fundId":"52681d6f-a6dd-4103-b84b-ddc0ae2be0a8","donorId":14579,"election":{},"employer":null,"lastName":"Dot","firstName":"Annie","isPrivate":null,"membership":{},"occupation":null,"mailingSlug":null,"succeededAt":"2024-03-29T13:18:42.559Z","workAddress":{},"amountInCents":2500,"billingAddress":{"zip":"70112","city":"New Orleans","state":"LA","address1":"1340 Poydras St","countryCode":"US"},"trackingCodeSlug":"Anedot","actblueOrderNumber":null,"paymentTypeNgpCode":"O","recruiterNameOrEmail":null,"fundInternalIdentifier":"1001"}}
```

#### Response Body *(Success)*

Includes `Send Fund Data` fields (`fundId` and `fundInternalIdentifier`). If `Send Fund Data` is not enabled, the fields are set to `null`.

Includes `Send Commitment Data` fields (`cancelledOn`, `createdAt`, `frequency`, `actionPageName`, `amount`, `status`). Since this payload is for a Donation object, the responses are set to `null`.

```json
{"donation":{"id":2933,"note":"Received via Anedot Hosted.","donor":{"id":14579,"tags":[],"email":"annie@anedot.com","phone":"12015550123","birthdate":"2024-03-29","lastName":"Dot","createdAt":"2024-03-29T09:18:44-04:00","firstName":"Annie","updatedAt":"2024-03-29T09:18:45-04:00","doNotCall":false,"middleName":"","signupType":0,"emailOptIn":true,"hasFacebook":false,"isVolunteer":false,"doNotContact":false,"primaryAddress":{"zip":"70112","city":"New Orleans","zip5":"70112","state":"LA","address1":"1340 Poydras St","streetName":"Poydras","streetType":"St","countryCode":"US","streetNumber":"1340","streetPrefix":""},"isTwitterFollower":false,"profileImageUrlSsl":"https://assets.nationbuilder.com/assets/notifier/profile-avatar.png"},"email":"annie@anedot.com","amount":"$25.00","ngpId":null,"fundId":"52681d6f-a6dd-4103-b84b-ddc0ae2be0a8","donorId":14579,"election":null,"employer":null,"fecType":"Contribution","authorId":null,"failedAt":null,"importId":null,"lastName":"Dot","pageSlug":null,"pledgeId":null,"createdAt":"2024-03-29T09:18:45-04:00","firstName":"Annie","isPrivate":null,"membership":null,"occupation":null,"updatedAt":"2024-03-29T09:18:45-04:00","canceledAt":null,"middleName":null,"checkNumber":null,"mailingSlug":null,"succeededAt":"2024-03-29T09:18:42-04:00","workAddress":{},"authorization":null,"amountInCents":2500,"billingAddress":{"zip":"70112","city":"New Orleans","zip5":"70112","state":"LA","address1":"1340 Poydras St","streetName":"Poydras","streetType":"St","countryCode":"US","streetNumber":"1340","streetPrefix":""},"fecTypeNgpCode":"C","paymentTypeName":"Other","trackingCodeSlug":"anedot","merchantAccountId":null,"actblueOrderNumber":null,"paymentTypeNgpCode":"O","recurringDonationId":null,"corporateContribution":false,"recruiterNameOrEmail":"Annie Dot","fundInternalIdentifier":"1001"}}
```

#### Response Body *(Failure)*

```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."}
```

#### Response Body *(Error)*

```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."}
```

### Person Payload

#### Request Headers

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

#### Request Body

```json
{"person":{"tags":[],"email":"annie@anedot.com","phone":null,"birthdate":"1995-03-29","lastName":"Annie","firstName":"Dot","mailingAddress":{}}}
```

#### Response Body *(Success)*

Includes `Send Commitment Data` fields (`cancelledOn`, `createdAt`, `frequency`, `actionPageName`, `amount`, `status`). If `Send Commitment Data` is not selected, fields are set to `null`.

```json
{"person":{"id":14579,"tags":[],"email":"annie@anedot.com","email1":"annie@anedot.com","emails":[{"isBad":false,"isPrimary":true,"emailNumber":1,"emailAddress":"annie@anedot.com"}],"isDonor":true,"birthdate":"1995-03-29","fullName":"Annie Dot","lastName":"Dot","firstName":"Annie","middleName":"","createdAt":"2024-03-29T09:18:44-04:00","updatedAt":"2024-03-29T09:23:20-04:00","doNotCall":false,"signupType":0,"cancelledOn":null,"createdOn":null,"frequency":null,"amount":null,"status":null,"actionPageName":null,"emailOptIn":true,"isSupporter":true,"isVolunteer":false,"doNotContact":false,"billingAddress":{"zip":"70112","city":"New Orleans","zip5":"70112","state":"LA","address1":"1340 Poydras St","streetName":"Poydras","streetType":"St","countryCode":"US","streetNumber":"1340","streetPrefix":""},"donationsCount":1,"lastDonatedAt":"2024-03-29T09:18:42-04:00","firstDonatedAt":"2024-03-29T09:18:42-04:00","firstSupporterAt":"2024-03-29T09:18:44-04:00","lastFundraisedAt":"2024-03-29T09:18:42-04:00","firstFundraisedAt":"2024-03-29T09:18:42-04:00","donationsRaisedCount":1,"capitalAmountInCents":1500,"donationsAmountInCents":2500,"donationsRaisedAmountInCents":2500,"receivedCapitalAmountInCents":1500,"profileImageUrlSsl":"https://assets.nationbuilder.com/assets/notifier/profile-avatar.png","isLeaderboardable":true,"isProfilePrivate":false,"isProfileSearchable":true,"isTwitterFollower":false,"primaryEmailId":1,"couldVoteStatus":false,"federalDonotcall":false,"childrenCount":0,"recruitsCount":0,"warningsCount":0,"ruleViolationsCount":0,"overdueInvoicesCount":0,"donationsCountThisCycle":0,"spentCapitalAmountInCents":0,"closedInvoicesAmountInCents":0,"invoicePaymentsAmountInCents":0,"donationsPledgedAmountInCents":0,"donationsRaisedCountThisCycle":0,"donationsToRaiseAmountInCents":0,"donationsAmountThisCycleInCents":0,"isIgnoreDonationLimits":false,"isSurveyQuestionPrivate":false}}
```

#### Response Body *(Failure)*

```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."}
```

***

## 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language. `goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.


---

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