Skip to content
API documentation
View as MarkdownOpen in Claude

Guides

Students

Almost every integration starts with a student. You register the student once, keep your own record of the _id the API gives back, and use that id everywhere afterwards: to send the student to the olympiad's site, to enter them for exams, and to collect their certificates and reports.

"Your students" means the students your API account registered. You can read and change those and no others. A student registered by another account behaves exactly as if it did not exist, and so does a student on your old account if Main Team issues you a new one.

The operations

OperationRoutePermissionActs on
Register a studentPOST /v1/studentstudent/create on mtothe main record
Check a registrationPOST /v1/student/checkstudent/create on mtonothing: it writes nothing
List your studentsGET /v1/studentstudent/read on mtothe main record
Get a studentGET /v1/student/<studentId>student/read on mtothe main record
Update a studentPUT /v1/student/<studentId>student/update on mtothe main record
List an organization's studentsGET /v1/<organizationId>/studentstudent/read on that organizationthe main record, filtered
Get a student on an organizationGET /v1/<organizationId>/student/<studentId>student/read on that organizationthe main record, filtered
Update a student on an organizationPUT /v1/<organizationId>/student/<studentId>student/update on that organizationthe main record

A role grants a permission "on mto" when its target is mto or *, and "on that organization" when its target is that organization's slug or * (Permissions). Three more student operations have their own guides: passwords, supervisor links and, for a class at a time, bulk registration.

Note

Registering a roster? registerStudent takes one student per request. For 30 to 1000 of them, createStudentImport takes the whole list in one request, checks it before it accepts it, and registers all of them or none. See Bulk registration.

The main record and olympiad records

A student exists in more than one place, and knowing which one an operation touches explains most of the rules on this page.

The main record is created when you register the student. It holds the student's profile, username and password and is reached with the permission target mto. Every student operation on this page reads or writes the main record, including the ones with an <organizationId> in the path. The _id you get at registration is the main record's id, and it is the <studentId> every student route takes.

An olympiad record is the record one organization (stem, hilingua, neo, gmath or coding) keeps of the same student. It is created the first time the student signs in to that organization, through a sign-in link you create or on their own, or earlier by the API when you enter the student for one of that organization's exams (exams at registration or in an import, or createApplication). A student never gets a second one. An olympiad record has its own _id, different on every organization, and carries the main record's _id in mainId.

Main recordOlympiad record
CreatedWhen you call POST /v1/studentAt the student's first sign-in to that organization, or when you enter them for one of its exams
Id_id: the id you store and pass as <studentId>Its own _id on that organization; mainId = the main record's _id
Written by the student routesYesNo
Needed forEverything on this pageApplications, supervisor links, and the student's certificates and reports on that organization
Kept in stepProfile details are copied from the main record each time the student signs in there

What this means in practice:

  • A new student has no olympiad records, unless you registered them with exams. Until the student has signed in to an organization, or you entered them for one of its exams, routes that need one refuse: the student's application, certificate and report lists answer 409 with a message saying the student has never signed in to that organization. (createApplication sets the student up itself.) The fix is to create a sign-in link for that organization and have the student open it.
  • Your changes reach the checks this API makes at once. Exam eligibility, for example, is judged from the main record's grade and country. The olympiad's own site shows your change after the student's next sign-in there.
  • Match on mainId when a record comes from an organization. An application's user, or the student in a supervisor-link response, is the olympiad record. Its _id means nothing elsewhere, but its mainId is the id you know. Identifiers covers this in detail.

Which organizations a student is entered on

activatedPlatformsThisSeason lists the organizations the student is entered on this season:

ValueMeaning
"common"Every organization. This is the default when you register a student without the field.
"stem", "hilingua", "neo", "gmath", "coding"That organization.

The values are lower case. Anything else is refused with 400 and each value in activatedPlatformsThisSeason must be one of the following values: common, stem, hilingua, neo, gmath, coding, and that includes "mto": every student is on the main record already. Several values can be combined: ["stem", "neo"]. At registration an empty list, [], is accepted and enters the student on no organization: the organization routes below leave them out, and sign-in links are refused with 403 until you add one.

The list decides which organization routes treat the student as yours:

  • GET /v1/<organizationId>/student and GET /v1/<organizationId>/student/<studentId> only return students whose list contains "common" or that organization's slug.
  • A sign-in link for an organization the student is not entered on is refused with 403 and Student is not activated for organization <slug>.
  • The organization-wide application listings (GET /v1/<organizationId>/application and GET /v1/<organizationId>/application/exam-applications/<examId>) only include students entered on that organization.

