VoterGuideOS

Find offices

Returns paginated offices. Public reads do not require authentication. The public response is limited to office identifiers, name, district id, short description, and district types.

GET
/offices

Query Parameters

$limit?integer

Maximum number of records to return.

Range0 <= value
$skip?integer

Number of records to skip.

Range0 <= value
$sort?

Sort object, for example $sort[createdAt]=-1.

key?|array<string>

Office key or keys.

$search?string

Full-text/fuzzy search for offices by name.

district?string

State district id directly associated with the office.

Match^[a-fA-F0-9]{24}$

Header Parameters

X-Organization-Id*string

The ID of the organization making the request.

Response Body

application/json

Paginated office results.

TypeScript Definitions

Use the response body type in TypeScript.

application/json

Office query was invalid.

TypeScript Definitions

Use the response body type in TypeScript.

curl -X GET "https://example.com/offices" \  -H "X-Organization-Id: org_123"
{
  "total": 1,
  "limit": 10,
  "skip": 0,
  "data": [
    {
      "_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"
      ]
    }
  ]
}