[{"data":1,"prerenderedAt":1536},["ShallowReactive",2],{"api-nav":3,"api-spec:index":362,"api-spec:op:list-country-subdivisions":677,"api-permissions-guide":983,"api-reference-doc:list-country-subdivisions":984},[4,28,57,104,124,328,342],{"id":5,"title":6,"links":7,"groups":27},"start","Start here",[8,11,15,18,21,24],{"title":9,"to":10},"Overview","\u002Fapi",{"title":12,"to":13,"status":14},"Quickstart","\u002Fapi\u002Fquickstart","available",{"title":16,"to":17,"status":14},"Environments","\u002Fapi\u002Fenvironments",{"title":19,"to":20,"status":14},"Authentication","\u002Fapi\u002Fauthentication",{"title":22,"to":23,"status":14},"Organizations","\u002Fapi\u002Forganizations",{"title":25,"to":26,"status":14},"Permissions","\u002Fapi\u002Fpermissions",[],{"id":29,"title":30,"links":31,"groups":56},"concepts","Concepts",[32,35,38,41,44,47,50,53],{"title":33,"to":34,"status":14},"Requests and responses","\u002Fapi\u002Frequests-and-responses",{"title":36,"to":37,"status":14},"Identifiers","\u002Fapi\u002Fidentifiers",{"title":39,"to":40,"status":14},"Pagination","\u002Fapi\u002Fpagination",{"title":42,"to":43},"Errors","\u002Fapi\u002Ferrors",{"title":45,"to":46,"status":14},"Rate limits","\u002Fapi\u002Frate-limits",{"title":48,"to":49,"status":14},"Retries","\u002Fapi\u002Fretries-and-idempotency",{"title":51,"to":52,"status":14},"Security","\u002Fapi\u002Fsecurity",{"title":54,"to":55,"status":14},"Versioning","\u002Fapi\u002Fversioning",[],{"id":58,"title":59,"links":60,"groups":103},"resources","Guides",[61,64,67,70,73,76,79,82,85,88,91,94,97,100],{"title":62,"to":63,"status":14},"Students","\u002Fapi\u002Fguides\u002Fstudents",{"title":65,"to":66,"status":14},"Bulk registration","\u002Fapi\u002Fguides\u002Fbulk-registration",{"title":68,"to":69,"status":14},"Passwords","\u002Fapi\u002Fguides\u002Fpasswords",{"title":71,"to":72,"status":14},"Supervisors","\u002Fapi\u002Fguides\u002Fsupervisors",{"title":74,"to":75,"status":14},"Reference data","\u002Fapi\u002Fguides\u002Freference-data",{"title":77,"to":78,"status":14},"API account","\u002Fapi\u002Fguides\u002Fapi-account",{"title":80,"to":81,"status":14},"Sign-in links","\u002Fapi\u002Fguides\u002Fsign-in-links",{"title":83,"to":84,"status":14},"Exams","\u002Fapi\u002Fguides\u002Fexams",{"title":86,"to":87,"status":14},"Applications","\u002Fapi\u002Fguides\u002Fapplications",{"title":89,"to":90,"status":14},"Settling payments","\u002Fapi\u002Fguides\u002Fsettling-payments",{"title":92,"to":93,"status":14},"Wallet","\u002Fapi\u002Fguides\u002Fwallet",{"title":95,"to":96,"status":14},"Group challenges","\u002Fapi\u002Fguides\u002Fgroup-challenges",{"title":98,"to":99,"status":14},"Certificates and reports","\u002Fapi\u002Fguides\u002Fcertificates-and-reports",{"title":101,"to":102,"status":14},"Build your own client","\u002Fapi\u002Fclients\u002Fbuild-your-own",[],{"id":105,"title":106,"links":107,"groups":123},"tutorials","Tutorials",[108,111,114,117,120],{"title":109,"to":110,"status":14},"Register and apply","\u002Fapi\u002Ftutorials\u002Fregister-and-apply",{"title":112,"to":113,"status":14},"Send a student to the olympiad's site","\u002Fapi\u002Ftutorials\u002Fsend-student-to-panel",{"title":115,"to":116,"status":14},"Change an application","\u002Fapi\u002Ftutorials\u002Fchange-an-application",{"title":118,"to":119,"status":14},"Collect results","\u002Fapi\u002Ftutorials\u002Fcollect-results",{"title":121,"to":122,"status":14},"Token handling","\u002Fapi\u002Ftutorials\u002Ftoken-handling",[],{"id":125,"title":126,"links":127,"groups":134},"reference","Reference",[128,131],{"title":129,"to":130},"All endpoints","\u002Fapi\u002Freference",{"title":132,"to":133},"Sandbox console","\u002Fapi\u002Fconsole",[135,144,154,163,187,227,233,251,282,298],{"tag":136,"slug":137,"links":138},"Health","health",[139],{"title":140,"to":141,"method":142,"deprecated":143},"Check that the API is up","\u002Fapi\u002Freference\u002Fget-health","GET",false,{"tag":77,"slug":145,"links":146},"api-account",[147,151],{"title":148,"to":149,"method":150,"deprecated":143},"Revoke the token you send, before it expires","\u002Fapi\u002Freference\u002Frevoke-token","POST",{"title":152,"to":153,"method":142,"deprecated":143},"Fetch the API account your token belongs to","\u002Fapi\u002Freference\u002Fget-current-api-account",{"tag":92,"slug":155,"links":156},"wallet",[157,160],{"title":158,"to":159,"method":142,"deprecated":143},"Read your wallet: credits granted, spent and remaining","\u002Fapi\u002Freference\u002Fget-wallet",{"title":161,"to":162,"method":142,"deprecated":143},"List your wallet history","\u002Fapi\u002Freference\u002Flist-wallet-entries",{"tag":74,"slug":164,"links":165},"reference-data",[166,169,172,175,178,181,184],{"title":167,"to":168,"method":142,"deprecated":143},"List the countries a student can be registered in","\u002Fapi\u002Freference\u002Flist-countries",{"title":170,"to":171,"method":142,"deprecated":143},"Fetch one country by its id","\u002Fapi\u002Freference\u002Fget-country",{"title":173,"to":174,"method":142,"deprecated":143},"List the subdivisions (states) of a country","\u002Fapi\u002Freference\u002Flist-country-subdivisions",{"title":176,"to":177,"method":142,"deprecated":143},"List the grades a student can be registered with","\u002Fapi\u002Freference\u002Flist-grades",{"title":179,"to":180,"method":142,"deprecated":143},"Fetch one grade by its id","\u002Fapi\u002Freference\u002Fget-grade",{"title":182,"to":183,"method":142,"deprecated":143},"List the organizations and their ids","\u002Fapi\u002Freference\u002Flist-organizations",{"title":185,"to":186,"method":142,"deprecated":143},"Fetch one organization by its id","\u002Fapi\u002Freference\u002Fget-organization",{"tag":62,"slug":188,"links":189},"students",[190,193,196,199,202,205,208,212,215,218,221,224],{"title":191,"to":192,"method":142,"deprecated":143},"List your students","\u002Fapi\u002Freference\u002Flist-students",{"title":194,"to":195,"method":150,"deprecated":143},"Register a student","\u002Fapi\u002Freference\u002Fregister-student",{"title":197,"to":198,"method":150,"deprecated":143},"Check a registration without registering the student","\u002Fapi\u002Freference\u002Fcheck-student-registration",{"title":200,"to":201,"method":150,"deprecated":143},"Register many students at once","\u002Fapi\u002Freference\u002Fcreate-student-import",{"title":203,"to":204,"method":142,"deprecated":143},"Follow a batch of students you sent","\u002Fapi\u002Freference\u002Fget-student-import",{"title":206,"to":207,"method":142,"deprecated":143},"Fetch one of your students","\u002Fapi\u002Freference\u002Fget-student",{"title":209,"to":210,"method":211,"deprecated":143},"Update one of your students","\u002Fapi\u002Freference\u002Fupdate-student","PUT",{"title":213,"to":214,"method":211,"deprecated":143},"Set the sign-in password of one of your students","\u002Fapi\u002Freference\u002Fset-student-password",{"title":216,"to":217,"method":142,"deprecated":143},"List your students who can use this organization","\u002Fapi\u002Freference\u002Flist-org-students",{"title":219,"to":220,"method":142,"deprecated":143},"Fetch one of your students, if they can use this organization","\u002Fapi\u002Freference\u002Fget-org-student",{"title":222,"to":223,"method":211,"deprecated":143},"Update one of your students and give them access to this organization","\u002Fapi\u002Freference\u002Fupdate-org-student",{"title":225,"to":226,"method":211,"deprecated":143},"Link one of your students to a supervisor on this organization","\u002Fapi\u002Freference\u002Flink-student-supervisor",{"tag":80,"slug":228,"links":229},"sign-in-links",[230],{"title":231,"to":232,"method":150,"deprecated":143},"Create a single-use sign-in link for one of your students","\u002Fapi\u002Freference\u002Fcreate-signin-link",{"tag":83,"slug":234,"links":235},"exams",[236,239,242,245,248],{"title":237,"to":238,"method":142,"deprecated":143},"List the exams open for applications","\u002Fapi\u002Freference\u002Flist-exams",{"title":240,"to":241,"method":142,"deprecated":143},"List an organization’s exam categories","\u002Fapi\u002Freference\u002Flist-exam-categories",{"title":243,"to":244,"method":142,"deprecated":143},"Fetch one exam category","\u002Fapi\u002Freference\u002Fget-exam-category",{"title":246,"to":247,"method":142,"deprecated":143},"List the exams one of your students can apply to","\u002Fapi\u002Freference\u002Flist-available-exams",{"title":249,"to":250,"method":142,"deprecated":143},"Fetch one exam that is open for applications","\u002Fapi\u002Freference\u002Fget-exam",{"tag":86,"slug":252,"links":253},"applications",[254,257,260,263,266,269,272,275,279],{"title":255,"to":256,"method":142,"deprecated":143},"List your students’ applications in this organization","\u002Fapi\u002Freference\u002Flist-applications",{"title":258,"to":259,"method":150,"deprecated":143},"Enter one of your students for an exam","\u002Fapi\u002Freference\u002Fcreate-application",{"title":261,"to":262,"method":142,"deprecated":143},"List your students’ applications for one exam","\u002Fapi\u002Freference\u002Flist-exam-applications",{"title":264,"to":265,"method":142,"deprecated":143},"List one of your students’ applications in this organization","\u002Fapi\u002Freference\u002Flist-student-applications",{"title":267,"to":268,"method":150,"deprecated":143},"Pay several applications from your wallet","\u002Fapi\u002Freference\u002Fpay-applications-from-wallet",{"title":270,"to":271,"method":142,"deprecated":143},"Fetch one of your students’ applications","\u002Fapi\u002Freference\u002Fget-application",{"title":273,"to":274,"method":211,"deprecated":143},"Move one of your students’ applications to another exam","\u002Fapi\u002Freference\u002Fmove-application",{"title":276,"to":277,"method":278,"deprecated":143},"Withdraw one of your students from an exam","\u002Fapi\u002Freference\u002Fdelete-application","DELETE",{"title":280,"to":281,"method":150,"deprecated":143},"Pay one application from your wallet","\u002Fapi\u002Freference\u002Fpay-application-from-wallet",{"tag":283,"slug":284,"links":285},"Documents","documents",[286,289,292,295],{"title":287,"to":288,"method":142,"deprecated":143},"Download a certificate file","\u002Fapi\u002Freference\u002Fdownload-certificate",{"title":290,"to":291,"method":142,"deprecated":143},"List one of your students’ released certificates","\u002Fapi\u002Freference\u002Flist-student-certificates",{"title":293,"to":294,"method":142,"deprecated":143},"Download a result report file","\u002Fapi\u002Freference\u002Fdownload-report",{"title":296,"to":297,"method":142,"deprecated":143},"List one of your students’ released result reports","\u002Fapi\u002Freference\u002Flist-student-reports",{"tag":95,"slug":299,"links":300},"group-challenges",[301,304,307,310,313,316,319,322,325],{"title":302,"to":303,"method":142,"deprecated":143},"List the group challenges an organization runs","\u002Fapi\u002Freference\u002Flist-group-challenges",{"title":305,"to":306,"method":142,"deprecated":143},"Fetch one group challenge","\u002Fapi\u002Freference\u002Fget-group-challenge",{"title":308,"to":309,"method":142,"deprecated":143},"List the groups your students are in for a group challenge","\u002Fapi\u002Freference\u002Flist-group-challenge-groups",{"title":311,"to":312,"method":142,"deprecated":143},"Fetch one group, with its steps and files","\u002Fapi\u002Freference\u002Fget-group-challenge-group",{"title":314,"to":315,"method":142,"deprecated":143},"List what has happened in one group","\u002Fapi\u002Freference\u002Flist-group-challenge-activity",{"title":317,"to":318,"method":150,"deprecated":143},"Send a group’s finished work for one of your students","\u002Fapi\u002Freference\u002Fsubmit-group-challenge-work",{"title":320,"to":321,"method":150,"deprecated":143},"Submit one step of a group for one of your students","\u002Fapi\u002Freference\u002Fsubmit-group-challenge-step",{"title":323,"to":324,"method":142,"deprecated":143},"List your students’ eligibility and groups for a group challenge","\u002Fapi\u002Freference\u002Flist-group-challenge-students",{"title":326,"to":327,"method":142,"deprecated":143},"Fetch one of your students’ eligibility and group for a group challenge","\u002Fapi\u002Freference\u002Fget-group-challenge-student",{"id":329,"title":330,"links":331,"groups":341},"agents","AI agents",[332,335,338],{"title":333,"to":334},"AI connections","\u002Fapi\u002Fmcp",{"title":336,"to":337},"What it can do","\u002Fapi\u002Fmcp\u002Ftools",{"title":339,"to":340},"Agent skills","\u002Fapi\u002Fskills",[],{"id":343,"title":344,"links":345,"groups":361},"help","Help",[346,349,352,355,358],{"title":347,"to":348,"status":14},"Glossary","\u002Fapi\u002Fglossary",{"title":350,"to":351,"status":14},"FAQ","\u002Fapi\u002Ffaq",{"title":353,"to":354,"status":14},"Troubleshooting","\u002Fapi\u002Ftroubleshooting",{"title":356,"to":357,"status":14},"Support","\u002Fapi\u002Fsupport",{"title":359,"to":360},"Changelog","\u002Fapi\u002Fchangelog",[],{"title":363,"version":364,"description":365,"baseUrl":366,"groups":367},"Main Team API","1.7.1","Register your students, enter them for exams, follow their applications, download their certificates and reports, and sign them in to an olympiad’s site.\n\nEvery operation except the health check needs a bearer token: a JWT you sign yourself with HS256 and your account’s `apiSecret`. Put your `apiKey` in both the `kid` header and the `sub` claim, and set `iat` and `exp` at most 3600 seconds apart. Every authentication failure answers the same `401 unauthorized`.","https:\u002F\u002Fapi.main-team.org",[368,379,394,408,449,514,522,552,602,627],{"tag":136,"slug":137,"description":369,"guide":17,"operations":370},"Whether the API is up. No token needed, so it is the first call to make against an environment.",[371],{"operationId":372,"slug":373,"method":142,"path":374,"tag":136,"summary":140,"deprecated":143,"public":375,"permission":376,"scope":377,"order":378},"getHealth","get-health","\u002Fv1\u002Fhealth",true,null,"public",1,{"tag":77,"slug":145,"description":380,"guide":78,"operations":381},"The account your token belongs to, and revoking a token before it expires.",[382,389],{"operationId":383,"slug":384,"method":150,"path":385,"tag":77,"summary":148,"deprecated":143,"public":143,"permission":386,"scope":387,"order":388},"revokeToken","revoke-token","\u002Fv1\u002Fapi-account\u002Frevoke-token","api\u002F*:$org:$ID","flat",2,{"operationId":390,"slug":391,"method":142,"path":392,"tag":77,"summary":152,"deprecated":143,"public":143,"permission":386,"scope":387,"order":393},"getCurrentApiAccount","get-current-api-account","\u002Fv1\u002Fapi-account\u002Fvalidate-me",3,{"tag":92,"slug":155,"description":395,"guide":93,"operations":396},"The credits Main Team gave you, for each olympiad, and the history of every credit added and spent. One credit pays one priced application; the payment operations are under Applications.",[397,403],{"operationId":398,"slug":399,"method":142,"path":400,"tag":92,"summary":158,"deprecated":143,"public":143,"permission":401,"scope":387,"order":402},"getWallet","get-wallet","\u002Fv1\u002Fwallet","wallet\u002Fread:$org:$ID",4,{"operationId":404,"slug":405,"method":142,"path":406,"tag":92,"summary":161,"deprecated":143,"public":143,"permission":401,"scope":387,"order":407},"listWalletEntries","list-wallet-entries","\u002Fv1\u002Fwallet\u002Fentries",5,{"tag":74,"slug":164,"description":409,"guide":75,"operations":410},"Countries, grades and organizations. A student’s `country` and `grade` take these `_id`s, and so does every `:organizationId` in a path.",[411,417,422,427,433,438,444],{"operationId":412,"slug":413,"method":142,"path":414,"tag":74,"summary":167,"deprecated":143,"public":143,"permission":415,"scope":387,"order":416},"listCountries","list-countries","\u002Fv1\u002Fcountry","country\u002Fread:$org:$ID",6,{"operationId":418,"slug":419,"method":142,"path":420,"tag":74,"summary":170,"deprecated":143,"public":143,"permission":415,"scope":387,"order":421},"getCountry","get-country","\u002Fv1\u002Fcountry\u002F{id}",7,{"operationId":423,"slug":424,"method":142,"path":425,"tag":74,"summary":173,"deprecated":143,"public":143,"permission":415,"scope":387,"order":426},"listCountrySubdivisions","list-country-subdivisions","\u002Fv1\u002Fcountry\u002F{id}\u002Fsubdivision",8,{"operationId":428,"slug":429,"method":142,"path":430,"tag":74,"summary":176,"deprecated":143,"public":143,"permission":431,"scope":387,"order":432},"listGrades","list-grades","\u002Fv1\u002Fgrade","grade\u002Fread:$org:$ID",9,{"operationId":434,"slug":435,"method":142,"path":436,"tag":74,"summary":179,"deprecated":143,"public":143,"permission":431,"scope":387,"order":437},"getGrade","get-grade","\u002Fv1\u002Fgrade\u002F{id}",10,{"operationId":439,"slug":440,"method":142,"path":441,"tag":74,"summary":182,"deprecated":143,"public":143,"permission":442,"scope":387,"order":443},"listOrganizations","list-organizations","\u002Fv1\u002Forganization","organization\u002Fread:$org:$ID",11,{"operationId":445,"slug":446,"method":142,"path":447,"tag":74,"summary":185,"deprecated":143,"public":143,"permission":442,"scope":387,"order":448},"getOrganization","get-organization","\u002Fv1\u002Forganization\u002F{id}",12,{"tag":62,"slug":188,"description":450,"guide":63,"operations":451},"Registering your students, reading and updating them, setting a password, and what each organization holds for them. You only ever see the students your account registered.",[452,458,463,468,473,478,483,488,494,500,505,509],{"operationId":453,"slug":454,"method":142,"path":455,"tag":62,"summary":191,"deprecated":143,"public":143,"permission":456,"scope":387,"order":457},"listStudents","list-students","\u002Fv1\u002Fstudent","student\u002Fread:$org:$ID",13,{"operationId":459,"slug":460,"method":150,"path":455,"tag":62,"summary":194,"deprecated":143,"public":143,"permission":461,"scope":387,"order":462},"registerStudent","register-student","student\u002Fcreate:$org:$ID",14,{"operationId":464,"slug":465,"method":150,"path":466,"tag":62,"summary":197,"deprecated":143,"public":143,"permission":461,"scope":387,"order":467},"checkStudentRegistration","check-student-registration","\u002Fv1\u002Fstudent\u002Fcheck",15,{"operationId":469,"slug":470,"method":150,"path":471,"tag":62,"summary":200,"deprecated":143,"public":143,"permission":461,"scope":387,"order":472},"createStudentImport","create-student-import","\u002Fv1\u002Fstudent\u002Fimport",16,{"operationId":474,"slug":475,"method":142,"path":476,"tag":62,"summary":203,"deprecated":143,"public":143,"permission":461,"scope":387,"order":477},"getStudentImport","get-student-import","\u002Fv1\u002Fstudent\u002Fimport\u002F{importId}",17,{"operationId":479,"slug":480,"method":142,"path":481,"tag":62,"summary":206,"deprecated":143,"public":143,"permission":456,"scope":387,"order":482},"getStudent","get-student","\u002Fv1\u002Fstudent\u002F{studentId}",18,{"operationId":484,"slug":485,"method":211,"path":481,"tag":62,"summary":209,"deprecated":143,"public":143,"permission":486,"scope":387,"order":487},"updateStudent","update-student","student\u002Fupdate:$org:$ID",19,{"operationId":489,"slug":490,"method":211,"path":491,"tag":62,"summary":213,"deprecated":143,"public":143,"permission":492,"scope":387,"order":493},"setStudentPassword","set-student-password","\u002Fv1\u002Fstudent\u002F{studentId}\u002Fpassword","auth\u002Fsignin:$org:$ID",20,{"operationId":495,"slug":496,"method":142,"path":497,"tag":62,"summary":216,"deprecated":143,"public":143,"permission":456,"scope":498,"order":499},"listOrgStudents","list-org-students","\u002Fv1\u002F{organizationId}\u002Fstudent","organization",21,{"operationId":501,"slug":502,"method":142,"path":503,"tag":62,"summary":219,"deprecated":143,"public":143,"permission":456,"scope":498,"order":504},"getOrgStudent","get-org-student","\u002Fv1\u002F{organizationId}\u002Fstudent\u002F{studentId}",22,{"operationId":506,"slug":507,"method":211,"path":503,"tag":62,"summary":222,"deprecated":143,"public":143,"permission":486,"scope":498,"order":508},"updateOrgStudent","update-org-student",23,{"operationId":510,"slug":511,"method":211,"path":512,"tag":62,"summary":225,"deprecated":143,"public":143,"permission":486,"scope":498,"order":513},"linkStudentSupervisor","link-student-supervisor","\u002Fv1\u002F{organizationId}\u002Fstudent\u002F{studentId}\u002Fsupervisor",24,{"tag":80,"slug":228,"description":515,"guide":81,"operations":516},"Links that sign one of your students into an olympiad’s site. Each works once and expires two minutes after it is issued.",[517],{"operationId":518,"slug":519,"method":150,"path":520,"tag":80,"summary":231,"deprecated":143,"public":143,"permission":492,"scope":498,"order":521},"createSigninLink","create-signin-link","\u002Fv1\u002F{organizationId}\u002Fauth\u002Fsignin",25,{"tag":83,"slug":234,"description":523,"guide":84,"operations":524},"The exam categories and exams an organization runs, and the ones one of your students can apply to.",[525,531,537,542,547],{"operationId":526,"slug":527,"method":142,"path":528,"tag":83,"summary":237,"deprecated":143,"public":143,"permission":529,"scope":498,"order":530},"listExams","list-exams","\u002Fv1\u002F{organizationId}\u002Fexam","exam\u002Fread:$org:$ID",26,{"operationId":532,"slug":533,"method":142,"path":534,"tag":83,"summary":240,"deprecated":143,"public":143,"permission":535,"scope":498,"order":536},"listExamCategories","list-exam-categories","\u002Fv1\u002F{organizationId}\u002Fexam-category","exam-category\u002Fread:$org:$ID",27,{"operationId":538,"slug":539,"method":142,"path":540,"tag":83,"summary":243,"deprecated":143,"public":143,"permission":535,"scope":498,"order":541},"getExamCategory","get-exam-category","\u002Fv1\u002F{organizationId}\u002Fexam-category\u002F{categoryId}",28,{"operationId":543,"slug":544,"method":142,"path":545,"tag":83,"summary":246,"deprecated":143,"public":143,"permission":529,"scope":498,"order":546},"listAvailableExams","list-available-exams","\u002Fv1\u002F{organizationId}\u002Fexam\u002Favailable\u002F{studentId}",29,{"operationId":548,"slug":549,"method":142,"path":550,"tag":83,"summary":249,"deprecated":143,"public":143,"permission":529,"scope":498,"order":551},"getExam","get-exam","\u002Fv1\u002F{organizationId}\u002Fexam\u002F{examId}",30,{"tag":86,"slug":252,"description":553,"guide":87,"operations":554},"Entering your students for exams: creating, reading, moving and deleting their applications, and paying them from your wallet.",[555,561,566,571,576,582,587,592,597],{"operationId":556,"slug":557,"method":142,"path":558,"tag":86,"summary":255,"deprecated":143,"public":143,"permission":559,"scope":498,"order":560},"listApplications","list-applications","\u002Fv1\u002F{organizationId}\u002Fapplication","application\u002Fread:$org:$ID",31,{"operationId":562,"slug":563,"method":150,"path":558,"tag":86,"summary":258,"deprecated":143,"public":143,"permission":564,"scope":498,"order":565},"createApplication","create-application","application\u002Fcreate:$org:$ID",32,{"operationId":567,"slug":568,"method":142,"path":569,"tag":86,"summary":261,"deprecated":143,"public":143,"permission":559,"scope":498,"order":570},"listExamApplications","list-exam-applications","\u002Fv1\u002F{organizationId}\u002Fapplication\u002Fexam-applications\u002F{examId}",33,{"operationId":572,"slug":573,"method":142,"path":574,"tag":86,"summary":264,"deprecated":143,"public":143,"permission":559,"scope":498,"order":575},"listStudentApplications","list-student-applications","\u002Fv1\u002F{organizationId}\u002Fapplication\u002Fstudent-applications\u002F{studentId}",34,{"operationId":577,"slug":578,"method":150,"path":579,"tag":86,"summary":267,"deprecated":143,"public":143,"permission":580,"scope":498,"order":581},"payApplicationsFromWallet","pay-applications-from-wallet","\u002Fv1\u002F{organizationId}\u002Fapplication\u002Fwallet-pay","application\u002Fpay:$org:$ID",35,{"operationId":583,"slug":584,"method":142,"path":585,"tag":86,"summary":270,"deprecated":143,"public":143,"permission":559,"scope":498,"order":586},"getApplication","get-application","\u002Fv1\u002F{organizationId}\u002Fapplication\u002F{applicationId}",36,{"operationId":588,"slug":589,"method":211,"path":585,"tag":86,"summary":273,"deprecated":143,"public":143,"permission":590,"scope":498,"order":591},"moveApplication","move-application","application\u002Fupdate:$org:$ID",37,{"operationId":593,"slug":594,"method":278,"path":585,"tag":86,"summary":276,"deprecated":143,"public":143,"permission":595,"scope":498,"order":596},"deleteApplication","delete-application","application\u002Fdelete:$org:$ID",38,{"operationId":598,"slug":599,"method":150,"path":600,"tag":86,"summary":280,"deprecated":143,"public":143,"permission":580,"scope":498,"order":601},"payApplicationFromWallet","pay-application-from-wallet","\u002Fv1\u002F{organizationId}\u002Fapplication\u002F{applicationId}\u002Fwallet-pay",39,{"tag":283,"slug":284,"description":603,"guide":99,"operations":604},"Your students’ certificates and reports: listing them and downloading the files.",[605,611,616,622],{"operationId":606,"slug":607,"method":142,"path":608,"tag":283,"summary":287,"deprecated":143,"public":143,"permission":609,"scope":498,"order":610},"downloadCertificate","download-certificate","\u002Fv1\u002F{organizationId}\u002Fcertificate\u002Fdownload\u002F{certificateId}","certificate\u002Fread:$org:$ID",40,{"operationId":612,"slug":613,"method":142,"path":614,"tag":283,"summary":290,"deprecated":143,"public":143,"permission":609,"scope":498,"order":615},"listStudentCertificates","list-student-certificates","\u002Fv1\u002F{organizationId}\u002Fcertificate\u002F{userId}",41,{"operationId":617,"slug":618,"method":142,"path":619,"tag":283,"summary":293,"deprecated":143,"public":143,"permission":620,"scope":498,"order":621},"downloadReport","download-report","\u002Fv1\u002F{organizationId}\u002Freport\u002Fdownload\u002F{reportId}","report\u002Fread:$org:$ID",42,{"operationId":623,"slug":624,"method":142,"path":625,"tag":283,"summary":296,"deprecated":143,"public":143,"permission":620,"scope":498,"order":626},"listStudentReports","list-student-reports","\u002Fv1\u002F{organizationId}\u002Freport\u002F{userId}",43,{"tag":95,"slug":299,"description":628,"guide":96,"operations":629},"Online group challenges your students take part in: the challenges, which of your students can join, the groups they are in, each step and its files, what happened in a group, and submitting on your student’s behalf.",[630,636,641,646,651,656,662,667,672],{"operationId":631,"slug":632,"method":142,"path":633,"tag":95,"summary":302,"deprecated":143,"public":143,"permission":634,"scope":498,"order":635},"listGroupChallenges","list-group-challenges","\u002Fv1\u002F{organizationId}\u002Fgroup-challenge","group-challenge\u002Fread:$org:$ID",44,{"operationId":637,"slug":638,"method":142,"path":639,"tag":95,"summary":305,"deprecated":143,"public":143,"permission":634,"scope":498,"order":640},"getGroupChallenge","get-group-challenge","\u002Fv1\u002F{organizationId}\u002Fgroup-challenge\u002F{challengeId}",45,{"operationId":642,"slug":643,"method":142,"path":644,"tag":95,"summary":308,"deprecated":143,"public":143,"permission":634,"scope":498,"order":645},"listGroupChallengeGroups","list-group-challenge-groups","\u002Fv1\u002F{organizationId}\u002Fgroup-challenge\u002F{challengeId}\u002Fgroup",46,{"operationId":647,"slug":648,"method":142,"path":649,"tag":95,"summary":311,"deprecated":143,"public":143,"permission":634,"scope":498,"order":650},"getGroupChallengeGroup","get-group-challenge-group","\u002Fv1\u002F{organizationId}\u002Fgroup-challenge\u002F{challengeId}\u002Fgroup\u002F{groupId}",47,{"operationId":652,"slug":653,"method":142,"path":654,"tag":95,"summary":314,"deprecated":143,"public":143,"permission":634,"scope":498,"order":655},"listGroupChallengeActivity","list-group-challenge-activity","\u002Fv1\u002F{organizationId}\u002Fgroup-challenge\u002F{challengeId}\u002Fgroup\u002F{groupId}\u002Factivity",48,{"operationId":657,"slug":658,"method":150,"path":659,"tag":95,"summary":317,"deprecated":143,"public":143,"permission":660,"scope":498,"order":661},"submitGroupChallengeWork","submit-group-challenge-work","\u002Fv1\u002F{organizationId}\u002Fgroup-challenge\u002F{challengeId}\u002Fgroup\u002F{groupId}\u002Ffinal-submit","group-challenge\u002Fsubmit:$org:$ID",49,{"operationId":663,"slug":664,"method":150,"path":665,"tag":95,"summary":320,"deprecated":143,"public":143,"permission":660,"scope":498,"order":666},"submitGroupChallengeStep","submit-group-challenge-step","\u002Fv1\u002F{organizationId}\u002Fgroup-challenge\u002F{challengeId}\u002Fgroup\u002F{groupId}\u002Fstep\u002F{stepId}\u002Fsubmit",50,{"operationId":668,"slug":669,"method":142,"path":670,"tag":95,"summary":323,"deprecated":143,"public":143,"permission":634,"scope":498,"order":671},"listGroupChallengeStudents","list-group-challenge-students","\u002Fv1\u002F{organizationId}\u002Fgroup-challenge\u002F{challengeId}\u002Fstudent",51,{"operationId":673,"slug":674,"method":142,"path":675,"tag":95,"summary":326,"deprecated":143,"public":143,"permission":634,"scope":498,"order":676},"getGroupChallengeStudent","get-group-challenge-student","\u002Fv1\u002F{organizationId}\u002Fgroup-challenge\u002F{challengeId}\u002Fstudent\u002F{studentId}",52,{"operationId":423,"slug":424,"method":142,"path":425,"tag":74,"summary":173,"deprecated":143,"public":143,"permission":415,"scope":387,"order":426,"description":678,"permissions":679,"errors":680,"guide":376,"parameters":708,"requestBody":376,"responses":725,"successStatus":981,"kind":982,"paginated":375,"baseUrl":366,"tagDescription":409,"sandbox":375},"The subdivisions of one country, a page at a time (`limit` up to 100), in the order the platform’s own forms list them: the 50 United States and the District of Columbia for the United States, none for a country without any. Reference data: the same list whichever organization you work with.\n\n`subdivision` on the student operations takes the `_id` from here, or the `code` in full (`US-CA`, never `CA`). A country whose `subdivisionRequired` is `true` needs its students to have one.\n\nHidden subdivisions are not listed. An id that no country has and the id of a reserved country get the same answer as `getCountry`, `404 not_found`. The list rarely changes, so fetch it once and keep it.\n\nAn empty list means the country has no states to choose from, so its students need none, whatever `subdivisionRequired` says.",[415],[681,686,690,695,700,704],{"code":682,"message":683,"status":684,"when":685},"bad_request","Invalid value for '_id': expected ObjectId.",400,"`id` is not 24 hexadecimal digits.",{"code":687,"status":688,"when":689},"unauthorized",401,"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.",{"code":691,"message":692,"status":693,"when":694},"forbidden","Insufficient role permissions",403,"The token is valid, but no role on your account allows `country\u002Fread` on `mto` (the target of operations without `:organizationId` in their path), or a role denies it.",{"code":696,"message":697,"status":698,"when":699},"not_found","Country not found!",404,"No country `listCountries` lists has this `_id`: it matches no country, or it names one of the reserved ones.",{"code":701,"status":702,"when":703},"too_many_requests",429,"Your account has made more than 100 requests to this operation in the current 60-second window. Wait the seconds in `Retry-After` before sending again.",{"code":705,"status":706,"when":707},"internal_error",500,"Something failed on our side. Retry later, and quote `request_id` if it goes on.",[709,715,721],{"description":710,"in":711,"name":712,"required":375,"schema":713},"The country’s `_id`, from `listCountries`: 24 hexadecimal digits.","path","id",{"type":714},"string",{"description":716,"in":717,"name":718,"required":143,"schema":719},"Page number. Defaults to 1.","query","page",{"example":378,"type":720},"number",{"description":722,"in":717,"name":723,"required":143,"schema":724},"Items per page. Defaults to 20, max 100.","limit",{"example":493,"type":720},{"200":726,"400":825,"401":870,"403":892,"404":913,"429":933,"500":959},{"content":727,"description":813,"headers":814},{"application\u002Fjson":728},{"schema":729},{"allOf":730},[731,767],{"x-ref":732,"description":733,"properties":734,"required":764,"type":762},"#\u002Fcomponents\u002Fschemas\u002FSuccessEnvelope","How every successful JSON response is wrapped. `data` is the result, and each operation declares its shape; list operations add `pagination`. `GET \u002Fv1\u002Fapi-account\u002Fvalidate-me` is the one operation that answers without this envelope.",{"success":735,"message":739,"pagination":742},{"description":736,"enum":737,"example":375,"type":738},"Always `true` on a success.",[375],"boolean",{"description":740,"example":741,"type":714},"A sentence saying what happened, written for a person. Branch on the status and on `data`, not on this.","Request completed successfully.",{"allOf":743,"description":763},[744],{"x-ref":745,"description":746,"properties":747,"required":759,"type":762},"#\u002Fcomponents\u002Fschemas\u002FPaginationMeta","Where one page sits in the whole list.",{"page":748,"limit":750,"total":753,"totalPages":757},{"description":749,"example":378,"minimum":378,"type":720},"The page returned, counting from 1.",{"description":751,"example":493,"maximum":752,"minimum":378,"type":720},"Items per page: the `limit` you sent, 20 if you sent none, and never more than 100.",100,{"description":754,"example":755,"minimum":756,"type":720},"Items across every page.",57,0,{"description":758,"example":393,"minimum":756,"type":720},"Pages at this `limit`: `total \u002F limit`, rounded up.",[718,723,760,761],"total","totalPages","object","On list operations only.",[765,766],"success","message",{"properties":768,"required":810,"type":762},{"message":769,"data":771,"pagination":803},{"example":770,"type":714},"Subdivisions fetched successfully.",{"items":772,"type":802},{"x-ref":773,"description":774,"properties":775,"required":800,"type":762},"#\u002Fcomponents\u002Fschemas\u002FSubdivisionResponse","A subdivision of a country, such as a US state.",{"_id":776,"country":779,"code":782,"name":785,"tz":788,"order":791,"createdAt":793,"updatedAt":797},{"description":777,"example":778,"type":714},"The subdivision’s id: what `subdivision` takes when you register or update a student. The same in every organization and in the sandbox: it is derived from `code`.","6650a1b2c3d4e5f6a7b8c9f2",{"description":780,"example":781,"type":714},"The `_id` of the country it belongs to.","6650a1b2c3d4e5f6a7b8c9d1",{"description":783,"example":784,"type":714},"The ISO 3166-2 code, in capitals. `subdivision` takes it as well as the `_id`, in full: `US-CA`, never `CA`.","US-CA",{"description":786,"example":787,"type":714},"The subdivision’s name, in capitals.","CALIFORNIA",{"description":789,"example":790,"type":714},"The IANA time zone a sitting on local time is read in for students in this subdivision. One main zone per state.","America\u002FLos_Angeles",{"description":792,"example":407,"type":720},"The position in the list the platform’s own forms use.",{"description":794,"example":795,"format":796,"type":714},"When the record was created.","2026-09-01T09:30:00.000Z","date-time",{"description":798,"example":799,"format":796,"type":714},"When the record last changed.","2026-09-02T14:05:00.000Z",[801],"_id","array",{"x-ref":745,"description":746,"properties":804,"required":809,"type":762},{"page":805,"limit":806,"total":807,"totalPages":808},{"description":749,"example":378,"minimum":378,"type":720},{"description":751,"example":493,"maximum":752,"minimum":378,"type":720},{"description":754,"example":755,"minimum":756,"type":720},{"description":758,"example":393,"minimum":756,"type":720},[718,723,760,761],[811,812],"data","pagination","Success: `message` is \"Subdivisions fetched successfully.\".",{"X-RateLimit-Limit":815,"X-RateLimit-Remaining":819,"X-RateLimit-Reset":822},{"description":816,"schema":817},"Requests your account may make to this operation per window (100).",{"type":818},"integer",{"description":820,"schema":821},"Requests left in the current window.",{"type":818},{"description":823,"schema":824},"Seconds until the current window ends.",{"type":818},{"content":826,"description":869},{"application\u002Fjson":827},{"examples":828,"schema":834},{"bad_request":829},{"summary":682,"value":830},{"error":831},{"code":682,"documentation_url":832,"message":683,"request_id":833},"https:\u002F\u002Fhub.main-team.org\u002Fapi\u002Ferrors#bad_request","0b5c6d0e-8f7a-4b1c-9d2e-3f4a5b6c7d8e",{"x-ref":835,"description":836,"properties":837,"required":867,"type":762},"#\u002Fcomponents\u002Fschemas\u002FErrorEnvelope","How every error response is wrapped.",{"error":838},{"x-ref":839,"description":840,"properties":841,"required":863,"type":762},"#\u002Fcomponents\u002Fschemas\u002FErrorDetail","What went wrong.",{"code":842,"message":852,"documentation_url":855,"request_id":859,"details":861},{"description":843,"enum":844,"example":696,"type":714},"A stable machine code: branch on this. Each one is explained at `documentation_url`.",[845,682,846,687,691,696,847,848,849,850,701,705,851],"invalid_email","subdivision_required","conflict","payload_too_large","unsupported_media_type","unprocessable_entity","service_unavailable",{"description":853,"example":854,"type":714},"Written for a person, and may change: never branch on it.","Not found!",{"description":856,"example":857,"format":858,"type":714},"Where this code is explained.","https:\u002F\u002Fhub.main-team.org\u002Fapi\u002Ferrors#not_found","uri",{"description":860,"example":833,"type":714},"This request’s id, also sent as the `X-Request-Id` response header: the one you sent, when it was acceptable, or else one the API made. Quote it when you report a problem.",{"additionalProperties":375,"description":862,"type":762},"Present 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 `details` you do not recognise.",[864,766,865,866],"code","documentation_url","request_id",[868],"error","`bad_request`: `id` is not 24 hexadecimal digits.",{"content":871,"description":891},{"application\u002Fjson":872},{"examples":873,"schema":879},{"unauthorized":874},{"summary":687,"value":875},{"error":876},{"code":687,"documentation_url":877,"message":878,"request_id":833},"https:\u002F\u002Fhub.main-team.org\u002Fapi\u002Ferrors#unauthorized","Authentication is required or the provided credentials are invalid.",{"x-ref":835,"description":836,"properties":880,"required":890,"type":762},{"error":881},{"x-ref":839,"description":840,"properties":882,"required":889,"type":762},{"code":883,"message":885,"documentation_url":886,"request_id":887,"details":888},{"description":843,"enum":884,"example":696,"type":714},[845,682,846,687,691,696,847,848,849,850,701,705,851],{"description":853,"example":854,"type":714},{"description":856,"example":857,"format":858,"type":714},{"description":860,"example":833,"type":714},{"additionalProperties":375,"description":862,"type":762},[864,766,865,866],[868],"`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.",{"content":893,"description":912},{"application\u002Fjson":894},{"examples":895,"schema":900},{"forbidden":896},{"summary":691,"value":897},{"error":898},{"code":691,"documentation_url":899,"message":692,"request_id":833},"https:\u002F\u002Fhub.main-team.org\u002Fapi\u002Ferrors#forbidden",{"x-ref":835,"description":836,"properties":901,"required":911,"type":762},{"error":902},{"x-ref":839,"description":840,"properties":903,"required":910,"type":762},{"code":904,"message":906,"documentation_url":907,"request_id":908,"details":909},{"description":843,"enum":905,"example":696,"type":714},[845,682,846,687,691,696,847,848,849,850,701,705,851],{"description":853,"example":854,"type":714},{"description":856,"example":857,"format":858,"type":714},{"description":860,"example":833,"type":714},{"additionalProperties":375,"description":862,"type":762},[864,766,865,866],[868],"`forbidden`: The token is valid, but no role on your account allows `country\u002Fread` on `mto` (the target of operations without `:organizationId` in their path), or a role denies it.",{"content":914,"description":932},{"application\u002Fjson":915},{"examples":916,"schema":920},{"not_found":917},{"summary":696,"value":918},{"error":919},{"code":696,"documentation_url":857,"message":697,"request_id":833},{"x-ref":835,"description":836,"properties":921,"required":931,"type":762},{"error":922},{"x-ref":839,"description":840,"properties":923,"required":930,"type":762},{"code":924,"message":926,"documentation_url":927,"request_id":928,"details":929},{"description":843,"enum":925,"example":696,"type":714},[845,682,846,687,691,696,847,848,849,850,701,705,851],{"description":853,"example":854,"type":714},{"description":856,"example":857,"format":858,"type":714},{"description":860,"example":833,"type":714},{"additionalProperties":375,"description":862,"type":762},[864,766,865,866],[868],"`not_found`: No country `listCountries` lists has this `_id`: it matches no country, or it names one of the reserved ones.",{"content":934,"description":954,"headers":955},{"application\u002Fjson":935},{"examples":936,"schema":942},{"too_many_requests":937},{"summary":701,"value":938},{"error":939},{"code":701,"documentation_url":940,"message":941,"request_id":833},"https:\u002F\u002Fhub.main-team.org\u002Fapi\u002Ferrors#too_many_requests","Too many requests to this operation. Wait the number of seconds in Retry-After, then try again.",{"x-ref":835,"description":836,"properties":943,"required":953,"type":762},{"error":944},{"x-ref":839,"description":840,"properties":945,"required":952,"type":762},{"code":946,"message":948,"documentation_url":949,"request_id":950,"details":951},{"description":843,"enum":947,"example":696,"type":714},[845,682,846,687,691,696,847,848,849,850,701,705,851],{"description":853,"example":854,"type":714},{"description":856,"example":857,"format":858,"type":714},{"description":860,"example":833,"type":714},{"additionalProperties":375,"description":862,"type":762},[864,766,865,866],[868],"`too_many_requests`: Your account has made more than 100 requests to this operation in the current 60-second window. Wait the seconds in `Retry-After` before sending again.",{"Retry-After":956},{"description":957,"schema":958},"Seconds to wait before sending again; a request sent sooner is refused too.",{"type":818},{"content":960,"description":980},{"application\u002Fjson":961},{"examples":962,"schema":968},{"internal_error":963},{"summary":705,"value":964},{"error":965},{"code":705,"documentation_url":966,"message":967,"request_id":833},"https:\u002F\u002Fhub.main-team.org\u002Fapi\u002Ferrors#internal_error","An unexpected error occurred.",{"x-ref":835,"description":836,"properties":969,"required":979,"type":762},{"error":970},{"x-ref":839,"description":840,"properties":971,"required":978,"type":762},{"code":972,"message":974,"documentation_url":975,"request_id":976,"details":977},{"description":843,"enum":973,"example":696,"type":714},[845,682,846,687,691,696,847,848,849,850,701,705,851],{"description":853,"example":854,"type":714},{"description":856,"example":857,"format":858,"type":714},{"description":860,"example":833,"type":714},{"additionalProperties":375,"description":862,"type":762},[864,766,865,866],[868],"`internal_error`: Something failed on our side. Retry later, and quote `request_id` if it goes on.","200","envelope",{"path":26},{"id":985,"title":173,"apiPath":425,"body":986,"deprecated":143,"description":1529,"extension":1530,"meta":1531,"method":142,"navigation":375,"operationId":423,"order":1532,"path":174,"permission":415,"public":143,"seo":1533,"stem":1534,"summary":173,"tag":74,"__hash__":1535},"apiReference\u002Fapi\u002Freference\u002Flist-country-subdivisions.md",{"type":987,"value":988,"toc":1527},"minimark",[989,1523],[990,991,992,1042,1235],"api-code-group",{},[993,994,1000],"pre",{"className":995,"code":996,"filename":997,"language":998,"meta":999,"style":999},"language-bash shiki shiki-themes github-light-high-contrast github-dark-high-contrast","# $TOKEN: a short-lived token you minted with your API key and secret\ncurl -sS 'https:\u002F\u002Fapi.main-team.org\u002Fv1\u002Fcountry\u002F\u003Cid>\u002Fsubdivision?page=1&limit=20' \\\n  -H \"Authorization: Bearer $TOKEN\"\n","curl","bash","",[864,1001,1002,1010,1027],{"__ignoreMap":999},[1003,1004,1006],"span",{"class":1005,"line":378},"line",[1003,1007,1009],{"class":1008},"sLBg1","# $TOKEN: a short-lived token you minted with your API key and secret\n",[1003,1011,1012,1015,1019,1023],{"class":1005,"line":388},[1003,1013,997],{"class":1014},"soyes",[1003,1016,1018],{"class":1017},"s-5SL"," -sS",[1003,1020,1022],{"class":1021},"sT6z2"," 'https:\u002F\u002Fapi.main-team.org\u002Fv1\u002Fcountry\u002F\u003Cid>\u002Fsubdivision?page=1&limit=20'",[1003,1024,1026],{"class":1025},"sHUrx"," \\\n",[1003,1028,1029,1032,1035,1039],{"class":1005,"line":393},[1003,1030,1031],{"class":1017},"  -H",[1003,1033,1034],{"class":1021}," \"Authorization: Bearer ",[1003,1036,1038],{"class":1037},"suds8","$TOKEN",[1003,1040,1041],{"class":1021},"\"\n",[993,1043,1048],{"className":1044,"code":1045,"filename":1046,"language":1047,"meta":999,"style":999},"language-js shiki shiki-themes github-light-high-contrast github-dark-high-contrast","const token = process.env.TOKEN; \u002F\u002F a short-lived token you minted with your API key and secret\n\nconst res = await fetch('https:\u002F\u002Fapi.main-team.org\u002Fv1\u002Fcountry\u002F\u003Cid>\u002Fsubdivision?page=1&limit=20', {\n  headers: {\n    Authorization: `Bearer ${token}`,\n  },\n});\nconst body = await res.json();\nif (!res.ok) throw new Error(`${res.status} ${body.error.code}: ${body.error.message}`);\nconsole.log(body.data, body.pagination);\n","Node.js","js",[864,1049,1050,1073,1078,1103,1108,1125,1130,1135,1155,1224],{"__ignoreMap":999},[1003,1051,1052,1055,1058,1061,1064,1067,1070],{"class":1005,"line":378},[1003,1053,1054],{"class":1025},"const",[1003,1056,1057],{"class":1017}," token",[1003,1059,1060],{"class":1025}," =",[1003,1062,1063],{"class":1037}," process.env.",[1003,1065,1066],{"class":1017},"TOKEN",[1003,1068,1069],{"class":1037},"; ",[1003,1071,1072],{"class":1008},"\u002F\u002F a short-lived token you minted with your API key and secret\n",[1003,1074,1075],{"class":1005,"line":388},[1003,1076,1077],{"emptyLinePlaceholder":375},"\n",[1003,1079,1080,1082,1085,1087,1090,1094,1097,1100],{"class":1005,"line":393},[1003,1081,1054],{"class":1025},[1003,1083,1084],{"class":1017}," res",[1003,1086,1060],{"class":1025},[1003,1088,1089],{"class":1025}," await",[1003,1091,1093],{"class":1092},"sKwhi"," fetch",[1003,1095,1096],{"class":1037},"(",[1003,1098,1099],{"class":1021},"'https:\u002F\u002Fapi.main-team.org\u002Fv1\u002Fcountry\u002F\u003Cid>\u002Fsubdivision?page=1&limit=20'",[1003,1101,1102],{"class":1037},", {\n",[1003,1104,1105],{"class":1005,"line":402},[1003,1106,1107],{"class":1037},"  headers: {\n",[1003,1109,1110,1113,1116,1119,1122],{"class":1005,"line":407},[1003,1111,1112],{"class":1037},"    Authorization: ",[1003,1114,1115],{"class":1021},"`Bearer ${",[1003,1117,1118],{"class":1037},"token",[1003,1120,1121],{"class":1021},"}`",[1003,1123,1124],{"class":1037},",\n",[1003,1126,1127],{"class":1005,"line":416},[1003,1128,1129],{"class":1037},"  },\n",[1003,1131,1132],{"class":1005,"line":421},[1003,1133,1134],{"class":1037},"});\n",[1003,1136,1137,1139,1142,1144,1146,1149,1152],{"class":1005,"line":426},[1003,1138,1054],{"class":1025},[1003,1140,1141],{"class":1017}," body",[1003,1143,1060],{"class":1025},[1003,1145,1089],{"class":1025},[1003,1147,1148],{"class":1037}," res.",[1003,1150,1151],{"class":1092},"json",[1003,1153,1154],{"class":1037},"();\n",[1003,1156,1157,1160,1163,1166,1169,1172,1175,1178,1180,1183,1186,1189,1192,1195,1198,1200,1202,1204,1206,1209,1211,1213,1215,1217,1219,1221],{"class":1005,"line":432},[1003,1158,1159],{"class":1025},"if",[1003,1161,1162],{"class":1037}," (",[1003,1164,1165],{"class":1025},"!",[1003,1167,1168],{"class":1037},"res.ok) ",[1003,1170,1171],{"class":1025},"throw",[1003,1173,1174],{"class":1025}," new",[1003,1176,1177],{"class":1092}," Error",[1003,1179,1096],{"class":1037},[1003,1181,1182],{"class":1021},"`${",[1003,1184,1185],{"class":1037},"res",[1003,1187,1188],{"class":1021},".",[1003,1190,1191],{"class":1037},"status",[1003,1193,1194],{"class":1021},"} ${",[1003,1196,1197],{"class":1037},"body",[1003,1199,1188],{"class":1021},[1003,1201,868],{"class":1037},[1003,1203,1188],{"class":1021},[1003,1205,864],{"class":1037},[1003,1207,1208],{"class":1021},"}: ${",[1003,1210,1197],{"class":1037},[1003,1212,1188],{"class":1021},[1003,1214,868],{"class":1037},[1003,1216,1188],{"class":1021},[1003,1218,766],{"class":1037},[1003,1220,1121],{"class":1021},[1003,1222,1223],{"class":1037},");\n",[1003,1225,1226,1229,1232],{"class":1005,"line":437},[1003,1227,1228],{"class":1037},"console.",[1003,1230,1231],{"class":1092},"log",[1003,1233,1234],{"class":1037},"(body.data, body.pagination);\n",[993,1236,1241],{"className":1237,"code":1238,"filename":1239,"language":1240,"meta":999,"style":999},"language-php shiki shiki-themes github-light-high-contrast github-dark-high-contrast","\u003C?php\n$token = getenv('TOKEN'); \u002F\u002F a short-lived token you minted with your API key and secret\n\n$ch = curl_init('https:\u002F\u002Fapi.main-team.org\u002Fv1\u002Fcountry\u002F\u003Cid>\u002Fsubdivision?page=1&limit=20');\ncurl_setopt_array($ch, [\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . $token,\n    ],\n    CURLOPT_RETURNTRANSFER => true,\n]);\n$response = curl_exec($ch);\nif ($response === false) {\n    throw new RuntimeException(curl_error($ch));\n}\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\n$body = json_decode($response, true);\nif ($status >= 400) {\n    $error = $body['error'];\n    throw new RuntimeException(\"$status {$error['code']}: {$error['message']}\");\n}\nprint_r($body['data']);\nprint_r($body['pagination']);\n","PHP","php",[864,1242,1243,1251,1272,1276,1292,1300,1311,1322,1327,1339,1344,1357,1373,1391,1396,1414,1432,1447,1463,1495,1499,1512],{"__ignoreMap":999},[1003,1244,1245,1248],{"class":1005,"line":378},[1003,1246,1247],{"class":1025},"\u003C?",[1003,1249,1250],{"class":1017},"php\n",[1003,1252,1253,1256,1259,1262,1264,1267,1270],{"class":1005,"line":388},[1003,1254,1255],{"class":1037},"$token ",[1003,1257,1258],{"class":1025},"=",[1003,1260,1261],{"class":1017}," getenv",[1003,1263,1096],{"class":1037},[1003,1265,1266],{"class":1021},"'TOKEN'",[1003,1268,1269],{"class":1037},"); ",[1003,1271,1072],{"class":1008},[1003,1273,1274],{"class":1005,"line":393},[1003,1275,1077],{"emptyLinePlaceholder":375},[1003,1277,1278,1281,1283,1286,1288,1290],{"class":1005,"line":402},[1003,1279,1280],{"class":1037},"$ch ",[1003,1282,1258],{"class":1025},[1003,1284,1285],{"class":1017}," curl_init",[1003,1287,1096],{"class":1037},[1003,1289,1099],{"class":1021},[1003,1291,1223],{"class":1037},[1003,1293,1294,1297],{"class":1005,"line":407},[1003,1295,1296],{"class":1017},"curl_setopt_array",[1003,1298,1299],{"class":1037},"($ch, [\n",[1003,1301,1302,1305,1308],{"class":1005,"line":416},[1003,1303,1304],{"class":1017},"    CURLOPT_HTTPHEADER",[1003,1306,1307],{"class":1025}," =>",[1003,1309,1310],{"class":1037}," [\n",[1003,1312,1313,1316,1319],{"class":1005,"line":421},[1003,1314,1315],{"class":1021},"        'Authorization: Bearer '",[1003,1317,1318],{"class":1025}," .",[1003,1320,1321],{"class":1037}," $token,\n",[1003,1323,1324],{"class":1005,"line":426},[1003,1325,1326],{"class":1037},"    ],\n",[1003,1328,1329,1332,1334,1337],{"class":1005,"line":432},[1003,1330,1331],{"class":1017},"    CURLOPT_RETURNTRANSFER",[1003,1333,1307],{"class":1025},[1003,1335,1336],{"class":1017}," true",[1003,1338,1124],{"class":1037},[1003,1340,1341],{"class":1005,"line":437},[1003,1342,1343],{"class":1037},"]);\n",[1003,1345,1346,1349,1351,1354],{"class":1005,"line":443},[1003,1347,1348],{"class":1037},"$response ",[1003,1350,1258],{"class":1025},[1003,1352,1353],{"class":1017}," curl_exec",[1003,1355,1356],{"class":1037},"($ch);\n",[1003,1358,1359,1361,1364,1367,1370],{"class":1005,"line":448},[1003,1360,1159],{"class":1025},[1003,1362,1363],{"class":1037}," ($response ",[1003,1365,1366],{"class":1025},"===",[1003,1368,1369],{"class":1017}," false",[1003,1371,1372],{"class":1037},") {\n",[1003,1374,1375,1378,1380,1383,1385,1388],{"class":1005,"line":457},[1003,1376,1377],{"class":1025},"    throw",[1003,1379,1174],{"class":1025},[1003,1381,1382],{"class":1017}," RuntimeException",[1003,1384,1096],{"class":1037},[1003,1386,1387],{"class":1017},"curl_error",[1003,1389,1390],{"class":1037},"($ch));\n",[1003,1392,1393],{"class":1005,"line":462},[1003,1394,1395],{"class":1037},"}\n",[1003,1397,1398,1401,1403,1406,1409,1412],{"class":1005,"line":467},[1003,1399,1400],{"class":1037},"$status ",[1003,1402,1258],{"class":1025},[1003,1404,1405],{"class":1017}," curl_getinfo",[1003,1407,1408],{"class":1037},"($ch, ",[1003,1410,1411],{"class":1017},"CURLINFO_RESPONSE_CODE",[1003,1413,1223],{"class":1037},[1003,1415,1416,1419,1421,1424,1427,1430],{"class":1005,"line":472},[1003,1417,1418],{"class":1037},"$body ",[1003,1420,1258],{"class":1025},[1003,1422,1423],{"class":1017}," json_decode",[1003,1425,1426],{"class":1037},"($response, ",[1003,1428,1429],{"class":1017},"true",[1003,1431,1223],{"class":1037},[1003,1433,1434,1436,1439,1442,1445],{"class":1005,"line":477},[1003,1435,1159],{"class":1025},[1003,1437,1438],{"class":1037}," ($status ",[1003,1440,1441],{"class":1025},">=",[1003,1443,1444],{"class":1017}," 400",[1003,1446,1372],{"class":1037},[1003,1448,1449,1452,1454,1457,1460],{"class":1005,"line":482},[1003,1450,1451],{"class":1037},"    $error ",[1003,1453,1258],{"class":1025},[1003,1455,1456],{"class":1037}," $body[",[1003,1458,1459],{"class":1021},"'error'",[1003,1461,1462],{"class":1037},"];\n",[1003,1464,1465,1467,1469,1471,1473,1476,1479,1482,1485,1488,1490,1493],{"class":1005,"line":487},[1003,1466,1377],{"class":1025},[1003,1468,1174],{"class":1025},[1003,1470,1382],{"class":1017},[1003,1472,1096],{"class":1037},[1003,1474,1475],{"class":1021},"\"",[1003,1477,1478],{"class":1037},"$status",[1003,1480,1481],{"class":1021}," {",[1003,1483,1484],{"class":1037},"$error",[1003,1486,1487],{"class":1021},"['code']}: {",[1003,1489,1484],{"class":1037},[1003,1491,1492],{"class":1021},"['message']}\"",[1003,1494,1223],{"class":1037},[1003,1496,1497],{"class":1005,"line":493},[1003,1498,1395],{"class":1037},[1003,1500,1501,1504,1507,1510],{"class":1005,"line":499},[1003,1502,1503],{"class":1017},"print_r",[1003,1505,1506],{"class":1037},"($body[",[1003,1508,1509],{"class":1021},"'data'",[1003,1511,1343],{"class":1037},[1003,1513,1514,1516,1518,1521],{"class":1005,"line":504},[1003,1515,1503],{"class":1017},[1003,1517,1506],{"class":1037},[1003,1519,1520],{"class":1021},"'pagination'",[1003,1522,1343],{"class":1037},[1524,1525,1526],"style",{},"html pre.shiki code .sLBg1, html code.shiki .sLBg1{--shiki-default:#66707B;--shiki-dark:#BDC4CC}html pre.shiki code .soyes, html code.shiki .soyes{--shiki-default:#702C00;--shiki-dark:#FFB757}html pre.shiki code .s-5SL, html code.shiki .s-5SL{--shiki-default:#023B95;--shiki-dark:#91CBFF}html pre.shiki code .sT6z2, html code.shiki .sT6z2{--shiki-default:#032563;--shiki-dark:#ADDCFF}html pre.shiki code .sHUrx, html code.shiki .sHUrx{--shiki-default:#A0111F;--shiki-dark:#FF9492}html pre.shiki code .suds8, html code.shiki .suds8{--shiki-default:#0E1116;--shiki-dark:#F0F3F6}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sKwhi, html code.shiki .sKwhi{--shiki-default:#622CBC;--shiki-dark:#DBB7FF}",{"title":999,"searchDepth":388,"depth":393,"links":1528},[],"The subdivisions of one country, a page at a time (limit up to 100), in the order the platform’s own forms list them: the 50 United States and the District of…","md",{},"8",{"title":173,"description":1529},"api\u002Freference\u002Flist-country-subdivisions","7DvBHv3rmgk37IyapFpdCrqHmIBbQULu8wv7RBO4hx4",1795776468487]