Adding organizations

The list only ever grows. Both updates add to it, and no operation removes an organization from it:

You callWith activatedPlatformsThisSeason in the bodyWithout it
PUT /v1/student/<studentId>The values you send are added to the list.Unchanged.
PUT /v1/<organizationId>/student/<studentId>The values you send are added to the list. The organization in the path is added only if you name it.That organization is added, unless the list already contains "common".
  • A value the list already holds is not added twice, so sending the same list again changes nothing.
  • [] adds nothing.
  • null is refused with 400 and activatedPlatformsThisSeason must be an array, as it is at registration.
  • A slug added to a list that holds "common" is stored beside it. That changes nothing, because "common" already covers every organization.

To add one organization, send just its slug, or send that organization's update route an empty body (below). You never need to read the current list first.

Register a student

POST /v1/student creates the main record and answers 201 with the new student.

curl -X POST "https://api.main-team.org/v1/student" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "firstName": "Ada",
    "lastName": "Lovelace",
    "email": "ada.lovelace@example.org",
    "birth": "14/05/2010",
    "sex": "f",
    "country": "630e0182c53dc79a6836e67e",
    "grade": "9",
    "city": "Berlin",
    "school": "Berlin International School",
    "phone": "+49 30 123 4567"
  }'
{
  "success": true,
  "message": "User registered successfully.",
  "data": {
    "_id": "6650f1a2b3c4d5e6f7a8b9c0",
    "username": "XXB1045",
    "firstName": "Ada",
    "lastName": "Lovelace",
    "fullName": "Ada Lovelace",
    "email": "ada.lovelace@example.org",
    "emailConfirmed": false,
    "phone": "+49 30 123 4567",
    "birth": "14/05/2010",
    "sex": "f",
    "country": "630e0182c53dc79a6836e67e",
    "city": "6650e0a1b2c3d4e5f6a7b801",
    "school": "6650e0a1b2c3d4e5f6a7b8c2",
    "grade": "630e01826836e67ec53dc7a5",
    "activatedPlatformsThisSeason": ["common"],
    "createdAt": "2026-09-15T09:12:44.512Z",
    "updatedAt": "2026-09-15T09:12:44.512Z"
  }
}

Store data._id. It is the student's id on every route from now on. Note that city, school and grade come back as ids even though the request named them: the API replaces each name with its id.

Fields

FieldTypeRequiredFormat and rulesExample
firstNamestringyesNot empty."Ada"
lastNamestringyesNot empty. Without it the registration is refused with 400 and lastName should not be empty."Lovelace"
emailstringyesA valid email address, with no spaces around it (" ada@example.org" is refused as not an address). Stored in lower case. Must not belong to any other student on the platform (Duplicates)."ada.lovelace@example.org"
birthstringyesDD/MM/YYYY: two-digit day 01–31, two-digit month 01–12, four-digit year, and a date that exists on the calendar. 31/02/2010 and ISO dates such as 2010-05-14 are refused with birth must be a real date in DD/MM/YYYY format, at registration and on both updates."14/05/2010"
sexstringyesExactly "m", "f" or "n", in lower case."f"
countrystringyesA country _id from GET /v1/country. An id only: names and ISO codes are refused."630e0182c53dc79a6836e67e"
subdivisionstringfor some countriesA subdivision _id from GET /v1/country/<id>/subdivision, or its full ISO 3166-2 code such as US-CA. Required when the country has subdivisionRequired: true (the United States): without it the registration is refused with 400 subdivision_required. Optional for every other country. It must belong to country, and it never changes the username."US-CA"
gradestringyesA grade _id from GET /v1/grade, or the grade's name. Always a string: the number 9 is refused with grade must be a string."9"
citystringyesA city's _id, or its name within country."Berlin"
schoolstringyesA school's _id, or its name within country and city."Berlin International School"
phonestringnoAny string; not validated. null is refused with phone must be a string: leave the field out instead. International format is the most useful to everyone who reads it."+49 30 123 4567"
activatedPlatformsThisSeasonarray of stringsno"common" or organization slugs (above). Defaults to ["common"]. null is refused with activatedPlatformsThisSeason must be an array: leave the field out instead.["common"]
passwordstringnoOnly from an account that also holds auth/signin on mto; 5 characters to 72 bytes; see Passwords. Never returned."grapefruit lantern quarry"
examsarraynoUp to 10 { organizationId, examId }: exams to enter the new student for, in the same write. See Register and enter for exams in one call.[{ "organizationId": "64b7…", "examId": "6650…" }]
walletPaybooleannotrue pays every priced exam in exams from your wallet. Needs an enabled wallet, which Main Team opens only after an agreement and on your request (otherwise 403 wallet_not_enabled).true

