Skip to content
API documentation
View as MarkdownOpen in Claude

Reference data

List the countries a student can be registered in

GET
/v1/country

Every country you can give as a student’s country, a page at a time (limit up to 100). Reference data: the same list whichever organization you work with.

country on the student operations takes the _id from here and nothing else: not the name, iso2 or iso3. A few countries are reserved for internal use; they are not listed, and a student cannot be registered in one.

An exam’s countries are the organization’s own records, whose ids need not match these: compare them by iso2.

The list is in no guaranteed order and rarely changes, so fetch it once and keep it.

Parameters

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 "Countries fetched successfully.".

Body

  • successbooleanrequired

    Always true on a success.

    one oftrue

  • messagestringrequired

    exampleCountries 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 CountryResponserequired

    9 fields of each item
    • _idstringrequired

      The country’s id: what country takes when you register or update a student.

      example6650a1b2c3d4e5f6a7b8c9d1

    • namestring

      The country’s name, in capitals.

      exampleUNITED STATES

    • iso3string

      The ISO 3166-1 alpha-3 code, in capitals.

      exampleUSA

    • iso2string

      The ISO 3166-1 alpha-2 code, in capitals. A student’s username starts with it.

      exampleUS

    • tzstring

      The IANA time zone a sitting on local time is read in for students in this country (see tz on a sitting).

      exampleAmerica/New_York

    • dialCodestring

      The international dialling code, with its +.

      example+1

    • flagstring

      The country’s flag, as an emoji.

      example🇺🇸

    • 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": "Countries fetched successfully.",
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 57,
    "totalPages": 3
  },
  "data": [
    {
      "_id": "6650a1b2c3d4e5f6a7b8c9d1",
      "name": "UNITED STATES",
      "iso3": "USA",
      "iso2": "US",
      "tz": "America/New_York",
      "dialCode": "+1",
      "flag": "🇺🇸",
      "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?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.