Skip to content
API documentation

Help

Changelog

Every change to the API contract, by version, newest first: operations, request and response fields, error codes, and the rules your integration relies on. A change that can break code written against these pages is marked Breaking.

Versions follow semantic versioning. A minor version adds without breaking, a patch version fixes, and a new major version gets a new path prefix; every 1.x version is served under /v1. Ignore response fields your code does not recognise: new ones can arrive in any minor version.

1.7.1

1 change: 1 changed.

Changed

  • Documentation corrected.

1.7.0

7 changes: 3 added, 3 changed, 1 removed.

Added

  • Wallet. Main Team can now give your account credits for each olympiad, and you spend them to pay applications. A credit is a convenience: an application paid with it is marked paid at once, and the amount for it is still due to Main Team and settled afterwards by bank transfer. The wallet is not self-service: Main Team opens it only after an agreement and on your request (ask your Main Team contact or info@main-team.org), and bank transfer stays the default way to pay. One credit pays one application that has a price; a free exam never takes one. getWallet (GET /v1/wallet) and listWalletEntries (GET /v1/wallet/entries), under the new permission wallet/read on mto, read your balance (granted, spent and remaining for each olympiad, what the spent credits paid in cents and their currency, USD for neo and EUR for the others) and the history of every credit added and spent, with filters. payApplicationFromWallet (POST /v1/{organizationId}/application/{applicationId}/wallet-pay) and payApplicationsFromWallet (POST /v1/{organizationId}/application/wallet-pay, 1 to 100 applications, all or nothing, one reference and one invoice number, 30 requests a minute) pay applications that exist already, under the new permission application/pay. createApplication takes an optional walletPay and answers data.wallet; a repeat call with walletPay: true pays a payment that is still pending. The application, its payment and the debit are written together or not at all. Without a wallet, nothing changes: every wallet operation and walletPay: true answer 403 with error.details.reason wallet_not_enabled. New reasons under existing error codes: forbidden (wallet_not_enabled, permission_missing), conflict (insufficient_credits, with error.details.organizations, already_paid, payment_canceled, payment_in_progress, payment_changed) and service_unavailable (wallet_unavailable). A role of application/*, */* or * grants application/pay, and */read, */* or * grants wallet/read; spending still needs a wallet Main Team has enabled. Reversals are Main Team's, never the API's.
  • Entering a student for exams while registering them. registerStudent and each row of createStudentImport take an optional exams: up to 10 entries of { organizationId, examId } (an import: 2000 in the whole batch), checked by the rules createApplication applies. The student, their registration on each olympiad named, the applications and their payments are saved together or not at all. registerStudent and createStudentImport also take an optional walletPay: every priced exam is paid from your wallet, one credit each, in that same write, so a wallet that cannot cover the exams creates nothing, not even the student. walletPay: true always needs an enabled wallet (403 wallet_not_enabled otherwise, even when every exam is free) and application/create and application/pay on every organization named (403 permission_missing, listing what is missing). registerStudent answers data.applications (and data.wallet); checkStudentRegistration takes exams and walletPay and answers data.exams (price, currency, free, credits, or the problem) and data.wallet (enabled, needed, available, sufficient), and writes nothing. For an import, getStudentImport adds walletPay, creditsNeeded and, on each registered row, applications. The credit check when an import is submitted is advisory (409 insufficient_credits, every organization the batch needs); the credits are taken when it runs. Closed sets gain values: a row code can be exam_not_offered or exam_conflict, and an import failure.code can be insufficient_credits or wallet_not_enabled, with failure.details.organizations. These values are reachable only by requests that send exams or walletPay, so no working call changes; a client that switches over these sets exhaustively needs the new cases. A batch sent again with walletPay is not mistaken for the same batch sent without it. Without exams and walletPay both operations behave exactly as before.
  • checkStudentRegistration answers data.willCreate, { city, school }: true for a city or school name that is not in our list yet and would be added when you register (see Changed). The check still writes nothing. Additive: ignore the field if you do not need it.

Changed

  • createApplication no longer answers 409 (Student has never signed in to …) for a student you registered here who has not signed in to that organization yet: it creates the student's record in the organization first, the one the student's first sign-in finds and updates, and then the application. It still answers that 409 when the organization already has an account with the student's email address, or Main Team has already assigned exams to the student; the first sign-in settles those. The other operations that need the organization's record are unchanged.
  • createApplication and moveApplication price a coding application by the CodeCombat and Codementum bundle rule the website already uses: once the student has paid one of those exams this season, another exam of the same category costs 15 and one of the other category 30 (15 once one of that category is paid too), never more than the exam's own price. Before, the payment was always the exam's own price. The exam lists still show the exam's price; the payment shows what is due. A paid application moves between the two categories at the price it was paid at. Other organizations and categories are unchanged.
  • If a school or city name is not in our list yet, registerStudent, createStudentImport, updateStudent and updateOrgStudent now add it automatically. Before, such a name was refused with 400 bad_request (… is not a known school. This API does not create reference data.). checkStudentRegistration shows beforehand which names would be added (willCreate), so you can fix a typo first. A new name may be at most 120 characters for a school and 80 for a city, without < or >; a name that breaks this is still refused (400, row code unknown_reference in an import). A country or grade that matches nothing, and an _id that matches nothing, are refused as before. Not a breaking change: only calls that failed before now succeed.

Removed

1.6.0

1 change: 1 changed.

Changed

  • linkStudentSupervisor no longer replaces a supervisor the student already has on that organization: replacing one is paused for now, and such a call answers 409 conflict with error.details.reason supervisor_change_suspended (Changing the teacher of a student is paused for now. Please contact us if this is urgent.) and writes nothing. Linking a student who has no supervisor yet, and linking the same supervisor again, work as before. A call that used to change a student's supervisor now fails instead; contact us if a change is urgent.

1.5.1

2 changes: 2 changed.

Changed

  • listGrades no longer lists the Graduated grade (GRADUATED, the grade after 12 for a student who has left school), and registerStudent, checkStudentRegistration, createStudentImport, updateStudent and updateOrgStudent refuse it as grade, by name or by _id, with 400 bad_request (grade cannot be Graduated: …; a problems entry in checkStudentRegistration, the row code unknown_reference in createStudentImport). An update that sends back the grade a student already holds is still accepted, and getGrade and the student reads still return it for a student who graduated on the platform. No exam is open to it. Not a breaking change: the grade is new, so no call that worked before sent it.
  • listStudentReports no longer returns a report's extras data. Of extras it keeps only the award (medal, medalDescription) and isCanceled. extras was never part of the documented contract; the report PDF and reportDetail are unchanged.

1.5.0

Students can belong to a subdivision, such as a United States state, which decides the time of a local exam and which state-targeted exams they are offered. A United States student now needs one. One new operation, one new optional field and one new error code; nothing is removed.

Added

Changed

  • Versioning exception: a United States student needs a state. For a country whose subdivisionRequired is true, registerStudent and each row of createStudentImport need a subdivision, and checkStudentRegistration reports its absence in problems. A body that omitted it and was accepted before is now refused with 400 subdivision_required (a row with the row code subdivision_required). This is deliberately not announced as a breaking change, because no field became required in the contract: the rule follows the country's own subdivisionRequired flag, which is false for every country until the platform switches it on, and countries without subdivisions are never affected. Sandbox students in the United States need a state too.
  • updateStudent and updateOrgStudent check the state only when the body changes country or sends subdivision: a country that needs a state, with no state of that country on the student or in the body, is refused with 400 subdivision_required, and a country without states drops the old country's state. A phone change on an existing student is never refused for want of a state.
  • listAvailableExams, createApplication and moveApplication answer 400 subdivision_required for a student whose country needs a state and who has none, instead of offering a partial list. Reading and updating the student are not affected.
  • An exam's countries and the ids listCountries returns are the same ids (the platform keeps one id per country); the documentation no longer says they may differ. Nothing enforces it, so comparing by iso2 still always works.
  • tz on a country is documented as the zone for students without a subdivision; the example showed America/New_York, and the United States row is America/Chicago. A student with a subdivision sits a local exam in the subdivision's own tz.

Release notes for 1.5.0

1.4.0

For partners who collect exam fees themselves. An application can carry your own externalRef, the application lists can be filtered by it and by payment status, and a settled payment shows the reference Main Team confirms it with. Nothing is removed; code written against 1.3.0 keeps working.

Added

Changed

  • How you receive your credentials: Main Team emails a one-time link, never the secret. The link shows apiKey and apiSecret once you click "Show credentials", expires 24 hours after it is created, is replaced by any newer link, and should be destroyed once you have saved the values. Documentation only; no operation changed.
  • On hilingua, the rule that stops a student holding two exams on one sitting is keyed by language instead of by category. A student can now hold several languages in one Language Competition sitting; the same language twice on one sitting is refused with 409 conflict, Student already has an application for <language> on this sitting. The same language cannot be sat twice on one date. A sitting held in the student's local time (Essay Writing) takes one exam in all and keeps the category message. listAvailableExams, createApplication and updateApplication follow the same rule. Every other organization is unchanged.

Removed

  • The Client libraries pages of the partner documentation (the overview, Node.js and PHP): the libraries were never published. Build your own client stays, now among the guides. GET /v1/docs/clients answers 301 to it. No operation changed.

Fixed

Release notes for 1.4.0

1.3.0

A group challenge can ask every member of a group for a signed parental consent form. Reading a group counts the forms that are in, and sending the work waits until every active member's is. Groups of a challenge that does not ask for consent are answered as in 1.2.0.

Added

  • Parental consent on group challenges. A challenge can ask every member of a group for a signed parental consent form, which each member uploads on the olympiad's site or the app. getGroupChallengeGroup gains consent ({ required, received, memberCount }, counted over the group's active members, or null when the challenge does not ask for consent) and, on each of yourStudents, consentReceived (true, false, or null when not asked). canFinalSubmit is false until every active member's form is in. The forms themselves are never shown.
  • submitGroupChallengeWork answers 409 conflict with the new details.reason consent_missing, with consentsReceived and memberCount in details, when the challenge asks for parental consent and an active member's form is not in yet. It is checked after every other refusal, and a group whose work was already sent still answers 200 with changed: false. Groups of a challenge that does not ask for consent are answered exactly as before.

Release notes for 1.3.0

1.2.0

Nine new operations under one new tag, Group challenges, behind two new permissions, group-challenge/read and group-challenge/submit. Nothing that worked against 1.1.1 changes.

Added

  • Group challenges, a new resource under /v1/{organizationId}/group-challenge with the tag "Group challenges" and the permission group-challenge/read (also granted by */read, */* and *): listGroupChallenges and getGroupChallenge read the challenges an organization runs; listGroupChallengeStudents and getGroupChallengeStudent say where each of your students stands (eligible by grade, in a group, the group's state) and give the panelPath to send them to with createSigninLink; listGroupChallengeGroups and getGroupChallengeGroup read the groups your students are in, with each step and its files; listGroupChallengeActivity lists what happened in a group. Only your own students are named: every other person is their role alone. The operations answer 404 on an organization where group challenges are not switched on.
  • Submitting group challenge work for one of your students, behind the new permission group-challenge/submit (also granted by */* and *, not by */read): submitGroupChallengeStep submits a group's open step and opens the next, and submitGroupChallengeWork sends the group's finished work and e-mails its members and teacher. Both take { "studentId": "<studentId>" }, a student of yours who is an active member of the group, and are recorded in the group's history as your account acting for them. Repeating a submit that already happened answers 200 with changed: false.