Leave email2 out: a registration that fills it in is refused.

Every other property is refused with 400 and property <name> should not exist, naming it. That includes fields a student record has but you may not set: username, fullName, emailConfirmed, supervisor, mainId, userType and roles. The API sets those itself, or they belong to the student and the platform.

fullName is derived from firstName and lastName ("Ada Lovelace"), and kept in step when either changes. Certificates and reports print it.

What happens, in order

Each step runs only if the one before it passed, and no student is created unless every step passes.

  1. Your token and permission. 401 or 403 (Insufficient role permissions).
  2. The body. 400 for a missing or malformed field, including a birth date that does not exist, or a property the API does not accept.
  3. The password permission. If the body has a password, the account must also hold auth/signin on mto, or the answer is 403.
  4. A duplicate on your account. If one of your students already has this email: 409, with that student's id in the message.
  5. Reference fields. country, subdivision, grade, city and school are resolved to stored ids, or the answer is 400 naming the field (below). Then, for a country that needs a state and a body that names none, 400 with code subdivision_required.
  6. The username is created (Usernames).
  7. The write. 409 if the email belongs to a student on another account.

When a body breaks several rules, the error message names one of them. Fix it and send again. Checking a registration first runs steps 2, 4 and 5, and the part of step 6 that needs the country, without creating anyone, and names every reference that fails.

Register and enter for exams in one call

exams enters the new student for up to 10 exams as part of the registration:

{
  "firstName": "Ada", "lastName": "Lovelace", "email": "ada.lovelace@example.org",
  "birth": "14/05/2010", "sex": "f", "country": "630e0182c53dc79a6836e67e", "grade": "9",
  "city": "Berlin", "school": "Berlin International School",
  "exams": [ { "organizationId": "64b7f0c2a1d3e4f5a6b7c8d9", "examId": "6650a1b2c3d4e5f6a7b8c9e1" } ],
  "walletPay": true
}
  • organizationId is the organization's _id from listOrganizations. examId is a leaf examId of the picker or an _id from the exam list.
  • Each exam is checked by the rules createApplication applies: open, the student's grade, country and state, a language, and no two exams of one category on one sitting. A problem is 400 naming exams[i], and nothing is written.
  • The student, their registration on each olympiad named, the applications and their payments are saved together or not at all.
  • With walletPay: true every priced exam is paid from your wallet, one credit each, in that same write. If the wallet can't cover it you get 409 insufficient_credits and no student is created. walletPay always needs an enabled wallet (403wallet_not_enabled otherwise, even if every exam is free). Without it, the applications are created unpaid.
  • It needs application/create on each organization named, and application/pay too with walletPay, besides student/create: 403 permission_missing otherwise, before anything is read.
  • An email address that an organization named already has on an account of its own is the same 409, That email address is already registered.

The answer is the student as above, plus applications (one entry per exam, in your order, with the payment's status, amount, currency and, when a credit paid it, reference) and, with walletPay, wallet (charged, reference, remaining per organization). A body without exams and walletPay registers the student exactly as before. For many students at once use an import.

Handling the answers

const BASE = 'https://api.main-team.org/v1';

export async function registerStudent(token, student) {
  const res = await fetch(`${BASE}/student`, {
    method: 'POST',
    headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' },
    body: JSON.stringify(student),
  });
  const body = await res.json();
  if (res.status === 201) return { created: true, student: body.data };

  const { code, message, request_id } = body.error;
  if (res.status === 409) {
    // Already one of yours: the message ends with "(<studentId>)".
    const mine = message.match(/\(([0-9a-f]{24})\)\.$/);
    if (mine) return { created: false, existingId: mine[1] };
    // Held by a student on another account: this address cannot be used.
    throw new Error(`Email in use elsewhere: ${student.email} (request ${request_id})`);
  }
  throw new Error(`${res.status} ${code}: ${message} (request ${request_id})`);
}
<?php
const MT_BASE = 'https://api.main-team.org/v1';

function mt_register_student(string $token, array $student): array
{
    $ch = curl_init(MT_BASE . '/student');
    curl_setopt_array($ch, [
        CURLOPT_POST => true,
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $token, 'Content-Type: application/json'],
        CURLOPT_POSTFIELDS => json_encode($student),
        CURLOPT_TIMEOUT => 30,
    ]);
    $raw = curl_exec($ch);
    $status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
    curl_close($ch);
    $body = json_decode($raw, true);

    if ($status === 201) {
        return ['created' => true, 'student' => $body['data']];
    }
    $error = $body['error'];
    if ($status === 409) {
        // Already one of yours: the message ends with "(<studentId>)".
        if (preg_match('/\(([0-9a-f]{24})\)\.$/', $error['message'], $m)) {
            return ['created' => false, 'existingId' => $m[1]];
        }
        throw new RuntimeException("Email in use elsewhere: {$student['email']} (request {$error['request_id']})");
    }
    throw new RuntimeException("$status {$error['code']}: {$error['message']} (request {$error['request_id']})");
}

