Record ballot choice
Records or replaces a single race or measure choice on an existing ballot and returns the stored choice plus updated ballot progress. The endpoint uses `uuidLock` to replace only anonymous choices tied to the same local lock. All other choices service methods are disabled.
Header Parameters
The ID of the organization making the request.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
Choice recorded and ballot progress recalculated.
TypeScript Definitions
Use the response body type in TypeScript.
application/json
Request validation failed.
TypeScript Definitions
Use the response body type in TypeScript.
application/json
A uuidLock is required to save anonymous choices.
TypeScript Definitions
Use the response body type in TypeScript.
application/json
Ballot was not found.
TypeScript Definitions
Use the response body type in TypeScript.
curl -X POST "https://example.com/choices" \ -H "X-Organization-Id: org_123" \ -H "Content-Type: application/json" \ -d '{ "ballot": "65d4f20f8f5a4d7e9a123456", "race": "65d4f20f8f5a4d7e9a123457", "candidate": "65d4f20f8f5a4d7e9a123458", "uuidLock": "local-choice-lock" }'{
"choice": {
"race": "65d4f20f8f5a4d7e9a123457",
"candidate": "65d4f20f8f5a4d7e9a123458",
"uuidLock": "local-choice-lock"
},
"progress": {
"racesTotal": 4,
"measuresTotal": 1,
"racesComplete": 1,
"measuresComplete": 0,
"percentageComplete": 20
}
}{
"choice": {
"measure": "65d4f20f8f5a4d7e9a123460",
"choice": "no",
"uuidLock": "local-choice-lock"
},
"progress": {
"racesTotal": 4,
"measuresTotal": 1,
"racesComplete": 0,
"measuresComplete": 1,
"percentageComplete": 20
}
}