Memberships

A membership defines the kind of association between a class and a student or teacher

Get Students for a Class

get
/v2/classes/{class_id}/students

This endpoint retrieves all students belonging to a class as specified by class ID.

Authorizations
auth_tokenstringRequired

Your V2 API authentication token may be passed in the parameters. To protect your key, use environment variables.

Path parameters
class_idintegerRequired

Unique identifier for class.

Query parameters
include_archived_studentsbooleanOptionalDefault: false
Responses
200

Success

application/json
get
/v2/classes/{class_id}/students
GET /v2/classes/{class_id}/students HTTP/1.1
Host: api.devel.managebac.com
Accept: */*
200

Success

{
  "student_ids": [
    10193652
  ],
  "student_levels": {
    "10193652": "SL"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "per_page": 100
  }
}

Get all Memberships

get
/v2/memberships

This endpoint retrieves all members for each class (students, teachers and admin). It returns for each user the class ID, user ID, user role in the class and other details.

Authorizations
auth_tokenstringRequired

Your V2 API authentication token may be passed in the parameters. To protect your key, use environment variables.

Query parameters
class_ids[]integer[]Optional

The list of class IDs to select membership for

modified_sincestringOptional

A timestamp to filter the modification date of results.

deleted_sincestringOptional

A timestamp to filter the deletion date of results.

pagestringOptional

An integer defining which page to display.

per_pagestringOptional

An integer defining the number of records to display per page.

user_ids[]integer[]Optional

An integer list of users ids to filter by.

user_idsinteger[]Optional

An integer list of users ids to filter by.

class_happens_onstring · dateOptional

A date param to filter by start term and end term date range.

Responses
200

successful

application/json
get
/v2/memberships
GET /v2/memberships HTTP/1.1
Host: api.devel.managebac.com
Accept: */*
200

successful

{
  "memberships": [
    {
      "id": 922,
      "user_id": 2012,
      "level": 1,
      "created_at": "2021-06-28T12:39:52.000Z",
      "updated_at": "2021-06-28T12:39:52.000Z",
      "class_id": 899,
      "user_email": "[email protected]",
      "role": "Student"
    },
    {
      "id": 923,
      "user_id": 2013,
      "created_at": "2021-06-28T12:39:52.000Z",
      "updated_at": "2021-06-28T12:39:52.000Z",
      "class_id": 900,
      "user_email": "[email protected]",
      "role": "Student"
    },
    {
      "id": 924,
      "user_id": 2014,
      "created_at": "2021-06-28T12:39:52.000Z",
      "updated_at": "2021-06-28T12:39:52.000Z",
      "class_id": 901,
      "user_email": "[email protected]",
      "role": "Student"
    }
  ],
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 3,
    "per_page": 100
  }
}

Get a Student's memberships

get
/v2/students/{id}/memberships

This endpoint retrieves details of all student memberships.

Authorizations
auth_tokenstringRequired

Your V2 API authentication token may be passed in the parameters. To protect your key, use environment variables.

Path parameters
idintegerRequired

Unique identifier of a student.

Query parameters
archivedbooleanOptional

Boolean value to filter memberships by archived status.

Default: false
Responses
200

Success

application/json
get
/v2/students/{id}/memberships
GET /v2/students/{id}/memberships HTTP/1.1
Host: api.devel.managebac.com
Accept: */*
200

Success

{
  "memberships": {
    "classes": [
      {
        "id": 1,
        "uniq_id": "text",
        "name": "text",
        "archived": true,
        "start_term_id": 1,
        "end_term_id": 1
      }
    ],
    "groups": [
      {
        "id": 1,
        "name": "text",
        "archived": true
      }
    ],
    "year_groups": [
      {
        "id": 1,
        "name": "text",
        "program": "text",
        "archived": true
      }
    ]
  }
}

Get Teachers for a Class

get
/v2/classes/{class_id}/teachers

This endpoint retrieves all Teachers belonging to a Class as specified by class ID.

Authorizations
auth_tokenstringRequired

Your V2 API authentication token may be passed in the parameters. To protect your key, use environment variables.

Path parameters
class_idintegerRequired

Unique identifier for class.

Responses
200

Success

application/json
get
/v2/classes/{class_id}/teachers
GET /v2/classes/{class_id}/teachers HTTP/1.1
Host: api.devel.managebac.com
Accept: */*
200

Success

{
  "teachers": [
    {
      "id": 123,
      "show_on_reports": true,
      "teacher_archived": false,
      "first_joined_at": "2025-06-01T12:40:00.000Z",
      "updated_at": "2025-06-01T13:25:15.000Z"
    },
    {
      "id": 234,
      "show_on_reports": false,
      "teacher_archived": true,
      "first_joined_at": "2025-06-01T13:40:30.000Z",
      "updated_at": "2025-06-01T14:15:00.000Z"
    }
  ],
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 2,
    "per_page": 100
  }
}

Remove Teachers from a Class

delete
/v2/classes/{class_id}/teachers/remove_teachers

This endpoint removes teachers, as specified by teacher ID/s, from a class as specified by class ID.

Authorizations
auth_tokenstringRequired

Your V2 API authentication token may be passed in the parameters. To protect your key, use environment variables.

Path parameters
class_idintegerRequired

Unique identifier for class.

Body
teacher_idsinteger[]Required

An array of teacher IDs to remove from the class.

Responses
200

Success

application/json
delete
/v2/classes/{class_id}/teachers/remove_teachers
DELETE /v2/classes/{class_id}/teachers/remove_teachers HTTP/1.1
Host: api.devel.managebac.com
Content-Type: application/json
Accept: */*
Content-Length: 19

{
  "teacher_ids": [
    1
  ]
}
200

Success

{
  "status": "ok"
}

Last updated

Was this helpful?