Check a registration first

POST /v1/student/check takes the body you would send to POST /v1/student, without password, and runs the checks registration makes before it creates anything: the body's rules, a duplicate among your students, and the four reference fields. It creates nothing, issues no username, and can be sent any number of times. It needs the permission registration needs, student/create on mto. Use it to validate a batch, or a form, before you register anyone.

curl -X POST "https://api.main-team.org/v1/student/check" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "firstName": "Ada",
    "lastName": "Lovelace",
    "email": "ada.lovelace@example.org",
    "birth": "14/05/2010",
    "sex": "f",
    "country": "630e0182c53dc79a6836e67e",
    "grade": "9",
    "city": "Berlin",
    "school": "Berlin Harbour School"
  }'
{
  "success": true,
  "message": "Registration checked. Nothing was created.",
  "data": {
    "valid": true,
    "problems": [],
    "resolved": {
      "country": "630e0182c53dc79a6836e67e",
      "grade": "630e01826836e67ec53dc7a5",
      "city": "6650e0a1b2c3d4e5f6a7b801",
      "school": null
    },
    "willCreate": { "city": false, "school": true },
    "duplicate": { "sameAccount": false }
  }
}
FieldMeaning
validtrue when POST /v1/student with the same body would pass every check made here.
problemsEvery reference field registration would refuse, as { field, message }, with the message registration would refuse it with. Registration names only the first; the check names them all, in the order country, subdivision, grade, city, school, then a subdivision the country needs and the body lacks. A country whose students cannot be given a username is listed as well. A city or school name that is not in our list yet is not a problem: see willCreate.
resolvedThe _id each reference resolved to, which is what registration would store, or null. A city or school that willCreate flags is null.
willCreate{ city, school }: true for a name that is not in our list yet and would be added when you register. Look at it before you register: a misspelt school name becomes a new school. The check adds nothing. All false when the email address is already one of your students'.
exams, walletOnly when the body had exams / walletPay. exams has one entry per exam: valid, price (cents, after the coding bundle rule), currency, free, credits (1, or 0 for a free exam) or a problem with a code. wallet says whether your wallet is enabled, what is needed and available per organization, and whether it is sufficient; valid is false when it is not. Needs the same extra grants registration does. The check never looks at addresses held by other accounts or organizations.
duplicatesameAccount is true when one of your students already has this email address, and studentId is that student's _id: registration would answer 409. Nothing else is looked up then, so problems is empty and every resolved value is null.

The answer is 200 whatever the lookups found. A body that breaks a field's rule is refused with 400, exactly as registration refuses it, and so is password, with property password should not exist.

Note

valid: true is not a promise. Only your own students are checked for the email address. An address a student on another account holds is not looked for, so registration can still answer 409 with That email address is already registered. The check also cannot see a student registered, or reference data changed, after it ran.

How reference fields resolve

country, subdivision, grade, city and school point at the platform's reference data. Whatever form you send, the API looks it up and stores the matching record's id. A country, subdivision or grade that matches nothing is refused, and an _id that matches nothing is refused: the API never invents a country, subdivision or grade. A city or school name that is not in our list yet is added automatically (below).

