Skip to content
API documentation
View as MarkdownOpen in Claude

Applications

Move one of your students’ applications to another exam

PUT
/v1/{organizationId}/application/{applicationId}

Points an application of one of your students at a different exam. It keeps its _id and its payment record. Use it to change the language, the sitting or, where the category allows, the category. The student is not in the body: the application already says whose it is.

The new exam has to be one listAvailableExams offers the student, by the same rules and messages as createApplication. The application being moved does not count against itself, so changing the language on the same sitting is allowed; every other application the student holds still counts.

Checks, in order. The first that fails decides the answer.

  1. The application belongs to one of your students (404, as for an unknown id).
  2. The exam has not been started or handed in (409).
  3. The new exam exists in this organization (404).
  4. It is the exam the application already has: 200 "Application already uses that exam." and nothing changes.
  5. The new exam is offered to the student (409, or 400 for a student with no grade).
  6. The old exam’s category accepts the new exam’s category (409).
  7. The student holds no other exam in that category on that sitting (409).
  8. An application whose current exam is in the AI Challenge category cannot move once the student has used any of their image quota (409).
  9. A settled payment (paid, with an amount above 0) moves only to an exam of the same price (409, naming both figures).

Side effects. A payment that is not settled is re-priced to the new exam: paid with amount 0 for a free exam, pending at its price otherwise, so a move from a free exam to a priced one leaves the student owing that price. A settled payment keeps its amount and status. A move onto a make-up sitting makes the application expire 6 hours later (removeAfter); a move off one clears that.

Safe to retry: sending the exam it already has answers 200 and changes nothing. data is the application as stored, with exam, payment and user as ids.

Parameters

Path parameters

NameTypeDescription
organizationIdrequiredstringpattern ^[0-9a-f]{24}$

The organization’s _id: 24 hexadecimal digits, as listOrganizations (GET /v1/organization) lists it.

Example 64b7f0c2a1d3e4f5a6b7c8d9

applicationIdrequiredstring

The application’s _id, from createApplication or one of the application lists.

Request body

application/jsonrequired

  • examIdstringrequired

    The _id of the exam to move the application to, 24 hexadecimal digits: usually a listAvailableExams leaf’s matchedExam._id. It has to be an exam that list offers the application’s student.

    example6650a1b2c3d4e5f6a7b8c9e1

Responses

200 OK

Success: message is "Application updated successfully.".

Or message is "Application already uses that exam.": The application already has that exam; nothing changed.

Body

  • successbooleanrequired

    Always true on a success.

    one oftrue

  • messagestringrequired

    exampleApplication updated successfully.

  • dataobject · ApplicationRecordResponserequired

    An application as stored, with exam, user and payment as ids. Read the application to have them resolved.

    16 fields of data
    • _idstringrequired

      The application’s id: what applicationId takes.

      example6650a1b2c3d4e5f6a7b8c9e5

    • examstringrequired

      The id of the exam applied for.

      example6650a1b2c3d4e5f6a7b8c9e1

    • userstringrequired

      The organization’s own id for the student, not the id you registered them with. The application reads resolve it into a record carrying both.

      example6650a1b2c3d4e5f6a7b8c9e9

    • paymentstring

      The id of the application’s payment.

      example6650a1b2c3d4e5f6a7b8c9e6

    • partnersarray of ApplicationPartnerResponserequired

      On a team exam, the other members of the team. Empty for an exam sat alone.

      2 fields of each item
      • userstring

        The team member’s id in this organization. Not one of your students’ ids, and not resolved.

        example6650a1b2c3d4e5f6a7b8c9d6

      • acceptedboolean

        Whether they have accepted the invitation to the team.

        exampletrue

    • participatedbooleanrequired

      Whether the student has started the exam. A started application cannot be moved to another exam.

      examplefalse

    • examStartstring

      When the student started the exam; absent until then.

      formatdate-timeexample2026-11-14T10:04:12.000Z

    • examSubmittedboolean

      Whether the student has handed the exam in. A handed-in application cannot be moved to another exam.

      examplefalse

    • submitDatestring

      When the student handed the exam in; absent until then.

      formatdate-timeexample2026-11-14T11:12:40.000Z

    • simulationStartedbooleanrequired

      Whether the student has started the practice run.

      examplefalse

    • simulationStartstring

      When the student started the practice run; absent until then.

      formatdate-timeexample2026-11-07T10:00:00.000Z

    • simulationSubmittedbooleanrequired

      Whether the student has handed the practice run in.

      examplefalse

    • removeAfterstring

      Only on an application to an exam on a make-up sitting: when it will be removed, 6 hours after it was made.

      formatdate-timeexample2026-09-02T14:05:00.000Z

    • uuidstringrequired

      A short reference code for the application.

      examplea3f-09c-7e1

    • createdAtstringrequired

      When the application was made.

      formatdate-timeexample2026-09-01T09:30:00.000Z

    • updatedAtstringrequired

      When the application last changed.

      formatdate-timeexample2026-09-02T14:05:00.000Z

Headers

X-RateLimit-Limit integer

Requests your account may make to this operation per window (100).

X-RateLimit-Remaining integer

Requests left in the current window.

X-RateLimit-Reset integer

Seconds until the current window ends.

Example

{
  "data": {
    "_id": "6650a1b2c3d4e5f6a7b8c9e5",
    "createdAt": "2026-09-01T09:30:00.000Z",
    "exam": "6650a1b2c3d4e5f6a7b8c9e1",
    "examStart": "2026-11-14T10:04:12.000Z",
    "examSubmitted": false,
    "participated": false,
    "partners": [
      {
        "accepted": true,
        "user": "6650a1b2c3d4e5f6a7b8c9d6"
      }
    ],
    "payment": "6650a1b2c3d4e5f6a7b8c9e6",
    "removeAfter": "2026-09-02T14:05:00.000Z",
    "simulationStart": "2026-11-07T10:00:00.000Z",
    "simulationStarted": false,
    "simulationSubmitted": false,
    "submitDate": "2026-11-14T11:12:40.000Z",
    "updatedAt": "2026-09-02T14:05:00.000Z",
    "user": "6650a1b2c3d4e5f6a7b8c9e9",
    "uuid": "a3f-09c-7e1"
  },
  "message": "Application updated successfully.",
  "success": true
}

Example request

# $TOKEN: a short-lived token you minted with your API key and secret
curl -sS -X PUT 'https://api.main-team.org/v1/<organizationId>/application/<applicationId>' \
  -H "Authorization: Bearer $TOKEN" \
  -H 'Content-Type: application/json' \
  --data-binary @- <<'JSON'
{
  "examId": "6650a1b2c3d4e5f6a7b8c9e1"
}
JSON

Search the API documentation

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