Skip to content
API documentation
View as MarkdownOpen in Claude

Reference data

List the subdivisions (states) of a country

GET
/v1/country/{id}/subdivision

The subdivisions of one country, a page at a time (limit up to 100), in the order the platform’s own forms list them: the 50 United States and the District of Columbia for the United States, none for a country without any. Reference data: the same list whichever organization you work with.

subdivision on the student operations takes the _id from here, or the code in full (US-CA, never CA). A country whose subdivisionRequired is true needs its students to have one.

Hidden subdivisions are not listed. An id that no country has and the id of a reserved country get the same answer as getCountry, 404 not_found. The list rarely changes, so fetch it once and keep it.

An empty list means the country has no states to choose from, so its students need none, whatever subdivisionRequired says.

Parameters

Path parameters

NameTypeDescription
idrequiredstring

The country’s _id, from listCountries: 24 hexadecimal digits.

Query parameters

NameTypeDescription
pageoptionalnumber

Page number. Defaults to 1.

Example 1

limitoptionalnumber

Items per page. Defaults to 20, max 100.

Example 20

Responses

200 OK

Success: message is "Subdivisions fetched successfully.".

Body

  • successbooleanrequired

    Always true on a success.

    one oftrue

  • messagestringrequired

    exampleSubdivisions fetched successfully.

  • paginationobject · PaginationMetarequired

    Where one page sits in the whole list.

    4 fields of pagination
    • pagenumberrequired

      The page returned, counting from 1.

      min1example1

    • limitnumberrequired

      Items per page: the limit you sent, 20 if you sent none, and never more than 100.

      min1max100example20

    • totalnumberrequired

      Items across every page.

      min0example57

    • totalPagesnumberrequired

      Pages at this limit: total / limit, rounded up.

      min0example3

  • dataarray of SubdivisionResponserequired

    8 fields of each item
    • _idstringrequired

      The subdivision’s id: what subdivision takes when you register or update a student. The same in every organization and in the sandbox: it is derived from code.

      example6650a1b2c3d4e5f6a7b8c9f2

    • countrystring

      The _id of the country it belongs to.

      example6650a1b2c3d4e5f6a7b8c9d1

    • codestring

      The ISO 3166-2 code, in capitals. subdivision takes it as well as the _id, in full: US-CA, never CA.

      exampleUS-CA

    • namestring

      The subdivision’s name, in capitals.

      exampleCALIFORNIA

    • tzstring

      The IANA time zone a sitting on local time is read in for students in this subdivision. One main zone per state.

      exampleAmerica/Los_Angeles

    • ordernumber

      The position in the list the platform’s own forms use.

      example5

    • createdAtstring

      When the record was created.

      formatdate-timeexample2026-09-01T09:30:00.000Z

    • updatedAtstring

      When the record last changed.

      formatdate-timeexample2026-09-02T14:05:00.000Z

Headers

X-RateLimit-Limit integer

Requests your account may make to this operation per window (100).

X-RateLimit-Remaining integer

Requests left in the current window.

X-RateLimit-Reset integer

Seconds until the current window ends.

Example

{
  "success": true,
  "message": "Subdivisions fetched successfully.",
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 57,
    "totalPages": 3
  },
  "data": [
    {
      "_id": "6650a1b2c3d4e5f6a7b8c9f2",
      "country": "6650a1b2c3d4e5f6a7b8c9d1",
      "code": "US-CA",
      "name": "CALIFORNIA",
      "tz": "America/Los_Angeles",
      "order": 5,
      "createdAt": "2026-09-01T09:30:00.000Z",
      "updatedAt": "2026-09-02T14:05:00.000Z"
    }
  ]
}

Example request

# $TOKEN: a short-lived token you minted with your API key and secret
curl -sS 'https://api.main-team.org/v1/country/<id>/subdivision?page=1&limit=20' \
  -H "Authorization: Bearer $TOKEN"

Search the API documentation

Guides, endpoints by name, path or permission, and error codes such as not_found.