FieldAcceptsA name is looked upRefused with 400 when
countryan id only(names are not accepted)not an id: country must be a mongodb id; an id that matches nothing, or a country that cannot be selected: country is not a known country.
subdivisionan id or a full ISO 3166-2 codewithin the student's countrynot an id or a full code (CA, California): subdivision must be the id of a subdivision or its ISO 3166-2 code (for example US-CA).; an id or code that matches nothing, or is hidden: subdivision is not a known subdivision.; a state of another country: subdivision is not a subdivision of this country.
gradean id or a nameamong all gradesno grade has that id: grade is not a known grade.; or that name: grade is not a known grade. This API does not create reference data.; the Graduated grade, unless the student already holds it: grade cannot be Graduated: …
cityan id or a namewithin the student's countryan id that matches nothing: city is not a known city.. A name that is not in our list yet is added, unless it breaks the limits below (city is not a known city, and cannot be added as a new one: …)
schoolan id or a namewithin the student's country and cityan id that matches nothing: school is not a known school.. A name that is not in our list yet is added, unless it breaks the limits below

The details:

  • Id or name is decided per value. A 24-character hex string is treated as an id and looked up as one. Anything else is treated as a name. You can mix the forms freely, for example a country id with a city name.
  • An id is only checked for existence. A city or school given by id is accepted if that record exists, whether or not it lies in the student's country. When you change a student's country, send city and school in the same request so the three still agree.
  • Changing a student's country and subdivision. A body with country keeps the student's stored subdivision only if it belongs to the new country. Otherwise a country that needs a state is refused with subdivision_required unless the same body sends one, and a country without states clears the old state. A body that changes neither country nor subdivision is not checked, so a phone change on an existing student never fails for want of a state. A cleared state can still show on an olympiad's site until the student's next sign-in there.
  • A subdivision belongs to one country. It is looked up inside the student's country (the one in the same body, or on an update the one the student already has). Send it as the _id or as the full code: a bare CA is Canada's code, so it is refused, and names are not accepted.
  • Some countries cannot be selected. GET /v1/country does not list them, and a write that names one is refused exactly like an unknown id.
  • There is no list of cities or schools. Use the names your own records hold. A name that is not in our list yet is added automatically, so you do not need to ask for it first. Check first: willCreate tells you which of the two would be new, and a misspelt name becomes a new school.
  • Limits for a new name. A school name may be at most 120 characters and a city name 80, without < or >. A name that breaks them is refused with 400.
  • On an update you can change the school without repeating the country.

Note

Why the grade is strict. Every exam is open to a set of grades. A grade the API does not know would be a student no exam could ever accept, so an unknown grade is refused, never created.

What the API never creates

  • Countries, subdivisions and grades. None is ever created, whatever you send. (A new city or school name is added, as described above.)
  • Users other than students. Supervisors, parents and staff register through the platform. The API manages students and nothing else.
  • Olympiad records. Only the student's first sign-in to an organization creates one (above).
  • Usernames of your choosing. The API mints every username; you cannot set or change one.
  • Email confirmation. The API never marks an address as confirmed. A student confirms their own address on the olympiad's site, with a 6-digit code emailed to them, and the site asks for it on every page until they do. See Email confirmation.
  • Messages to the student. Registering a student through the API does not email them. Tell them yourself how they will get in; usually that is a sign-in link from your own product.

Usernames

Every student gets a username when they are registered, and it is in every student response as username. It is the identifier students and support staff use to refer to an account.

The format is the country's two-letter code, one letter, then a number. In XXB1045, XX stands for the country's code, B is the letter and 1045 the number. These pages write XX, which is no country's code, so that no example is a real student's username.

  • The letter is chosen at random from A to Z, leaving out P, S and T.
  • The number counts up per country and letter, starting at 1000, so usernames are unique within that series.
  • Usernames are upper case, and read-only. Sending username in any body is refused with 400, property username should not exist.
  • A username never changes through the API, not even when you change the student's country or subdivision. A student in California or in Texas is US followed by a letter and a number alike.

Because a username identifies the student to other people, it is not a secret. Never use it as, or in, a password. The API refuses passwords that contain it (Passwords).

Duplicate email addresses

An email address belongs to one student on the whole platform. Two refusals follow from that, and they differ in whether they tell you who holds the address:

SituationStatusMessage
One of your students already has the address409 conflictA student with that email is already registered to this account (6650f1a2b3c4d5e6f7a8b9c0).
A student on another account, or the platform's own users, has it409 conflictThat email address is already registered.

In the first case, the id in the message is your existing student: fetch it with GET /v1/student/<id>, or update it. In the second case you cannot see or claim that student. Ask for a different address.

