Classes

Classes are scheduled sessions in which teachers deliver a given curriculum to a group of students.

Bulk update Students from a Class

patch
/v2p0/classes/{class_id}/students

This endpoint updates 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.

Body
Responses
200

Success

application/json
patch
/v2p0/classes/{class_id}/students
PATCH /v2p0/classes/{class_id}/students HTTP/1.1
Host: api.devel.managebac.com
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"
    }
  ]
}

Get all Classes

get
/v2p0/classes

This endpoint retrieves all classes. It returns class name, class ID, grade, program, and any School-defined values.

Authorizations
auth_tokenstringRequired

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

Query parameters
modified_sincestringOptional

A timestamp to filter the modification date of results.

deleted_sincestringOptional

A timestamp to filter the deleted date of results.

pagestringOptional

An integer defining which page to display.

per_pagestringOptional

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

archivedbooleanOptional

A boolean that, if set to True, returns only archived classes.

Responses
200

Success

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

Success

{
  "classes": [
    {
      "id": 852,
      "name": "IB DP English A (Grade 11)",
      "start_term_id": 1,
      "end_term_id": 2,
      "created_at": "2021-06-28T12:39:36.000Z",
      "updated_at": "2021-06-28T12:39:36.000Z",
      "grade": "Grade 11",
      "grade_number": 12,
      "applicable_levels": [
        "HL",
        "SL"
      ],
      "program": "IB Diploma",
      "program_code": "diploma",
      "subject_id": 927,
      "subject_name": "English",
      "subject_group": "Studies in Language and Literature",
      "subject_group_id": 13,
      "teachers": [
        {
          "teacher_id": 1960,
          "show_on_reports": false,
          "teacher_archived": false
        }
      ]
    }
  ],
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "per_page": 100
  }
}

Create a class

post
/v2p0/classes

This endpoint creates a class. It returns class details and the IDs of teachers.

Authorizations
auth_tokenstringRequired

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

Body
start_term_idintegerOptional

Academic term ID.

Example: 123
end_term_idintegerOptional

Academic term ID.

Example: 132
subject_idintegerOptional

Subject’s unique ID.

Example: 123434
programstringOptional

Program code.

Example: diploma
grade_numberintegerOptional

Grade number.

Example: 13
namestringOptional

Class Name.

Example: IB DP Biology (Grade 12)
descriptionstringOptional

Class description.

Example: Lorem ipsum dolor sitamet.
languagestring,Optional

Language of Instruction. Receives a language code.

Example: en
uniq_idstringOptional

Unique ID in ManageBac.

Example: DG333
class_sectionstringOptional

Identifier for a duplicated class/grade.

Example: A
subject_idsinteger[]Optional

Subjects unique IDs.

Example: [123434,10001]
slbooleanOptional

SL level

Example: true
hlbooleanOptional

HL level

Example: false
subject_optionone ofOptional

Subject option.

stringOptional

Allowed for Subject that support language level (e.g. Language and literature).

Example: Language and literature
or
string[]Optional

Allowed for Subject that support phases.

Example: ["1","2","3"]
lock_membershipsstringOptional

Lock Memberships.

Example: students_only
Responses
200

Success

application/json
post
/v2p0/classes
POST /v2p0/classes HTTP/1.1
Host: api.devel.managebac.com
Content-Type: application/json
Accept: */*
Content-Length: 356

{
  "start_term_id": 123,
  "end_term_id": 132,
  "subject_id": 123434,
  "program": "diploma",
  "grade_number": 13,
  "name": "IB DP Biology (Grade 12)",
  "description": "Lorem ipsum dolor sitamet.",
  "language": "en",
  "uniq_id": "DG333",
  "class_section": "A",
  "subject_ids": [
    123434,
    10001
  ],
  "sl": true,
  "hl": false,
  "subject_option": "Language and literature",
  "lock_memberships": "students_only"
}
{
  "id": 123,
  "name": "IB DP Biology (Grade 12)",
  "description": "Lorem ipsum dolor sitamet.",
  "language": "en",
  "uniq_id": "DG333",
  "class_section": "A",
  "start_term_id": 123,
  "end_term_id": 132,
  "created_at": "2023-07-24T15:12:58.000Z",
  "updated_at": "2023-07-24T15:12:58.000Z",
  "grade": "Grade 12",
  "grade_number": 7,
  "applicable_levels": [
    "HL",
    "SL"
  ],
  "program": "IB Diploma",
  "program_code": "diploma",
  "subject_id": 123434,
  "subject_name": "Norwegian",
  "subject_group": "Studies in language and literature",
  "subject_option": "Language and literature",
  "lock_memberships": "students_only",
  "archived": false,
  "subjects": [
    {
      "id": 123,
      "name": "Spanish",
      "subject_group_id": 123,
      "subject_group": "Language"
    }
  ],
  "teachers": [
    {
      "teacher_id": 123,
      "show_on_reports": true,
      "teacher_archived": false
    }
  ]
}

Upsert many classes

patch
/v2p0/classes

This endpoint creates and updates many classes. It returns indexed classes details and the IDs of teachers. It returns indexed errors for invalid classes.

Authorizations
auth_tokenstringRequired

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

Body
Responses
200

Success

application/json
patch
/v2p0/classes
PATCH /v2p0/classes HTTP/1.1
Host: api.devel.managebac.com
Content-Type: application/json
Accept: */*
Content-Length: 300

