Register many students at once
- Bearer token
- Permission
student/create - Core record
Registers 30 to 1000 students in one request. Every row follows registerStudent’s rules exactly, so read that operation first: this one is the same registration, a class at a time.
It answers before it registers anybody. The whole batch is checked while you wait — every field, every country, grade, city and school, and every email address — and then 202 with an import you read to follow it. The Location header is where to read it. Nothing exists yet when you get that answer: poll getStudentImport every few seconds until status is no longer queued or running.
All of them or none of them. A batch either registers every row or registers nothing. There is no partial import to reconcile and nothing to undo. A batch that fails says why, and you fix the rows and send it again.
New cities and schools. A city or school name that is not in our list yet is not a rejected row: it is added automatically, as in registerStudent. Look at spellings first: a misspelt name becomes a new school. A new name that is too long (more than 80 characters for a city, 120 for a school) or contains < or > is rejected as unknown_reference.
No passwords. A row takes everything registerStudent takes except password. Sign the students in with createSigninLink, or set a password per student afterwards with setStudentPassword.
The welcome email is the one registerStudent sends, one per student, with the same text.
Limits. One unfinished import per account: send the next batch when this one has finished. 10 requests an hour. Bodies up to 1.5 MB here, where every other operation takes 100 kB.
Exams and the wallet. A row may carry exams (at most 10, and 2000 in the whole batch): { organizationId, examId } each, checked by the rules createApplication applies. The students, their records in the organizations named, the applications and their payments are registered all or none. With walletPay: true on the batch every priced exam is paid from your wallet, one credit each, in the same all-or-nothing way; without it the applications are created unpaid. walletPay always needs an enabled wallet, and application/create and application/pay on every organization named, else 403 before anything is checked. The credit check when you submit is only a first check: a batch the wallet cannot cover is refused with 409 insufficient_credits (every organization it needs, with needed, available and short), but the credits are taken when the import runs, and one spent elsewhere meanwhile fails the import with failure.code insufficient_credits, nothing registered.
Sending the same batch twice is safe. The same rows from your account inside 24 hours answer with the import you already have, not a second one, so a request whose answer you never saw can simply be sent again.
If anything is wrong with the rows the answer is 422, nothing is queued, and error.details.rows lists every row at fault with its position, property and a code to branch on. Fix them and send the batch again.
Request body
studentsarray of StudentImportRowrequiredThe students to register, 30 to 1000 of them. Below that, call
registerStudentper student: an import answers before it has registered anyone, so for a handful of students it is slower than registering them one by one.min items
30max items100015 fields of each item
firstNamestringrequiredThe student’s first name. Printed on certificates and reports, followed by
lastName.example
JanelastNamestringrequiredThe student’s surname. Printed on certificates and reports after
firstName. It cannot be empty.example
DoebirthstringrequiredDate of birth as
DD/MM/YYYY, and a date that exists:31/02/2008is refused. An ISO date such as2008-05-14is refused.pattern
^(0[1-9]|[12]\d|3[01])\/(0[1-9]|1[0-2])\/\d{4}$example14/05/2008sexstringrequiredOne of
m,forn.one of
mfnexample
femailstringrequiredThe student’s email address, stored in lower case. An address belongs to one student on the whole platform, so one already registered, by your account or another, is refused with 409.
format
emailexamplejane.doe@example.comemail2stringLeave this out. Any value but an empty one is refused with 400.
phonestringA phone number, stored as you send it. No format is checked. On an update,
""clears it.example
+1 555 0100countrystringrequiredThe
_idof a country, fromlistCountries(GET /v1/country). An id only: a name or an ISO code is refused. Its two-letter code starts the student’susername.pattern
^[0-9a-fA-F]{24}$example6650a1b2c3d4e5f6a7b8c9d1subdivisionstringThe
_idof a subdivision (a state) ofcountry, fromlistCountrySubdivisions, or its full ISO 3166-2 code such asUS-CA. Required for a country whose students must have one: a United States student needs a state, and registration without it is refused with 400subdivision_required. Optional for every other country. A subdivision of another country is refused with 400. It never changes theusername.example
6650a1b2c3d4e5f6a7b8c9f2gradestringrequiredThe
_idof a grade, fromlistGrades(GET /v1/grade), or its name,1to12. Either way the grade’s_idis what is stored. One that matches no grade is refused with 400, and so is the Graduated grade (GRADUATED), which no partner may set unless the student already holds it. The grade decides which exams the student is offered.example
10schoolstringrequiredThe
_idof a school, or its name. There is no list of schools: send the name your records hold. A school name that is not in our list yet is added automatically; check first withcheckStudentRegistration(willCreate.school) to catch a typo. A new name may be at most 120 characters, without<or>. An_idthat matches no school is refused with 400.example
Springfield High SchoolcitystringrequiredThe
_idof a city, or its name. There is no list of cities: send the name your records hold. A city name that is not in our list yet is added automatically; check first withcheckStudentRegistration(willCreate.city). A new name may be at most 80 characters, without<or>. An_idthat matches no city is refused with 400.example
SpringfieldactivatedPlatformsThisSeasonarray of stringThe organizations the student takes part in this season, by
slug(aslistOrganizationsgives it, ormto, which every student is on), orcommonfor every organization. Registration sets["common"]when you leave it out;nullis refused with 400. At most 6 entries.each one of
commonstemhilinguaneogmathcodingmax items
6example["common"]externalRefstringYour own reference for this row, echoed back when you read the import. Not stored on the student and not required to be unique. At most 64 characters.
max length
64exampleroster-2026-114examsarray of StudentExamChoiceExams to enter the new student for, at most 10. Each one is checked by the rules
createApplicationapplies, and the application is created in the same all-or-nothing write as the student. Pending (unpaid) unlesswalletPayistrue.max items
102 fields of each item
organizationIdstringrequiredThe
_idof the organization the exam belongs to, fromlistOrganizations. Not its name or slug.example
64b7f0c2a1d3e4f5a6b7c8d9examIdstringrequiredThe exam’s
_id: a leafexamIdoflistAvailableExams, or an_idfromlistExams. It must be an exam the student could be entered for.example
6650a1b2c3d4e5f6a7b8c9e1
clientReferencestringYour own name for this batch, echoed back when you read the import. At most 64 characters.
max length
64exampleyear-10-autumn-2026walletPaybooleanPay every priced exam in
examsfrom your wallet, one credit each, in the same all-or-nothing write. Needs an enabled wallet (opened by Main Team only after an agreement and on your request, never through the API) and theapplication/paypermission on each organization, even when no credit ends up being needed. Leave it out, orfalse, and the applications are created unpaid. Applies to every row. Credits are taken when the import runs, in the same write as the students; the check when you submit is only a first check.example
false
Responses
202 Accepted
Accepted: message is "Import accepted. The students are registered in the background; read the import to follow it.".
Or message is "You already sent this batch. Its import is unchanged.": You sent these exact rows inside the last 24 hours. The import in data is the one you already have; no second one was made.
Body
successbooleanrequiredAlways
trueon a success.one of
truemessagestringrequireddataobject · StudentImportResponserequiredA batch of students you asked to register, and what has happened to it.
13 fields of data
_idstringrequiredThe import’s
_id. Read it withgetStudentImport.example
65f0c2a1d3e4f5a6b7c8d901statusstringrequiredqueueduntil the import starts,runningwhile it registers, thensucceededorfailed.cancelledmeans Main Team stopped it. There is no partial import: on anything butsucceededno student of this batch was registered.one of
queuedrunningsucceededfailedcancelledexample
queuedtotalnumberrequiredHow many rows you sent.
example
250registerednumberrequiredHow many students were registered:
totalonce the import has succeeded, and 0 until then and for ever after a failure.example
250clientReferencestringThe
clientReferenceyou sent, if you sent one.example
year-10-autumn-2026walletPaybooleanPresent and
truewhen the batch asked to pay its exams from the wallet.example
truecreditsNeededobjectWith
walletPay: the credits per organization the batch needed when it was accepted. The credits are taken when the import runs, and spending them elsewhere in between can fail it.example
{"stem":30}failureobject · StudentImportFailureResponseSet once the import has failed or been cancelled.
3 fields of failure
codestringrequiredA stable machine code.
rows_rejected: a row stopped being registrable between the check and the write, most often because its address was registered in between; the rows say which.forbidden: the account may no longer register students.cancelled: Main Team stopped it.insufficient_credits: the batch hadwalletPayand the wallet no longer held enough credits when the import ran;details.organizationslists what each organization needed.wallet_not_enabled: the wallet was closed in between. Nothing was registered or paid in either case.internal_error: something failed on our side.example
rows_rejectedmessagestringrequiredWritten for a person, and may change: never branch on it.
example
Two rows could no longer be registered. Nothing was registered.detailsobjectOn
insufficient_credits:organizations, each withneeded,availableandshort.
studentsarray of StudentImportRowResponserequiredOne page of the rows, in the order you sent them. Page it with
pageandlimit;pagination.totalcounts every row. Absent from the answer tocreateStudentImport, which has nothing to report yet.7 fields of each item
rownumberrequiredThe row’s position in the
studentsyou sent, counting from 0.example
0emailstringrequiredThe address you sent for this row, in lower case.
format
emailexamplejane.doe@example.comexternalRefstringThe
externalRefyou sent for this row, if you sent one.example
roster-2026-114statusstringrequiredpendinguntil the import runs, thenregisteredfor every row when it succeeds, orskippedfor every row when it does not. An import registers all of its students or none of them.one of
pendingregisteredskippedexample
registeredstudentIdstringThe student’s
_id, on aregisteredrow. Use it withgetStudent,createSigninLinkandcreateApplication.example
6650a1b2c3d4e5f6a7b8c9d0errorobject · StudentImportRowErrorResponseWhy this row could not be registered, when it could not.
4 fields of error
codestringrequiredA stable machine code: branch on this.
invalid_fieldandunexpected_fieldare the row’s own rules;unknown_referenceis acountry,subdivisionorgradethat matches nothing, acityorschool_idthat matches nothing, or a newcityorschoolname that breaks the limits;subdivision_requiredis a row whose country needs asubdivisionand that names none;duplicate_in_requestis the same address twice in your own body;email_taken_by_your_studentis one of your students;email_unavailableis an address that cannot be registered (also one an organization named in the row’sexamsalready holds), and the answer never says who holds it;exam_not_offeredis an entry ofexamsthat exists but could not be taken by this student, andexam_conflictone that takes the sitting of another entry of the row. Anexamsentry that names no organization or exam isunknown_reference, withfieldexams[i].organizationIdorexams[i].examId.one of
invalid_fieldunexpected_fieldunknown_referencesubdivision_requiredduplicate_in_requestemail_taken_by_your_studentemail_unavailableexam_not_offeredexam_conflictexample
email_taken_by_your_studentmessagestringrequiredWritten for a person, and may change: never branch on it.
example
One of your students already has this email address.studentIdstringOn
email_taken_by_your_student: the_idof the student of yours who has the address, so you can update them instead.example
6650a1b2c3d4e5f6a7b8c9d0duplicateOfnumberOn
duplicate_in_request: the earlier row in your own body with the same address.example
12
applicationsarray of StudentImportRowApplicationResponseOn a
registeredrow that hadexams: the applications created for the student, in the order of the row’sexams.6 fields of each item
organizationIdstringrequiredThe
_idof the organization the application is in.example
64b7f0c2a1d3e4f5a6b7c8d9organizationstringrequiredThe organization’s slug.
example
stemexamIdstringrequiredThe exam the row was entered for.
example
6650a1b2c3d4e5f6a7b8c9e1applicationIdstringrequiredUse it with the application operations.
example
6650a1b2c3d4e5f6a7b8c9e5paymentStatusstringrequiredpaidfor a wallet payment and for a free exam.one of
paidpendingexample
paidamountnumberCents.
example
5000
createdAtstringrequiredWhen you sent it.
format
date-timeexample2026-10-06T08:15:00.000ZstartedAtstringWhen the import started.
format
date-timeexample2026-10-06T08:15:04.000ZfinishedAtstringWhen it ended, whichever way it ended.
format
date-timeexample2026-10-06T08:15:09.000ZexpiresAtstringrequiredWhen this import stops being readable. After it,
getStudentImportanswers 404, exactly as it does for an import that never existed. The students stay registered.format
date-timeexample2026-11-05T08:15:09.000Z
Headers
LocationstringThe import’s own path,
/v1/student/import/{importId}. Read it to follow the batch.X-RateLimit-LimitintegerRequests your account may make to this operation per window (10 per 3600 seconds).
X-RateLimit-RemainingintegerRequests left in the current window.
X-RateLimit-ResetintegerSeconds until the current window ends.
Example
{
"data": {
"_id": "65f0c2a1d3e4f5a6b7c8d901",
"clientReference": "year-10-autumn-2026",
"createdAt": "2026-10-06T08:15:00.000Z",
"creditsNeeded": {
"stem": 30
},
"expiresAt": "2026-11-05T08:15:09.000Z",
"failure": {
"code": "rows_rejected",
"details": {
"organizations": [
{
"available": 12,
"needed": 30,
"organization": "stem",
"organizationId": "64b7f0c2a1d3e4f5a6b7c8d9",
"short": 18
}
]
},
"message": "Two rows could no longer be registered. Nothing was registered."
},
"finishedAt": "2026-10-06T08:15:09.000Z",
"registered": 250,
"startedAt": "2026-10-06T08:15:04.000Z",
"status": "queued",
"students": [
{
"applications": [
{
"amount": 5000,
"applicationId": "6650a1b2c3d4e5f6a7b8c9e5",
"examId": "6650a1b2c3d4e5f6a7b8c9e1",
"organization": "stem",
"organizationId": "64b7f0c2a1d3e4f5a6b7c8d9",
"paymentStatus": "paid"
}
],
"email": "jane.doe@example.com",
"error": {
"code": "email_taken_by_your_student",
"duplicateOf": 12,
"message": "One of your students already has this email address.",
"studentId": "6650a1b2c3d4e5f6a7b8c9d0"
},
"externalRef": "roster-2026-114",
"row": 0,
"status": "registered",
"studentId": "6650a1b2c3d4e5f6a7b8c9d0"
}
],
"total": 250,
"walletPay": true
},
"message": "Import accepted. The students are registered in the background; read the import to follow it.",
"success": true
}400 Bad request
bad_request: The body is not valid JSON, breaks a field’s rules, or has a field this operation does not accept ("property <name> should not exist").bad_request: A row breaks one ofregisterStudent’s rules. The message names the row and the property, counting rows from 0.bad_request:studentshas fewer than 30 rows or more than 1000. Below 30, callregisterStudentper student.bad_request: A row carriespassword, which this operation does not take, or any other property it does not accept.bad_request: The rows together carry more than 2000examsentries.
When
bad_requestThe body is not valid JSON, breaks a field’s rules, or has a field this operation does not accept ("property <name> should not exist").
bad_requestA row breaks one of
registerStudent’s rules. The message names the row and the property, counting rows from 0.bad_requeststudentshas fewer than 30 rows or more than 1000. Below 30, callregisterStudentper student.bad_requestA row carries
password, which this operation does not take, or any other property it does not accept.bad_requestThe rows together carry more than 2000
examsentries.
Example
{
"error": {
"code": "bad_request",
"documentation_url": "https://hub.main-team.org/api/errors#bad_request",
"message": "The request was malformed or contained invalid parameters.",
"request_id": "0b5c6d0e-8f7a-4b1c-9d2e-3f4a5b6c7d8e"
}
}Fields of the error body
errorobject · ErrorDetailrequiredWhat went wrong.
5 fields of error
codestringrequiredA stable machine code: branch on this. Each one is explained at
documentation_url.one of
invalid_emailbad_requestsubdivision_requiredunauthorizedforbiddennot_foundconflictpayload_too_largeunsupported_media_typeunprocessable_entitytoo_many_requestsinternal_errorservice_unavailableexample
not_foundmessagestringrequiredWritten for a person, and may change: never branch on it.
example
Not found!documentation_urlstringrequiredWhere this code is explained.
format
uriexamplehttps://hub.main-team.org/api/errors#not_foundrequest_idstringrequiredThis request’s id, also sent as the
X-Request-Idresponse header: the one you sent, when it was acceptable, or else one the API made. Quote it when you report a problem.example
0b5c6d0e-8f7a-4b1c-9d2e-3f4a5b6c7d8edetailsobjectPresent only where an operation says so, and then with the shape that operation documents — the rows it could not accept, say. Treat it as absent everywhere else, and ignore a
detailsyou do not recognise.
401 Unauthorized
unauthorized: The token is missing or malformed, is not signed with your account’s apiSecret, breaks the iat and exp rules, has expired or been revoked, or its account is not active. All of these answer the same.
When
unauthorizedThe token is missing or malformed, is not signed with your account’s
apiSecret, breaks theiatandexprules, has expired or been revoked, or its account is not active. All of these answer the same.
Example
{
"error": {
"code": "unauthorized",
"documentation_url": "https://hub.main-team.org/api/errors#unauthorized",
"message": "Authentication is required or the provided credentials are invalid.",
"request_id": "0b5c6d0e-8f7a-4b1c-9d2e-3f4a5b6c7d8e"
}
}Fields of the error body
errorobject · ErrorDetailrequiredWhat went wrong.
5 fields of error
codestringrequiredA stable machine code: branch on this. Each one is explained at
documentation_url.one of
invalid_emailbad_requestsubdivision_requiredunauthorizedforbiddennot_foundconflictpayload_too_largeunsupported_media_typeunprocessable_entitytoo_many_requestsinternal_errorservice_unavailableexample
not_foundmessagestringrequiredWritten for a person, and may change: never branch on it.
example
Not found!documentation_urlstringrequiredWhere this code is explained.
format
uriexamplehttps://hub.main-team.org/api/errors#not_foundrequest_idstringrequiredThis request’s id, also sent as the
X-Request-Idresponse header: the one you sent, when it was acceptable, or else one the API made. Quote it when you report a problem.example
0b5c6d0e-8f7a-4b1c-9d2e-3f4a5b6c7d8edetailsobjectPresent only where an operation says so, and then with the shape that operation documents — the rows it could not accept, say. Treat it as absent everywhere else, and ignore a
detailsyou do not recognise.
403 Forbidden
forbidden: The token is valid, but no role on your account allowsstudent/createonmto(the target of operations without:organizationIdin their path), or a role denies it.forbidden:examsorwalletPaywas sent and your account lacksapplication/create(or, forwalletPay,application/pay) on an organization named (error.details.reasonpermission_missing), orwalletPayistrueand no wallet is enabled (wallet_not_enabled). Nothing was queued.
When
forbiddenThe token is valid, but no role on your account allows
student/createonmto(the target of operations without:organizationIdin their path), or a role denies it.forbiddenexamsorwalletPaywas sent and your account lacksapplication/create(or, forwalletPay,application/pay) on an organization named (error.details.reasonpermission_missing), orwalletPayistrueand no wallet is enabled (wallet_not_enabled). Nothing was queued.
Example
{
"error": {
"code": "forbidden",
"documentation_url": "https://hub.main-team.org/api/errors#forbidden",
"message": "Insufficient role permissions",
"request_id": "0b5c6d0e-8f7a-4b1c-9d2e-3f4a5b6c7d8e"
}
}Fields of the error body
errorobject · ErrorDetailrequiredWhat went wrong.
5 fields of error
codestringrequiredA stable machine code: branch on this. Each one is explained at
documentation_url.one of
invalid_emailbad_requestsubdivision_requiredunauthorizedforbiddennot_foundconflictpayload_too_largeunsupported_media_typeunprocessable_entitytoo_many_requestsinternal_errorservice_unavailableexample
not_foundmessagestringrequiredWritten for a person, and may change: never branch on it.
example
Not found!documentation_urlstringrequiredWhere this code is explained.
format
uriexamplehttps://hub.main-team.org/api/errors#not_foundrequest_idstringrequiredThis request’s id, also sent as the
X-Request-Idresponse header: the one you sent, when it was acceptable, or else one the API made. Quote it when you report a problem.example
0b5c6d0e-8f7a-4b1c-9d2e-3f4a5b6c7d8edetailsobjectPresent only where an operation says so, and then with the shape that operation documents — the rows it could not accept, say. Treat it as absent everywhere else, and ignore a
detailsyou do not recognise.
404 Not found
not_found: Bulk registration is not switched on for the environment you are calling. Nothing was queued. Ask support before you build against it.
When
not_foundBulk registration is not switched on for the environment you are calling. Nothing was queued. Ask support before you build against it.
Example
{
"error": {
"code": "not_found",
"documentation_url": "https://hub.main-team.org/api/errors#not_found",
"message": "The requested resource could not be found.",
"request_id": "0b5c6d0e-8f7a-4b1c-9d2e-3f4a5b6c7d8e"
}
}Fields of the error body
errorobject · ErrorDetailrequiredWhat went wrong.
5 fields of error
codestringrequiredA stable machine code: branch on this. Each one is explained at
documentation_url.one of
invalid_emailbad_requestsubdivision_requiredunauthorizedforbiddennot_foundconflictpayload_too_largeunsupported_media_typeunprocessable_entitytoo_many_requestsinternal_errorservice_unavailableexample
not_foundmessagestringrequiredWritten for a person, and may change: never branch on it.
example
Not found!documentation_urlstringrequiredWhere this code is explained.
format
uriexamplehttps://hub.main-team.org/api/errors#not_foundrequest_idstringrequiredThis request’s id, also sent as the
X-Request-Idresponse header: the one you sent, when it was acceptable, or else one the API made. Quote it when you report a problem.example
0b5c6d0e-8f7a-4b1c-9d2e-3f4a5b6c7d8edetailsobjectPresent only where an operation says so, and then with the shape that operation documents — the rows it could not accept, say. Treat it as absent everywhere else, and ignore a
detailsyou do not recognise.
409 Conflict
conflict:walletPayistrueand the wallet holds fewer credits than the batch needs now.error.details.reasonisinsufficient_creditsanderror.details.organizationslists each organization withneeded,availableandshort. Nothing was queued.conflict: You already have an import that has not finished. Read it, and send the next one when it has.
When
conflictwalletPayistrueand the wallet holds fewer credits than the batch needs now.error.details.reasonisinsufficient_creditsanderror.details.organizationslists each organization withneeded,availableandshort. Nothing was queued.conflictYou already have an import that has not finished. Read it, and send the next one when it has.
Example
{
"error": {
"code": "conflict",
"documentation_url": "https://hub.main-team.org/api/errors#conflict",
"message": "The request conflicts with the current state of the resource.",
"request_id": "0b5c6d0e-8f7a-4b1c-9d2e-3f4a5b6c7d8e"
}
}Fields of the error body
errorobject · ErrorDetailrequiredWhat went wrong.
5 fields of error
codestringrequiredA stable machine code: branch on this. Each one is explained at
documentation_url.one of
invalid_emailbad_requestsubdivision_requiredunauthorizedforbiddennot_foundconflictpayload_too_largeunsupported_media_typeunprocessable_entitytoo_many_requestsinternal_errorservice_unavailableexample
not_foundmessagestringrequiredWritten for a person, and may change: never branch on it.
example
Not found!documentation_urlstringrequiredWhere this code is explained.
format
uriexamplehttps://hub.main-team.org/api/errors#not_foundrequest_idstringrequiredThis request’s id, also sent as the
X-Request-Idresponse header: the one you sent, when it was acceptable, or else one the API made. Quote it when you report a problem.example
0b5c6d0e-8f7a-4b1c-9d2e-3f4a5b6c7d8edetailsobjectPresent only where an operation says so, and then with the shape that operation documents — the rows it could not accept, say. Treat it as absent everywhere else, and ignore a
detailsyou do not recognise.
413 Payload too large
payload_too_large: The body is larger than 1.5 MB.
When
payload_too_largeThe body is larger than 1.5 MB.
Example
{
"error": {
"code": "payload_too_large",
"documentation_url": "https://hub.main-team.org/api/errors#payload_too_large",
"message": "request entity too large",
"request_id": "0b5c6d0e-8f7a-4b1c-9d2e-3f4a5b6c7d8e"
}
}Fields of the error body
errorobject · ErrorDetailrequiredWhat went wrong.
5 fields of error
codestringrequiredA stable machine code: branch on this. Each one is explained at
documentation_url.one of
invalid_emailbad_requestsubdivision_requiredunauthorizedforbiddennot_foundconflictpayload_too_largeunsupported_media_typeunprocessable_entitytoo_many_requestsinternal_errorservice_unavailableexample
not_foundmessagestringrequiredWritten for a person, and may change: never branch on it.
example
Not found!documentation_urlstringrequiredWhere this code is explained.
format
uriexamplehttps://hub.main-team.org/api/errors#not_foundrequest_idstringrequiredThis request’s id, also sent as the
X-Request-Idresponse header: the one you sent, when it was acceptable, or else one the API made. Quote it when you report a problem.example
0b5c6d0e-8f7a-4b1c-9d2e-3f4a5b6c7d8edetailsobjectPresent only where an operation says so, and then with the shape that operation documents — the rows it could not accept, say. Treat it as absent everywhere else, and ignore a
detailsyou do not recognise.
415 Unsupported media type
unsupported_media_type: The body declares a charset that is not a UTF one (send UTF-8), or a Content-Encoding other than gzip, deflate or br.
When
unsupported_media_typeThe body declares a charset that is not a UTF one (send UTF-8), or a
Content-Encodingother than gzip, deflate or br.
Example
{
"error": {
"code": "unsupported_media_type",
"documentation_url": "https://hub.main-team.org/api/errors#unsupported_media_type",
"message": "unsupported charset \"ISO-8859-1\"",
"request_id": "0b5c6d0e-8f7a-4b1c-9d2e-3f4a5b6c7d8e"
}
}Fields of the error body
errorobject · ErrorDetailrequiredWhat went wrong.
5 fields of error
codestringrequiredA stable machine code: branch on this. Each one is explained at
documentation_url.one of
invalid_emailbad_requestsubdivision_requiredunauthorizedforbiddennot_foundconflictpayload_too_largeunsupported_media_typeunprocessable_entitytoo_many_requestsinternal_errorservice_unavailableexample
not_foundmessagestringrequiredWritten for a person, and may change: never branch on it.
example
Not found!documentation_urlstringrequiredWhere this code is explained.
format
uriexamplehttps://hub.main-team.org/api/errors#not_foundrequest_idstringrequiredThis request’s id, also sent as the
X-Request-Idresponse header: the one you sent, when it was acceptable, or else one the API made. Quote it when you report a problem.example
0b5c6d0e-8f7a-4b1c-9d2e-3f4a5b6c7d8edetailsobjectPresent only where an operation says so, and then with the shape that operation documents — the rows it could not accept, say. Treat it as absent everywhere else, and ignore a
detailsyou do not recognise.
422 Unprocessable entity
unprocessable_entity: One or more rows cannot be registered. Nothing was queued. error.details.rows lists every row at fault with a code to branch on: invalid_field, unexpected_field, unknown_reference, subdivision_required (the row’s country needs a subdivision and the row names none), duplicate_in_request, email_taken_by_your_student (with that student’s _id), email_unavailable, which never says who holds the address, and for exams: exam_not_offered and exam_conflict. The list is left out, and only counted, when the only problem is unavailable addresses and your account has already been shown those rows several times today.
When
unprocessable_entityOne or more rows cannot be registered. Nothing was queued.
error.details.rowslists every row at fault with acodeto branch on:invalid_field,unexpected_field,unknown_reference,subdivision_required(the row’s country needs asubdivisionand the row names none),duplicate_in_request,email_taken_by_your_student(with that student’s_id),email_unavailable, which never says who holds the address, and forexams:exam_not_offeredandexam_conflict. The list is left out, and only counted, when the only problem is unavailable addresses and your account has already been shown those rows several times today.
Example
{
"error": {
"code": "unprocessable_entity",
"details": {
"rejected": 3,
"rows": [
{
"code": "invalid_field",
"field": "birth",
"message": "birth must be a real date in DD/MM/YYYY format",
"row": 4
},
{
"code": "email_taken_by_your_student",
"field": "email",
"message": "One of your students already has this email address.",
"row": 17,
"studentId": "652f1c9b8e4b2a0012a3c4d5"
},
{
"code": "duplicate_in_request",
"duplicateOf": 12,
"field": "email",
"message": "Row 12 has the same email address.",
"row": 31
}
],
"total": 250,
"truncated": false
},
"documentation_url": "https://hub.main-team.org/api/errors#unprocessable_entity",
"message": "3 of 250 rows cannot be registered. Nothing was registered and no import was queued; error.details.rows lists every problem.",
"request_id": "0b5c6d0e-8f7a-4b1c-9d2e-3f4a5b6c7d8e"
}
}Fields of the error body
errorobject · ErrorDetailrequiredWhat went wrong.
5 fields of error
codestringrequiredA stable machine code: branch on this. Each one is explained at
documentation_url.one of
invalid_emailbad_requestsubdivision_requiredunauthorizedforbiddennot_foundconflictpayload_too_largeunsupported_media_typeunprocessable_entitytoo_many_requestsinternal_errorservice_unavailableexample
not_foundmessagestringrequiredWritten for a person, and may change: never branch on it.
example
Not found!documentation_urlstringrequiredWhere this code is explained.
format
uriexamplehttps://hub.main-team.org/api/errors#not_foundrequest_idstringrequiredThis request’s id, also sent as the
X-Request-Idresponse header: the one you sent, when it was acceptable, or else one the API made. Quote it when you report a problem.example
0b5c6d0e-8f7a-4b1c-9d2e-3f4a5b6c7d8edetailsobjectPresent only where an operation says so, and then with the shape that operation documents — the rows it could not accept, say. Treat it as absent everywhere else, and ignore a
detailsyou do not recognise.
429 Too many requests
too_many_requests: Your account has made more than 10 requests to this operation in the current hour. Wait the seconds in Retry-After before sending again. This operation has a budget of its own, lower than the 100 per 60 seconds every other operation gets.
When
too_many_requestsYour account has made more than 10 requests to this operation in the current hour. Wait the seconds in
Retry-Afterbefore sending again. This operation has a budget of its own, lower than the 100 per 60 seconds every other operation gets.
Headers
Retry-AfterintegerSeconds to wait before sending again; a request sent sooner is refused too.
Example
{
"error": {
"code": "too_many_requests",
"documentation_url": "https://hub.main-team.org/api/errors#too_many_requests",
"message": "Too many requests to this operation. Wait the number of seconds in Retry-After, then try again.",
"request_id": "0b5c6d0e-8f7a-4b1c-9d2e-3f4a5b6c7d8e"
}
}Fields of the error body
errorobject · ErrorDetailrequiredWhat went wrong.
5 fields of error
codestringrequiredA stable machine code: branch on this. Each one is explained at
documentation_url.one of
invalid_emailbad_requestsubdivision_requiredunauthorizedforbiddennot_foundconflictpayload_too_largeunsupported_media_typeunprocessable_entitytoo_many_requestsinternal_errorservice_unavailableexample
not_foundmessagestringrequiredWritten for a person, and may change: never branch on it.
example
Not found!documentation_urlstringrequiredWhere this code is explained.
format
uriexamplehttps://hub.main-team.org/api/errors#not_foundrequest_idstringrequiredThis request’s id, also sent as the
X-Request-Idresponse header: the one you sent, when it was acceptable, or else one the API made. Quote it when you report a problem.example
0b5c6d0e-8f7a-4b1c-9d2e-3f4a5b6c7d8edetailsobjectPresent only where an operation says so, and then with the shape that operation documents — the rows it could not accept, say. Treat it as absent everywhere else, and ignore a
detailsyou do not recognise.
500 Internal error
internal_error: Something failed on our side. Retry later, and quote request_id if it goes on.
When
internal_errorSomething failed on our side. Retry later, and quote
request_idif it goes on.
Example
{
"error": {
"code": "internal_error",
"documentation_url": "https://hub.main-team.org/api/errors#internal_error",
"message": "An unexpected error occurred.",
"request_id": "0b5c6d0e-8f7a-4b1c-9d2e-3f4a5b6c7d8e"
}
}Fields of the error body
errorobject · ErrorDetailrequiredWhat went wrong.
5 fields of error
codestringrequiredA stable machine code: branch on this. Each one is explained at
documentation_url.one of
invalid_emailbad_requestsubdivision_requiredunauthorizedforbiddennot_foundconflictpayload_too_largeunsupported_media_typeunprocessable_entitytoo_many_requestsinternal_errorservice_unavailableexample
not_foundmessagestringrequiredWritten for a person, and may change: never branch on it.
example
Not found!documentation_urlstringrequiredWhere this code is explained.
format
uriexamplehttps://hub.main-team.org/api/errors#not_foundrequest_idstringrequiredThis request’s id, also sent as the
X-Request-Idresponse header: the one you sent, when it was acceptable, or else one the API made. Quote it when you report a problem.example
0b5c6d0e-8f7a-4b1c-9d2e-3f4a5b6c7d8edetailsobjectPresent only where an operation says so, and then with the shape that operation documents — the rows it could not accept, say. Treat it as absent everywhere else, and ignore a
detailsyou do not recognise.
503 Service unavailable
service_unavailable: The API is already checking another batch. Nothing was queued; wait the seconds inRetry-Afterand send it again.service_unavailable: Bulk registration is paused for a scheduled window, such as an exam morning. Nothing was queued;Retry-Afteris how long the window lasts. An import already queued is not lost — it waits and then runs.service_unavailable: Checking the batch took too long. Nothing was queued; send it again, or in smaller batches.
When
service_unavailableThe API is already checking another batch. Nothing was queued; wait the seconds in
Retry-Afterand send it again.service_unavailableBulk registration is paused for a scheduled window, such as an exam morning. Nothing was queued;
Retry-Afteris how long the window lasts. An import already queued is not lost — it waits and then runs.service_unavailableChecking the batch took too long. Nothing was queued; send it again, or in smaller batches.
Headers
Retry-AfterintegerSeconds to wait before sending again; a request sent sooner is refused too.
Example
{
"error": {
"code": "service_unavailable",
"documentation_url": "https://hub.main-team.org/api/errors#service_unavailable",
"message": "The API is already checking another import. Send it again in a few seconds.",
"request_id": "0b5c6d0e-8f7a-4b1c-9d2e-3f4a5b6c7d8e"
}
}Fields of the error body
errorobject · ErrorDetailrequiredWhat went wrong.
5 fields of error
codestringrequiredA stable machine code: branch on this. Each one is explained at
documentation_url.one of
invalid_emailbad_requestsubdivision_requiredunauthorizedforbiddennot_foundconflictpayload_too_largeunsupported_media_typeunprocessable_entitytoo_many_requestsinternal_errorservice_unavailableexample
not_foundmessagestringrequiredWritten for a person, and may change: never branch on it.
example
Not found!documentation_urlstringrequiredWhere this code is explained.
format
uriexamplehttps://hub.main-team.org/api/errors#not_foundrequest_idstringrequiredThis request’s id, also sent as the
X-Request-Idresponse header: the one you sent, when it was acceptable, or else one the API made. Quote it when you report a problem.example
0b5c6d0e-8f7a-4b1c-9d2e-3f4a5b6c7d8edetailsobjectPresent only where an operation says so, and then with the shape that operation documents — the rows it could not accept, say. Treat it as absent everywhere else, and ignore a
detailsyou do not recognise.