Addresses are compared without regard to letter case: Ada.Lovelace@Example.org is the same address as ada.lovelace@example.org. An address with spaces around it is refused with 400 before any comparison, so trim addresses on your side.

Warning

Registration is not idempotent. Sending the same registration twice never creates two students. The second attempt is refused with 409, which is how you know. If a registration times out, retry it: a 409 that names an id means the first attempt worked, and that id is your student. If two identical registrations run at the same moment, the loser may get the message without an id. Look the student up in your list before you treat the address as taken elsewhere. Retries and idempotency covers this pattern.

An update that moves a student to an address another student already holds is refused with 409 and That email address is already registered., without an id, even when the other student is one of yours.

Read students

All your students

curl "https://api.main-team.org/v1/student?page=1&limit=50" \
  -H "Authorization: Bearer $TOKEN"
{
  "success": true,
  "message": "Students fetched successfully.",
  "data": [
    {
      "_id": "6650f1a2b3c4d5e6f7a8b9c0",
      "username": "XXB1045",
      "firstName": "Ada",
      "lastName": "Lovelace",
      "fullName": "Ada Lovelace",
      "email": "ada.lovelace@example.org",
      "emailConfirmed": false,
      "phone": "+49 30 123 4567",
      "birth": "14/05/2010",
      "sex": "f",
      "country": {
        "_id": "630e0182c53dc79a6836e67e",
        "name": "GERMANY",
        "iso2": "DE",
        "iso3": "DEU",
        "createdAt": "2022-08-30T12:14:26.118Z",
        "updatedAt": "2022-08-30T12:14:26.118Z"
      },
      "city": {
        "_id": "6650e0a1b2c3d4e5f6a7b801",
        "name": "TIRANA",
        "country": "630e0182c53dc79a6836e67e"
      },
      "school": {
        "_id": "6650e0a1b2c3d4e5f6a7b8c2",
        "name": "TIRANA INTERNATIONAL SCHOOL",
        "country": "630e0182c53dc79a6836e67e",
        "city": "6650e0a1b2c3d4e5f6a7b801"
      },
      "grade": {
        "_id": "630e01826836e67ec53dc7a5",
        "name": "9",
        "createdAt": "2022-08-30T12:14:26.309Z",
        "updatedAt": "2022-08-30T12:14:26.309Z"
      },
      "supervisor": {
        "_id": "64c1d2e3f4a5b6c7d8e9f0a1",
        "firstName": "Deniz",
        "lastName": "Kaya",
        "fullName": "Deniz Kaya",
        "username": "XXT1003"
      },
      "activatedPlatformsThisSeason": ["common"],
      "createdAt": "2026-09-15T09:12:44.512Z",
      "updatedAt": "2026-09-15T09:12:44.512Z"
    }
  ],
  "pagination": { "page": 1, "limit": 50, "total": 312, "totalPages": 7 }
}

Paginate with page (default 1) and limit (default 20, at most 100; a larger value is lowered to 100). The list has no guaranteed order. Pagination shows complete loops, and what to expect if students are registered while you page.

To find students by email address, add email: one address, or up to 100 separated by commas. Only your students with one of them are listed, matched exactly and without regard to case, and pagination.total counts the matches.

curl "https://api.main-team.org/v1/student?email=ada.lovelace@example.org,grace.hopper@example.org" \
  -H "Authorization: Bearer $TOKEN"
  • An address none of your students has matches nothing, whoever else holds it. The filter never looks beyond your own students.
  • Encode + as %2B. In a query string + reads as a space, so ada+maths@example.org sent as it is arrives as no address at all and is refused.
  • An unreadable filter is refused, never ignored: an empty email, one given twice, an entry that is not an address, or more than 100 entries answers 400 with email must be given once, as one or more email addresses separated by commas (or email must list at most 100 addresses).
  • Addresses in a URL are more likely to be recorded along the way than a body. Use the filter where that is acceptable to you.

One student

curl "https://api.main-team.org/v1/student/6650f1a2b3c4d5e6f7a8b9c0" \
  -H "Authorization: Bearer $TOKEN"

The answer is 200 with the student in data, shaped like one element of the list above, and the message Student fetched successfully.

A student that is not yours answers 404 not_found, Student not found!, the same as an id that matches no student. An id that is not 24 hex characters is 400 (Invalid value for '_id': expected ObjectId.).

Students on one organization

