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) andlistWalletEntries(GET /v1/wallet/entries), under the new permissionwallet/readonmto, read your balance (granted, spent and remaining for each olympiad, what the spent credits paid in cents and their currency,USDfor neo andEURfor the others) and the history of every credit added and spent, with filters.payApplicationFromWallet(POST /v1/{organizationId}/application/{applicationId}/wallet-pay) andpayApplicationsFromWallet(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 permissionapplication/pay.createApplicationtakes an optionalwalletPayand answersdata.wallet; a repeat call withwalletPay: truepays 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 andwalletPay: trueanswer403witherror.details.reasonwallet_not_enabled. New reasons under existing error codes:forbidden(wallet_not_enabled,permission_missing),conflict(insufficient_credits, witherror.details.organizations,already_paid,payment_canceled,payment_in_progress,payment_changed) andservice_unavailable(wallet_unavailable). A role ofapplication/*,*/*or*grantsapplication/pay, and*/read,*/*or*grantswallet/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.
registerStudentand each row ofcreateStudentImporttake an optionalexams: up to 10 entries of{ organizationId, examId }(an import: 2000 in the whole batch), checked by the rulescreateApplicationapplies. The student, their registration on each olympiad named, the applications and their payments are saved together or not at all.registerStudentandcreateStudentImportalso take an optionalwalletPay: 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: truealways needs an enabled wallet (403wallet_not_enabledotherwise, even when every exam is free) andapplication/createandapplication/payon every organization named (403permission_missing, listing what is missing).registerStudentanswersdata.applications(anddata.wallet);checkStudentRegistrationtakesexamsandwalletPayand answersdata.exams(price, currency,free,credits, or theproblem) anddata.wallet(enabled,needed,available,sufficient), and writes nothing. For an import,getStudentImportaddswalletPay,creditsNeededand, on each registered row,applications. The credit check when an import is submitted is advisory (409insufficient_credits, every organization the batch needs); the credits are taken when it runs. Closed sets gain values: a rowcodecan beexam_not_offeredorexam_conflict, and an importfailure.codecan beinsufficient_creditsorwallet_not_enabled, withfailure.details.organizations. These values are reachable only by requests that sendexamsorwalletPay, so no working call changes; a client that switches over these sets exhaustively needs the new cases. A batch sent again withwalletPayis not mistaken for the same batch sent without it. WithoutexamsandwalletPayboth operations behave exactly as before. checkStudentRegistrationanswersdata.willCreate,{ city, school }:truefor acityorschoolname 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
createApplicationno longer answers409(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 that409when 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.createApplicationandmoveApplicationprice acodingapplication 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,updateStudentandupdateOrgStudentnow add it automatically. Before, such a name was refused with400 bad_request(… is not a known school. This API does not create reference data.).checkStudentRegistrationshows 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 codeunknown_referencein an import). Acountryorgradethat matches nothing, and an_idthat matches nothing, are refused as before. Not a breaking change: only calls that failed before now succeed.
Removed
- An application no longer carries
ExamBucksRedeemed.listApplications,listExamApplications,listStudentApplications,getApplication,createApplication,moveApplicationanddeleteApplicationreturned it indata(asfalse, ortrueon an old record) although no response schema declared it: it never had a meaning for a partner. It is gone from the examples in the documentation too. Not a breaking change: the field was undocumented. A client that read it must treat a missing field asfalse, and a client that sent it was already refused (400,property ExamBucksRedeemed should not exist).
1.6.0
1 change: 1 changed.
Changed
linkStudentSupervisorno longer replaces a supervisor the student already has on that organization: replacing one is paused for now, and such a call answers409 conflictwitherror.details.reasonsupervisor_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
listGradesno longer lists the Graduated grade (GRADUATED, the grade after12for a student who has left school), andregisterStudent,checkStudentRegistration,createStudentImport,updateStudentandupdateOrgStudentrefuse it asgrade, by name or by_id, with400 bad_request(grade cannot be Graduated: …; aproblemsentry incheckStudentRegistration, the row codeunknown_referenceincreateStudentImport). An update that sends back the grade a student already holds is still accepted, andgetGradeand 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.listStudentReportsno longer returns a report'sextrasdata. Ofextrasit keeps only the award (medal,medalDescription) andisCanceled.extraswas never part of the documented contract; the report PDF andreportDetailare 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
listCountrySubdivisions(GET /v1/country/{id}/subdivision) lists the subdivisions of a country, such as the 50 United States and the District of Columbia, a page at a time, with each one's_id, ISO 3166-2code,nameandtz. It needs thecountry/readpermission you already hold forlistCountries, so no role changes. An unknown or reserved country answers404 not_found, asgetCountrydoes; a country without subdivisions answers an empty page, which means its students need no subdivision.- The student operations take an optional
subdivision:registerStudent,checkStudentRegistration,createStudentImport(on each row),updateStudentandupdateOrgStudent. Send the subdivision's_idor its full ISO 3166-2 code (US-CA, never a bareCAor a name). It must belong to the student'scountry; anything else answers400 bad_request. Subdivision_ids are the same in every organization and in the sandbox. A student'susernamenever depends on it.getStudent,listStudents,getOrgStudent,listOrgStudents,linkStudentSupervisorandsetStudentPasswordreturn it (resolved into a record on the reads, an id on the writes), andcheckStudentRegistrationreturns it inresolvedand may list it inproblems[].field. listCountriesandgetCountryreturnsubdivisionRequired(truefor the United States) andsubdivisionLabel(State) on a country that has them, and in thecountriesan exam or a student carries (listExams,getExam,getStudentand the other reads that resolve a country).- Exams can be limited to states:
listExams,getExam,listAvailableExams,getApplication,listApplicationsandlistStudentApplicationsreturnsubdivisionson an exam. An exam that lists states of the student's country is offered only to students of those states (listAvailableExams), andcreateApplicationandmoveApplicationanswer409 conflict("Exam is not available in this student's state. It is offered in …") for any other student of that country. An exam that lists no states behaves as before. - A new error code,
subdivision_required(400), and the same code as a row code ofcreateStudentImportandgetStudentImport: the student's country needs a subdivision and none is given or stored. See the error reference.
Changed
- Versioning exception: a United States student needs a state. For a country whose
subdivisionRequiredistrue,registerStudentand each row ofcreateStudentImportneed asubdivision, andcheckStudentRegistrationreports its absence inproblems. A body that omitted it and was accepted before is now refused with400 subdivision_required(a row with the row codesubdivision_required). This is deliberately not announced as a breaking change, because no field became required in the contract: the rule follows the country's ownsubdivisionRequiredflag, which isfalsefor 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. updateStudentandupdateOrgStudentcheck the state only when the body changescountryor sendssubdivision: a country that needs a state, with no state of that country on the student or in the body, is refused with400 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,createApplicationandmoveApplicationanswer400 subdivision_requiredfor 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
countriesand the idslistCountriesreturns are the same ids (the platform keeps one id per country); the documentation no longer says they may differ. Nothing enforces it, so comparing byiso2still always works. tzon a country is documented as the zone for students without a subdivision; the example showedAmerica/New_York, and the United States row isAmerica/Chicago. A student with asubdivisionsits alocalexam in the subdivision's owntz.
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
createApplicationtakes an optionalexternalRef, your own reference for the application (trimmed, 1 to 64 characters, no control characters or line breaks;nullis refused). It is stored on the application and returned bycreateApplication,getApplication,listApplications,listExamApplications,listStudentApplications,moveApplicationanddeleteApplication. A repeat of the create for an application that has noexternalRefsets it; a repeat with the same one, or none, answers200as before; a repeat with a different one answers409 conflict("Application already exists with a different externalRef, …") and changes nothing. A server that cannot store it yet answers503 service_unavailableand writes nothing.listApplications,listExamApplicationsandlistStudentApplicationstake two optional filters:externalRef(exact match) andpaymentStatus(pending,paidorcanceled). They only narrow the list, combine, and are counted inpagination.total. A filter that cannot be read answers400 bad_request.- On
getApplication,listApplications,listExamApplicationsandlistStudentApplications, apaidpayment settled through a transaction carriesreference, the code Main Team quotes when it confirms a payment (for examplestx-6718a2f4c1d3e). It is absent otherwise. - A guide for partners who collect exam fees themselves: Settling payments.
Changed
- How you receive your credentials: Main Team emails a one-time link, never the secret. The link shows
apiKeyandapiSecretonce 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 with409 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,createApplicationandupdateApplicationfollow 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/clientsanswers301to it. No operation changed.
Fixed
- The documentation of
price(listExams,getExam,listAvailableExams) and ofpayment.amount(createApplication,getApplication,listApplications,listExamApplications,listStudentApplications,moveApplication,deleteApplication) now says what the API has always returned: whole numbers in the smallest unit of the currency, cents for euro, so2500is 25.00. The examples used to show25. No value changed.
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.
getGroupChallengeGroupgainsconsent({ required, received, memberCount }, counted over the group's active members, ornullwhen the challenge does not ask for consent) and, on each ofyourStudents,consentReceived(true,false, ornullwhen not asked).canFinalSubmitisfalseuntil every active member's form is in. The forms themselves are never shown. submitGroupChallengeWorkanswers409 conflictwith the newdetails.reasonconsent_missing, withconsentsReceivedandmemberCountindetails, 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 answers200withchanged: false. Groups of a challenge that does not ask for consent are answered exactly as before.
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-challengewith the tag "Group challenges" and the permissiongroup-challenge/read(also granted by*/read,*/*and*):listGroupChallengesandgetGroupChallengeread the challenges an organization runs;listGroupChallengeStudentsandgetGroupChallengeStudentsay where each of your students stands (eligible by grade, in a group, the group's state) and give thepanelPathto send them to withcreateSigninLink;listGroupChallengeGroupsandgetGroupChallengeGroupread the groups your students are in, with each step and its files;listGroupChallengeActivitylists what happened in a group. Only your own students are named: every other person is their role alone. The operations answer404on 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):submitGroupChallengeStepsubmits a group's open step and opens the next, andsubmitGroupChallengeWorksends 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 answers200withchanged: false.
Changed
submitGroupChallengeStepandsubmitGroupChallengeWorkare the first operations whose409 conflictcarrieserror.details.reason(challenge_closed,window_closed,payment_pending,group_not_confirmed,step_locked,step_empty,steps_incomplete), and whose503 service_unavailablecarriesdetails.reason: busywithRetry-After: 1when the group is being changed by someone else. The error reference for both codes says so.- The agent kit has a seventh skill,
following-group-challenges-via-api: reading where your students stand withlistGroupChallengeStudentsandgetGroupChallengeGroupbefore submitting withsubmitGroupChallengeSteporsubmitGroupChallengeWork, never looping on a409, and sending a student to a challenge withcreateSigninLinkandpanelPath.
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-apiandmanaging-api-access-and-tokens. The spreadsheet skill is now written againstcreateStudentImportandgetStudentImport: it builds one request body of 30 to 1000 rows, reads the422row 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.
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/importregisters 30 to 1000 students in one request. Every row followsregisterStudent's rules and takes everything it takes exceptpassword, plus an optionalexternalRefof your own that is echoed back. The whole batch is checked before anything is queued; the answer is202with the import and aLocationheader, 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 emailregisterStudentsends. Limits: one unfinished import per account (409otherwise), 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 needsstudent/createonmto, the permission registration needs.getStudentImport:GET /v1/student/import/{importId}returns one of your imports and one page of its rows, withpageandlimit.statusisqueued,running,succeeded,failedorcancelled; onsucceededevery 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 answers404, as does one another account sent. It needsstudent/createonmto.- Error bodies may carry an optional
detailsobject, andcreateStudentImportis the first operation to send one: its422puts every row it cannot register inerror.details.rows, each with its position, the property at fault and a code to branch on. Ignore adetailsyou do not recognise; no other operation sends one. checkStudentRegistration:POST /v1/student/checkruns the checksregisterStudentmakes before it creates anything, on the same body withoutpassword, and answers200with what they found:valid; everycountry,grade,cityorschoolthat matches nothing, with the message registration would refuse it with; the_ideach 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 needsstudent/createonmto, 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 byregisterStudentalone.listStudents: an optionalemailquery 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 with400 bad_request.listOrgStudents: each student carriessignedIn, whether they have signed in to that organization at least once, and an optionalsignedInquery parameter,trueorfalse, lists only the students who have or only those who have not. Any other value is refused with400 bad_request.createApplicationandlinkStudentSupervisoron an organization need the student to have signed in there once.
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, markedx-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.
1.0.0
Initial release of the v1 partner API, with 35 operations for students, sign-in links, exams, applications, certificates and reports.
Added
- Health:
getHealth. - API account:
getCurrentApiAccount,revokeToken. - Reference data:
listCountries,getCountry,listGrades,getGrade,listOrganizations,getOrganization. - Students:
listStudents,getStudent,registerStudent,updateStudent,setStudentPassword,listOrgStudents,getOrgStudent,updateOrgStudent,linkStudentSupervisor. - Sign-in links:
createSigninLink. - Exams:
listExamCategories,getExamCategory,listExams,listAvailableExams,getExam. - Applications:
listApplications,listExamApplications,listStudentApplications,getApplication,createApplication,moveApplication,deleteApplication. - Documents:
listStudentCertificates,downloadCertificate,listStudentReports,downloadReport. - Authentication with self-signed HS256 tokens, where
kidandsubare the apiKey, andiatandexpare required with a lifetime of at most 3600 seconds and 30 seconds of clock tolerance. Every authentication failure answers the same401 unauthorized. - Permissions by role, checked against the organization each request acts on. An operation with no permission granted answers
403 forbidden. - Response envelopes:
{ success, message, data, pagination? }on success, and{ error: { code, message, documentation_url, request_id } }on failure, with anX-Request-Idheader on every response.documentation_urlis the code's entry on the partner documentation,https://hub.main-team.org/api/errors#<code>. - Pagination with
page(default 1) andlimit(default 20, at most 100). - A rate limit of 100 requests per 60 seconds for each account and each operation, with
Retry-AfterandX-RateLimit-*headers. Each operation has its own budget. Going over answers429 too_many_requestswith the message "Too many requests to this operation. Wait the number of seconds in Retry-After, then try again." createSigninLink: sign-in links that are valid for 120 seconds and work once, for a student with access to that organization.getStudent,getOrgStudent,getCountry,getGrade,getOrganizationandgetExamCategoryanswer404 not_foundfor an id they cannot show, as every single read does. A student of another account answers like a missing one.getApplication,moveApplicationanddeleteApplicationanswer404with "Application not found!" alike for a missing application and one of another account's student.listOrganizationsandgetOrganizationserve the five organizations that run exams:stem,hilingua,neo,gmathandcoding. On every operation withorganizationIdin its path, the id of any other organization,mto's included, answers404 not_foundwith "Organization not found!", as an id that names no organization does.getCurrentApiAccountreturns the account'sroles, each witheffect,action,targetand, when set,authorized, to compare with an operation'sx-permission.registerStudentrequiresfirstName,lastName,email,birth,sex,country,grade,cityandschool, withbirtha date that exists, as DD/MM/YYYY, and names a missing field in its400("lastName should not be empty").updateStudentandupdateOrgStudenthold the fields they are sent to the same rules, and refusenullforfirstName,lastName,birth,sexandphone.registerStudentrefuses anullphonetoo.activatedPlatformsThisSeasononregisterStudent,updateStudentandupdateOrgStudenttakescommon,stem,hilingua,neo,gmathandcoding. The two updates add to the student's list and never remove from it.updateOrgStudentwithout the field, even with an empty body, adds its own organization, unless the list already holdscommon. All three refusenullfor it with400;registerStudentwithout it stores["common"].- Passwords: a
passwordatregisterStudent, andsetStudentPassword, needauth/signinonmto. A password is 5 characters to 72 bytes and contains none of the student's own details.setStudentPasswordanswers409once the student has confirmed their email address. linkStudentSupervisoranswers every refusal with the same404"Not found!".createApplicationis safe to repeat: the same student and exam answer200with the existing application.