{
  "classes": [
    {
      "id": 123,
      "archived": false,
      "name": "IB DP Biology (Grade 12)",
      "description": "Lorem ipsum dolor sitamet.",
      "language": "en",
      "uniq_id": "DG333",
      "class_section": "A",
      "subject_ids": [
        123434,
        10001
      ],
      "sl": true,
      "hl": false,
      "subject_option": "Language and literature",
      "lock_memberships": "students_only"
    }
  ]
}
200

Success

[
  {
    "index": 0,
    "errors": {},
    "status": "unprocessable_entity"
  }
]

Get a Class

get
/v2p0/classes/{id}

This endpoint retrieves a single class as specified by ID. It returns class details and the IDs of teachers.

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 for class.

Responses
200

Success

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

Success

{
  "class": {
    "id": 854,
    "name": "IB DP English A (Grade 11)",
    "created_at": "2021-06-28T12:39:37.000Z",
    "updated_at": "2021-06-28T12:39:37.000Z",
    "grade": "Grade 11",
    "grade_number": 12,
    "applicable_levels": [
      "HL",
      "SL"
    ],
    "program": "IB Diploma",
    "program_code": "diploma",
    "subject_id": 929,
    "subject_name": "English",
    "subject_group": "Studies in Language and Literature",
    "subject_group_id": 13,
    "teachers": []
  }
}

Update a class

patch
/v2p0/classes/{id}

This endpoint updates a class. It returns class details and the IDs of teachers.

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 for class.

Body
archivedbooleanOptional

Archive Class.

Example: false
namestringOptional

Class Name.

Example: IB DP Biology (Grade 12)
descriptionstringOptional

Class description.

Example: Lorem ipsum dolor sitamet.
languagestring,Optional

Language of Instruction. Receives a language code.

Example: en
uniq_idstringOptional

Unique ID in ManageBac.

Example: DG333
class_sectionstringOptional

Identifier for a duplicated class/grade.

Example: A
subject_idsinteger[]Optional

Subjects unique IDs.

Example: [123434,10001]
slbooleanOptional

SL level

Example: true
hlbooleanOptional

HL level

Example: false
subject_optionone ofOptional

Subject option.

stringOptional

Allowed for Subject that support language level (e.g. Language and literature).

Example: Language and literature
or
string[]Optional

Allowed for Subject that support phases.

Example: ["1","2","3"]
lock_membershipsstringOptional

Lock Memberships.

Example: students_only
Responses
200

Success

application/json
patch
/v2p0/classes/{id}
PATCH /v2p0/classes/{id} HTTP/1.1
Host: api.devel.managebac.com
Content-Type: application/json
Accept: */*
Content-Length: 277

{
  "archived": false,
  "name": "IB DP Biology (Grade 12)",
  "description": "Lorem ipsum dolor sitamet.",
  "language": "en",
  "uniq_id": "DG333",
  "class_section": "A",
  "subject_ids": [
    123434,
    10001
  ],
  "sl": true,
  "hl": false,
  "subject_option": "Language and literature",
  "lock_memberships": "students_only"
}
{
  "id": 123,
  "name": "IB DP Biology (Grade 12)",
  "description": "Lorem ipsum dolor sitamet.",
  "language": "en",
  "uniq_id": "DG333",
  "class_section": "A",
  "start_term_id": 123,
  "end_term_id": 132,
  "created_at": "2023-07-24T15:12:58.000Z",
  "updated_at": "2023-07-24T15:12:58.000Z",
  "grade": "Grade 12",
  "grade_number": 7,
  "applicable_levels": [
    "HL",
    "SL"
  ],
  "program": "IB Diploma",
  "program_code": "diploma",
  "subject_id": 123434,
  "subject_name": "Norwegian",
  "subject_group": "Studies in language and literature",
  "subject_option": "Language and literature",
  "lock_memberships": "students_only",
  "archived": false,
  "subjects": [
    {
      "id": 123,
      "name": "Spanish",
      "subject_group_id": 123,
      "subject_group": "Language"
    }
  ],
  "teachers": [
    {
      "teacher_id": 123,
      "show_on_reports": true,
      "teacher_archived": false
    }
  ]
}

Add Students to a Class

post
/v2p0/classes/{id}/add_students

This endpoint adds students, as specified by student ID/s, 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
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
/v2p0/classes/{id}/add_students
POST /v2p0/classes/{id}/add_students HTTP/1.1
Host: api.devel.managebac.com
Content-Type: application/json
Accept: */*
Content-Length: 19

{
  "student_ids": [
    1
  ]
}
200

Success

{
  "status": "ok"
}

Remove Students from a Class

post
/v2p0/classes/{id}/remove_students

This endpoint removes students from a class, as specified by student ID/s and 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
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
/v2p0/classes/{id}/remove_students
POST /v2p0/classes/{id}/remove_students HTTP/1.1
Host: api.devel.managebac.com
Content-Type: application/json
Accept: */*
Content-Length: 19

{
  "student_ids": [
    1
  ]
}
200

Success

{
  "status": "ok"
}

Last updated

Was this helpful?