GET /v1/<organizationId>/student and GET /v1/<organizationId>/student/<studentId> return the same main records, filtered to the students entered on that organization (Which organizations). The responses have the same shape as the flat routes. The single read takes the same <studentId>, the main record's _id, and answers 404 not_found, Student not found!, when the student is not yours or not entered on that organization.

Use these routes when your account's permissions are scoped to an organization, or when you want exactly the students an organization treats as yours. For your full list, use GET /v1/student.

The organization list also says, for each student, whether they have signed in to that organization at least once: signedIn is true or false. The organization keeps its own record of a student from that first sign-in (above), and applications and supervisor links there need it. Add signedIn=false to list only the students who still have to sign in, and send each a sign-in link; add signedIn=true for the students ready for applications. The filter narrows pagination.total too. Any other value is refused with 400 and signedIn must be true or false. The single read, GET /v1/<organizationId>/student/<studentId>, does not carry signedIn.

curl "https://api.main-team.org/v1/64b7f0c2a1d3e4f5a6b7c8d9/student?signedIn=false" \
  -H "Authorization: Bearer $TOKEN"

Fields returned

A student comes back with at most these fields, on every route that returns one. A field the student does not have, such as a phone never given, is left out rather than sent empty.

FieldTypeMeaning
_idstringThe student's id. On the student routes, the main record's id.
mainIdstringOn an olympiad record, the main record's _id. The student routes return the main record, where it is usually absent.
usernamestringMinted at registration; read-only (Usernames).
firstName, lastNamestringAs you set them.
fullNamestringfirstName and lastName joined by a space; derived.
emailstringTrimmed, lower case.
emailConfirmedbooleantrue once the student has proved the address is theirs. Starts false.
phonestringAs you set it.
birthstringDD/MM/YYYY.
sexstringm, f or n.
country, subdivision, city, school, gradeobject on reads, id on writesOn the read routes, the full reference record. On registration and updates, its id.
supervisorobject on reads, id on writesThe supervisor on the main record, as _id, firstName, lastName, fullName and username. Links made per organization do not appear here (Supervisors).
partnerobject on reads, id on writesA partner account the student is attached to on the platform, shaped like supervisor.
activatedPlatformsThisSeasonarray of stringsThe organizations the student is entered on.
createdAt, updatedAtISO 8601 timestamp

Nothing else a student record holds is ever returned: not the password, and not your account's details. Treat the list as open-ended all the same, and ignore fields you do not recognize (Versioning). The organization list adds one field to each student that is not part of the record, signedIn (Students on one organization).

Update a student

PUT /v1/student/<studentId> changes the fields you send and leaves every other field as it is. No field is required, but each one you send follows its registration rule.

curl -X PUT "https://api.main-team.org/v1/student/6650f1a2b3c4d5e6f7a8b9c0" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "grade": "10", "school": "Berlin Science High School" }'
{
  "success": true,
  "message": "Student updated successfully.",
  "data": {
    "_id": "6650f1a2b3c4d5e6f7a8b9c0",
    "username": "XXB1045",
    "firstName": "Ada",
    "lastName": "Lovelace",
    "fullName": "Ada Lovelace",
    "email": "ada.lovelace@example.org",
    "emailConfirmed": false,
    "phone": "+49 30 123 4567",
    "birth": "14/05/2010",
    "sex": "f",
    "country": "630e0182c53dc79a6836e67e",
    "city": "6650e0a1b2c3d4e5f6a7b801",
    "school": "6650e0a1b2c3d4e5f6a7b8d7",
    "grade": "630e01826836e67ec53dc7a6",
    "activatedPlatformsThisSeason": ["common"],
    "createdAt": "2026-09-15T09:12:44.512Z",
    "updatedAt": "2026-09-16T07:40:02.931Z"
  }
}

The same fields as registration are accepted, except password, which has its own route. Rules to know:

  • The formats still apply to whatever you send: birth as a DD/MM/YYYY date that exists (31/02/2010 is refused), sex as m, f or n, country as an id, and grade, city and school resolving to something that exists.
  • firstName, lastName, birth and sex can be changed but not cleared. "" or null is refused with the field's rule, for example lastName should not be empty.
  • phone is cleared with "". null is refused with phone must be a string.
  • activatedPlatformsThisSeason is added to the stored list, never written over it (Adding organizations).
  • email cannot be removed. null is refused with email must be a valid email address, and an invalid address with email must be an email.
  • Changing the email withdraws confirmation. A new address has not been proved to belong to anyone, so emailConfirmed goes back to false, and the olympiad's site asks the student to confirm the new address before they can use it again. Sending the address the student already has, in any letter case, is not a change and leaves confirmation alone. That makes it safe to send a whole profile on every sync.
  • Renaming updates fullName, whether you change one name or both.
  • password is refused with property password should not exist. So are username, emailConfirmed and every other field registration does not accept.