Changed

Release notes for 1.2.0

1.1.1

A documentation release. The published agent kit now carries six skills instead of two, including one written against bulk registration, and none of them describes anything but this API. Every call that worked against 1.1.0 works unchanged.

Changed

  • The agent kit published at https://hub.main-team.org/api/skills now has six skills instead of two, all of them about this REST API: integrating-main-team-api (tokens, the envelopes, pagination, rate limits, retries and idempotency, polling, every error code), registering-a-main-team-student, registering-main-team-students-from-spreadsheets, enrolling-students-in-olympiad-exams-via-api, downloading-results-and-certificates-via-api and managing-api-access-and-tokens. The spreadsheet skill is now written against createStudentImport and getStudentImport: it builds one request body of 30 to 1000 rows, reads the 422 row list, and polls the import until it has succeeded or failed. Nothing in the kit describes the MCP server, which is a separate service. No operation, field, permission or error code changed.

Release notes for 1.1.1

1.1.0

Three new operations — bulk registration, its status, and a registration pre-check — with an email filter on listStudents, a signedIn field and filter on listOrgStudents, and an optional details object on error bodies. Nothing that worked against 1.0.1 changes.

Added

  • createStudentImport: POST /v1/student/import registers 30 to 1000 students in one request. Every row follows registerStudent's rules and takes everything it takes except password, plus an optional externalRef of your own that is echoed back. The whole batch is checked before anything is queued; the answer is 202 with the import and a Location header, and the students are registered in the background. They are written in one transaction: a batch registers every row or registers nothing, so there is no partial import to reconcile. Each student gets the same welcome email registerStudent sends. Limits: one unfinished import per account (409 otherwise), 10 requests an hour, and bodies up to 1.5 MB on this operation where every other takes 100 kB. Sending the same rows again inside 24 hours answers with the import you already have rather than a second one. It needs student/create on mto, the permission registration needs.
  • getStudentImport: GET /v1/student/import/{importId} returns one of your imports and one page of its rows, with page and limit. status is queued, running, succeeded, failed or cancelled; on succeeded every row carries the student's _id, and on anything else no student of that batch was registered. An import stops being readable 30 days after it finishes and then answers 404, as does one another account sent. It needs student/create on mto.
  • Error bodies may carry an optional details object, and createStudentImport is the first operation to send one: its 422 puts every row it cannot register in error.details.rows, each with its position, the property at fault and a code to branch on. Ignore a details you do not recognise; no other operation sends one.
  • checkStudentRegistration: POST /v1/student/check runs the checks registerStudent makes before it creates anything, on the same body without password, and answers 200 with what they found: valid; every country, grade, city or school that matches nothing, with the message registration would refuse it with; the _id each reference resolves to; and whether one of your students already has the email address, with that student's _id. Nothing is created and no username is issued. It needs student/create on mto, the permission registration needs. Only your own students are checked for the address, so an address a student on another account holds is still refused by registerStudent alone.
  • listStudents: an optional email query parameter lists only your students who have one of up to 100 addresses, separated by commas, matched exactly and without regard to case. A value that is not such a list is refused with 400 bad_request.
  • listOrgStudents: each student carries signedIn, whether they have signed in to that organization at least once, and an optional signedIn query parameter, true or false, lists only the students who have or only those who have not. Any other value is refused with 400 bad_request. createApplication and linkStudentSupervisor on an organization need the student to have signed in there once.

