Group Members

Add a group member

Changed on

Add a teacher or student to a group. Only a group owner can add members. If no user exists for the submitted email, the application creates one and adds it to the group.

If a user already exists for that email, that person is emailed an invitation and becomes a member only once they accept it, because joining a group places the account under the institution's administration. An invitation expires after 14 days.

Both outcomes answer 201 with success: true and the same body shape. Read status to tell them apart: added means the membership exists now; invited means an invitation was sent and no membership exists yet. On invited, data.id is null — there is no group member to address, so it cannot be passed to edit-member or remove-member. data.user is the real account that was invited, and data.role and data.limit are what the membership will carry once accepted.

A client that ignores status keeps working, but will believe a member exists when only an invitation does. To confirm, read the group's members with GET /api/v1/groups/{id}/.

Exception: if the existing account's email is an LMS login rather than a real address (no @), no invitation can be delivered, so the member is added directly and status is added.

post/api/v1/groups/add-member/{id}/

Request

  • Base URL
    https://plagiarismcheck.org
  • Auth
    API key in header X-API-TOKEN

Path parameters

idinteger required

Numeric group ID.

Request body application/x-www-form-urlencoded

emailstring email required

Email address for the member to add. If the user does not exist, the API creates one.

role'teacher' | 'student' required

Group role for the new member.

namestring

Optional display name used when a new user is created.

limitinteger nullable

Optional page limit for the member. 0 blocks checks for the member; omit the field for no explicit member limit.

Example request

{
  "email": "student@example.com",
  "role": "student",
  "name": "Student Name",
  "limit": 100
}

Response

The request succeeded. status says whether a membership was created (added) or an invitation was sent (invited). The body shape is the same either way; on invited there is no group member yet, so data.id is null.

successboolean
status'added' | 'invited'

added — the membership exists now. invited — an invitation was emailed and the membership does not exist yet.

Example response

{
  "success": true,
  "status": "invited",
  "data": {
    "id": 3132945,
    "role": 2,
    "limit": 100,
    "created_at": 1512638171000,
    "user": {
      "id": 3132945,
      "name": "John Doe",
      "email": "student@example.com",
      "created_at": 1512638171000,
      "updated_at": 1512638171000,
      "allowed_languages": [
        "en"
      ],
      "balance_type": 1,
      "avatar": "https://randomuser.me/api/portraits/lego/1.jpg",
      "is_email_verification_needed": true
    }
  }
}

Changes

    • breaking

      the // response's property format changed from email to no format for status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property to the response with the status