Refusals: 404, code not_found, Student not found! when the student is not yours (or does not exist). 400 for a malformed id or a field that breaks its rule. 409 for an email another student holds (Duplicates).

The response is the student after the change. As with registration, reference fields come back as ids.

Update through an organization

PUT /v1/<organizationId>/student/<studentId> writes the same main record, with the same fields, rules and refusals as the flat update. Two things differ:

  • The permission is student/update on the organization in the path, so an account whose roles are scoped to one organization can still keep its students' details current.
  • It enters the student on that organization. Without activatedPlatformsThisSeason in the body, the organization in the path is added to the student's list, unless the list already contains "common". Updating the same student again adds nothing further. This is how you give a student access to an organization before creating a sign-in link for it.

The student does not need to be entered on the organization already. The olympiad's site picks up the changes at the student's next sign-in there.

The body may be empty. {} enters the student on the organization, changes nothing else, and answers 200 with the student. If you send activatedPlatformsThisSeason, its values are added instead, and this organization is added only if you name it.

Flat and per-organization operations compared

Flat (/v1/student…)Per organization (/v1/<organizationId>/student…)
RecordThe main recordThe main record
Permission targetmto or *That organization's slug or *
RegisterYesNo; register on the flat route
List and readAll your studentsYour students entered on that organization
UpdateChanges the fields you sendChanges the fields you send, and enters the student on that organization
Set a passwordPUT /v1/student/<studentId>/passwordNot available
Link a supervisorNot availablePUT /v1/<organizationId>/student/<studentId>/supervisor

Errors

StatusCodeMessageCauseFix
400bad_requestproperty <name> should not existA field the route does not accept.Remove it.
400bad_request<field> should not be empty, email must be an email, email must be a valid email address, birth must be a real date in DD/MM/YYYY format, country must be a mongodb id, grade must be a string, …A field is missing or malformed.Fix the field named.
400bad_requestphone must be a stringphone was sent as null.Leave it out, or on an update send "" to clear it.
400bad_requestactivatedPlatformsThisSeason must be an array, each value in activatedPlatformsThisSeason must be one of the following values: …The list is null, or holds a value other than common and the five slugs.Leave it out, or send slugs from the list above.
400subdivision_requiredThis student’s country requires a subdivision (a state). …The country has subdivisionRequired: true and no subdivision was sent: registering, checking, or updating country on a student with no state of the new country.Send subdivision from listCountrySubdivisions.
400bad_request<field> is not a known <field>. (and This API does not create reference data. for a grade name)A country, subdivision, grade or an _id matches nothing, or names a country that cannot be selected.Take ids from the reference routes; check spelling and the student's country.
400bad_requestcity is not a known city, and cannot be added as a new one: … (and the same for school)A new city or school name breaks the limits (more than 80 or 120 characters, or < or >).Shorten or clean the name.
400bad_requestInvalid value for '_id': expected ObjectId.<studentId> is not 24 hex characters.Use the _id from registration.
400bad_requestemail must be given once, as one or more email addresses separated by commas, email must list at most 100 addressesThe email filter of GET /v1/student could not be read.Send one comma-separated list of up to 100 addresses, with + encoded as %2B.
400bad_requestsignedIn must be true or falseThe signedIn filter of GET /v1/<organizationId>/student is another value.Send true or false, or leave it out.
400bad_requestproperty password should not existpassword was sent to POST /v1/student/check.Leave it out; send it with the registration.
403forbiddenInsufficient role permissionsThe account lacks the permission, or holds it on another organization.Ask Main Team for the role.
403forbiddenSetting a student's password needs the auth/signin permission on mto, …password in a registration without auth/signin on mto.See Passwords.
404not_foundStudent not found!A read or update of a student that is not yours or does not exist, or a read through an organization the student has no access to.Check the id and the account.
404not_foundOrganization not found!<organizationId> is not an organization _id.Use the _id from GET /v1/organization, never the slug.
409conflictA student with that email is already registered to this account (<id>).The address is one of your students'.Use that student.
409conflictThat email address is already registered.The address belongs to a student elsewhere.Ask for another address.

Search the API documentation

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