Need help with your APIs? I offer API discovery, governance & evangelism services. Explore services →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

NationBuilder Ballots API

Ballots are a record of an election and how a person voted for said election. Each ballot is associated with a voter and an election and contains information such as when the ballot was cast, the party, and vote method. Further information about vote history and ballots available [here](https://support.nationbuilder.com/en/articles/2471330-import-vote-history).

NationBuilder Ballots API is one of 41 APIs that NationBuilder publishes on the APIs.io network, described by a machine-readable OpenAPI specification.

Tagged areas include Ballots. The published artifact set on APIs.io includes an OpenAPI specification, API documentation, an API reference, and a getting-started guide.

This API exposes 5 operations across 2 paths, and defines 21 schemas. It is described by OpenAPI 3.1.2, at version 2.0.

Requests are made against a single base URL, https://{subdomain}.nationbuilder.com.

5 operations 2 paths 21 schemas 1 DELETE2 GET1 PATCH1 POST

Metadata

The identity and technical contract details declared by the specification.

Specification
OpenAPI 3.1.2
API Version
2.0
Base URL
https://{nation-slug}.nationbuilder.com/api/v2
Authentication
HTTP Bearer
Resource Areas
1

Authentication & Security 1

NationBuilder Ballots API declares 1 security scheme for authenticating requests. It accepts HTTP bearer tokens (JWT) (BearerAuth). By default, every request must be authenticated.

  • BearerAuth — Authentication using a bearer token (JWT) issued via OAuth.

Paths & Operations 5

Across 2 paths, the API surfaces 5 operations — 1 DELETE, 2 GET, 1 PATCH, 1 POST. Each is listed below with its method, path, parameters, and response codes.

Ballots 5

Ballots are a record of an election and how a person voted for said election. Each ballot is associated with a voter and an election and contains information such as when the ball…

POST
/api/v2/ballots
Create a ballot
createBallot 2 params body → 201400401422429
GET
/api/v2/ballots
List all ballots in a nation
listBallots 4 params → 200401429
GET
/api/v2/ballots/{id}
Show ballot with provided ID
showBallot 3 params → 200401404429
PATCH
/api/v2/ballots/{id}
Update an existing ballot
updateBallot 3 params body → 200400401404422429
DELETE
/api/v2/ballots/{id}
Delete ballot with provided ID
deleteBallot 3 params → 200401404429

Schemas 21

The contract defines 21 schemas that model the data the API accepts and returns. The most detailed are validation_error (6 properties), pagination_links (5 properties), ballot_read_write_attributes (5 properties), index_document (4 properties). Each schema is shown below with its type and property counts.

error_response
object
The error body returned for 4xx and 5xx responses, with a machine-readable code and a human-readable message. Some errors include additional detail members alo…
2 properties 2 required
ballot_update_request
The request body for updating an existing ballot.
show_document
object
The JSON:API top-level document shape for responses returning a single resource under the data member.
3 properties 1 required
ballot_response_data
The JSON:API resource object representing a ballot.
ballot_show_response
A JSON:API response containing a single ballot.
resource_identifier
object
A JSON:API resource identifier object, the type/id pair that uniquely identifies a single resource.
2 properties 2 required
pagination_links
object
JSON:API pagination links for the pages of a collection. A key whose page is unavailable, or that the server's pagination strategy does not provide, is omitted…
5 properties
ballot_index_response
A paginated JSON:API response containing a list of ballots.
ballot_create_request
The request body for creating a new ballot.
index_document
object
The JSON:API top-level document shape for paginated collection responses, with resource objects under data and pagination links.
4 properties 1 required
validation_error
object
A single JSON:API error object describing a validation failure, locating the invalid field via source.pointer and carrying the model-level attribute, message,…
6 properties
ballot_sideload_values
string
Relationship names that can be sideloaded with the include query parameter on ballot endpoints.
ballot_read_write_attributes
object
The attributes of a ballot that can be both read and written.
5 properties
ballot_field_values
string
Readable ballot attribute names selectable with sparse fieldsets (fields[ballots]).
delete_document
object
The successful destroy response, an empty JSON:API meta-only document returned with status 200 (rather than JSON:API's commonly used 204 No Content).
1 property 1 required
rate_limited_response
object
The body returned by the rate limiter when an access token exceeds its request quota.
1 property 1 required
validation_error_document
object
The JSON:API errors document returned with status 422 when model validations fail on create or update. Unlike this API's flat 4xx error bodies, validation fail…
1 property 1 required
update_request_document
object
The JSON:API top-level document shape for update requests, whose data member identifies the resource by type and id and carries the changed attributes.
1 property 1 required
create_request_document
object
The JSON:API top-level document shape for create requests, whose data member carries the new resource's type and attributes.
1 property 1 required
resource
A generic JSON:API resource object. Resources sideloaded in a document's included member use this shape; their attributes are those of the resource type named…
included
array
Sideloaded resources requested via the include query parameter. Each entry is a full resource object whose shape is documented under its own resource type.

Specification

The full machine-readable OpenAPI contract behind this narrative.

Source

nationbuilder-ballots-api-openapi.yml Raw ↑

Other APIs NationBuilder publishes across the network.

NationBuilder Async Processes API
NationBuilder Automation Enrollments API
NationBuilder Automations API
NationBuilder Broadcasters API
NationBuilder Contacts API
NationBuilder Custom Fields API
NationBuilder Donation Tracking Codes API
NationBuilder Donations API
NationBuilder Elections API
NationBuilder Event Rsvps API
NationBuilder Event Ticket Levels API
NationBuilder Events API