Skip to content
API documentation
View as MarkdownOpen in Claude

Group challenges

Fetch one of your students’ eligibility and group for a group challenge

GET
/v1/{organizationId}/group-challenge/{challengeId}/student/{studentId}

Where one of your students stands in the challenge: the same answer as one row of listGroupChallengeStudents, for a student activated for this organization or not.

Your students are the ones your account registered: anyone else’s answers 404, exactly as an unknown id does. A student who has never signed in to this organization answers 409.

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

challengeIdrequiredstring

The group challenge’s _id, from listGroupChallenges.

studentIdrequiredstring

The student’s _id, as registerStudent returned it.

Responses

200 OK

Success: message is "Student fetched successfully.".

Body

  • successbooleanrequired

    Always true on a success.

    one oftrue

  • messagestringrequired

    exampleStudent fetched successfully.

  • dataobject · GroupChallengeStudentResponserequired

    One of your students, and where they stand in a group challenge.

    10 fields of data
    • studentIdstringrequired

      The student’s _id, as registerStudent returned it.

      example6650a1b2c3d4e5f6a7b8c9d0

    • firstNamestringrequired

      Their first name, as the organization holds it.

      exampleAda

    • lastNamestringrequired

      Their last name.

      exampleLovelace

    • gradeobject · GroupChallengeStudentGradeResponsenullablerequired

      Their grade in the organization, or null when none is set.

      2 fields of grade
      • _idstringrequired

        The grade’s id.

        example6650a1b2c3d4e5f6a7b8c9d4

      • nameobjectnullablerequired

        Its name.

        example10

    • eligiblebooleanrequired

      Whether their grade is in one of the challenge’s grade groups.

      exampletrue

    • gradeGroupobject · GroupChallengeGradeGroupRefResponsenullablerequired

      The grade group their grade belongs to, or null.

      2 fields of gradeGroup
      • _idstringrequired

        The grade group’s id within the challenge.

        example6650a1b2c3d4e5f6a7b8c9ec

      • labelstringrequired

        Its name.

        exampleGroup 7-8-9

    • teacherLinkedbooleanrequired

      Whether a teacher is linked to them in this organization. Only a teacher can put a student in a group; link one with linkStudentSupervisor.

      exampletrue

    • statestringrequired

      not_eligible: their grade is in no grade group. not_in_group: eligible, in no group yet. group_pending: in a group the teacher has not confirmed. group_active: in a confirmed group, working through the steps. group_completed: their group has sent its work. A group wins over the grade: a student in a group shows it even if their grade changed since. New values may be added.

      one ofnot_eligiblenot_in_groupgroup_pendinggroup_activegroup_completed

      examplegroup_active

    • groupobject · GroupChallengeStudentGroupResponsenullablerequired

      The group they are an active member of, or null.

      3 fields of group
      • _idstringrequired

        The group’s id: the groupId of the group operations.

        example6650a1b2c3d4e5f6a7b8c9ed

      • displayNamestringrequired

        The group’s name, or "Group" and its short code when it has none.

        exampleGroup 7KQ2MX

      • statusstringrequired

        awaiting_payment and draft while the teacher prepares it; finalized once they have confirmed it and its steps are open; completed once its work has been sent. New values may be added.

        one ofawaiting_paymentdraftfinalizedcompleted

        examplefinalized

    • panelPathstringrequired

      Where the challenge’s page is on the organization’s panel. Send it as redirect to createSigninLink to take the student straight there: {userId} is filled in for you.

      example/stadia/{userId}/group-challenges/6650a1b2c3d4e5f6a7b8c9eb

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

{
  "success": true,
  "message": "Student fetched successfully.",
  "data": {
    "studentId": "6650a1b2c3d4e5f6a7b8c9d0",
    "firstName": "Ada",
    "lastName": "Lovelace",
    "grade": {
      "_id": "6650a1b2c3d4e5f6a7b8c9d4",
      "name": "10"
    },
    "eligible": true,
    "gradeGroup": {
      "_id": "6650a1b2c3d4e5f6a7b8c9ec",
      "label": "Group 7-8-9"
    },
    "teacherLinked": true,
    "state": "group_active",
    "group": {
      "_id": "6650a1b2c3d4e5f6a7b8c9ed",
      "displayName": "Group 7KQ2MX",
      "status": "finalized"
    },
    "panelPath": "/stadia/{userId}/group-challenges/6650a1b2c3d4e5f6a7b8c9eb"
  }
}

Example request

# $TOKEN: a short-lived token you minted with your API key and secret
curl -sS 'https://api.main-team.org/v1/<organizationId>/group-challenge/<challengeId>/student/<studentId>' \
  -H "Authorization: Bearer $TOKEN"

Search the API documentation

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