VoterGuideOS

Get office by key

Returns a single office by key. Office keys are the stable public identifier used by races and ballot overview data.

GET
/offices/{key}

Path Parameters

key*string

Office key.

Header Parameters

X-Organization-Id*string

The ID of the organization making the request.

Response Body

application/json

Office response.

TypeScript Definitions

Use the response body type in TypeScript.

application/json

Office was not found.

TypeScript Definitions

Use the response body type in TypeScript.

curl -X GET "https://example.com/offices/string" \  -H "X-Organization-Id: org_123"
{
  "_id": "6436e1b52c63f2cd3324826c",
  "key": "state-delegate",
  "name": "State Delegate",
  "district": "6436cdc42969c6412ba44663",
  "descriptionShort": "Your representative and state lawmaker in the Virginia House of Delegates.",
  "districtTypes": [
    "state-house"
  ]
}