Memberships

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

Get Students in a Class

get

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

Authorizations
Path parameters
class_idintegerRequired

Unique identifier for class.

Responses
200

Success

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

Success

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

Bulk Add or Update Students to a Class

patch

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

Authorizations
Path parameters
class_idintegerRequired

Unique identifier for class.

Body
Responses
200

Success

application/json
patch
PATCH /v2/classes/{class_id}/students HTTP/1.1
Host: api.managebac.com
auth-token: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 38

{
  "students": [
    {
      "id": 123,
      "level": "HL"
    }
  ]
}
200

Success

{
  "students": [
    {
      "id": 1,
      "status": "ok"
    },
    {
      "id": 2,
      "status": "unprocessable_entity",
      "errors": {
        "level": [
          "is not included in the list"
        ]
      }
    },
    {
      "id": 3,
      "status": "not_found"
    }
  ]
}

Add Students to a Class

post

This endpoint adds students, as specified by student ID/s, to a class as specified by class ID.

Authorizations
Path parameters
idintegerRequired

Unique identifier for class.

Body
student_idsinteger[]Required

An array of student IDs to add to the class.

Responses
200

Success

application/json
post
POST /v2/classes/{id}/add_students HTTP/1.1
Host: api.managebac.com
auth-token: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 19

{
  "student_ids": [
    1
  ]
}
200

Success

{
  "status": "ok"
}

Remove Students from a Class

post

This endpoint removes students from a class, as specified by student ID/s and class ID.

Authorizations
Path parameters
idintegerRequired

Unique identifier for class.

Body
student_idsinteger[]Required

An array of student IDs to remove from the class.

Responses
200

Success

application/json
post
POST /v2/classes/{id}/remove_students HTTP/1.1
Host: api.managebac.com
auth-token: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 19

{
  "student_ids": [
    1
  ]
}
200

Success

{
  "status": "ok"
}

Get all Memberships

get

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
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
GET /v2/memberships HTTP/1.1
Host: api.managebac.com
auth-token: YOUR_API_KEY
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

This endpoint retrieves details of all student memberships.

Authorizations
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
GET /v2/students/{id}/memberships HTTP/1.1
Host: api.managebac.com
auth-token: YOUR_API_KEY
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

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

Authorizations
Path parameters
class_idintegerRequired

Unique identifier for class.

Responses
200

Success

application/json
get
GET /v2/classes/{class_id}/teachers HTTP/1.1
Host: api.managebac.com
auth-token: YOUR_API_KEY
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
  }
}

Set Teacher Memberships for a Class

put

Completely replaces the given class's teacher memberships according to the provided payload. Specifying a payload of an empty array [] will remove all teachers. In addition to defining memberships, also enables or disables Show on Reports.

Authorizations
Path parameters
class_idintegerRequired

Unique identifier for class.

Body
Responses
200

Success

application/json
put
PUT /v2/classes/{class_id}/teachers HTTP/1.1
Host: api.managebac.com
auth-token: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 49

{
  "teachers": [
    {
      "id": 123,
      "show_on_reports": false
    }
  ]
}
{
  "teachers": [
    {
      "index": 0,
      "status": "unprocessable_entity",
      "errors": {
        "id": [
          "can't be blank"
        ]
      }
    },
    {
      "index": 1,
      "id": 1,
      "status": "not_found"
    },
    {
      "index": 2,
      "id": 2,
      "status": "ok"
    }
  ]
}

Remove Teachers from a Class

delete

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

Authorizations
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
DELETE /v2/classes/{class_id}/teachers/remove_teachers HTTP/1.1
Host: api.managebac.com
auth-token: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 19

{
  "teacher_ids": [
    1
  ]
}
200

Success

{
  "status": "ok"
}

Was this helpful?