Skip to content
API documentation
View as MarkdownOpen in Claude

Group challenges

List your students’ eligibility and groups for a group challenge

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

Lists your students in this organization — the ones listOrgStudents lists: activated for it and signed in to it at least once — by last name, each with where they stand in the challenge: whether their grade lets them take part, whether a teacher is linked to them, and the group they are in, if any.

Only a teacher puts students in a group, in the panel; this API does not. A student in not_in_group with teacherLinked: false needs a teacher first (linkStudentSupervisor). panelPath is where to send a student with createSigninLink.

A page at a time: limit is 20 by default and at most 100.

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.

Query parameters

NameTypeDescription
pageoptionalnumber

Page number. Defaults to 1.

Example 1

limitoptionalnumber

Items per page. Defaults to 20, max 100.

Example 20

Responses

200 OK

Success: message is "Students fetched successfully.".

Body

  • successbooleanrequired

    Always true on a success.

    one oftrue

  • messagestringrequired

    exampleStudents fetched successfully.

  • paginationobject · PaginationMetarequired

    Where one page sits in the whole list.

    4 fields of pagination
    • pagenumberrequired

      The page returned, counting from 1.

      min1example1

    • limitnumberrequired

      Items per page: the limit you sent, 20 if you sent none, and never more than 100.

      min1max100example20

    • totalnumberrequired

      Items across every page.

      min0example57

    • totalPagesnumberrequired

      Pages at this limit: total / limit, rounded up.

      min0example3

  • dataarray of GroupChallengeStudentResponserequired

    10 fields of each item
    • 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": "Students fetched successfully.",
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 57,
    "totalPages": 3
  },
  "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?page=1&limit=20' \
  -H "Authorization: Bearer $TOKEN"

Search the API documentation

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