Release notes for 1.1.0

1.0.1

The sandbox is live and the contract names it as a second server, and the olympiad's site now requires students to confirm their email address. No operation, field or error code changes.

Added

  • The contract's server list names the sandbox, https://apisnd.main-team.org, after production, marked x-environment: sandbox. Production stays the first entry, so a tool that takes the first server still calls production. No operation changes.

Changed

  • The sandbox is live at https://apisnd.main-team.org/v1. It runs the same release as production, with separate accounts issued by Main Team, seeded reference data with production's organization ids, no emails and test-mode payments. Registration is open there, with the same permissions and rate limits as in production. The official client libraries accept only the production base URL, so call the sandbox over HTTPS directly. The "Try it" console on the reference pages works against the sandbox with a token you paste. Students pay in the sandbox with test cards, such as 4242 4242 4242 4242; the Environments page lists them. Test cards never work in production.
  • createSigninLink: a student whose email address is not confirmed must now confirm it before they can use the olympiad's site, My Exams included, so they confirm before they can start an exam. The site asks for a 6-digit code on every page until the address is confirmed, and the student can no longer put it off; signing out is the only way out. A student already inside an exam room is not interrupted. Only the confirmation on the student's main record counts. A code is valid for 15 minutes, and a new one can be requested after 60 seconds. The sandbox sends no emails, so it doesn't ask. Have your students confirm well before an exam day, for example right after their first sign-in. The request, its answers and the link are unchanged.
  • Documentation corrections: the pages that called the sandbox planned now describe it as it runs, and every page that called the email confirmation on the olympiad's site prompt optional now describes it as required. The pages no longer write a current version number into their text: the API reference shows the version they describe, and the changelog lists every version.

Release notes for 1.0.1

1.0.0

Initial release of the v1 partner API, with 35 operations for students, sign-in links, exams, applications, certificates and reports.

Added

Release notes for 1.0.0

Search the API documentation

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