Classes

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

Get all Classes

get

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

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

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

Authorizations
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
POST /v2/classes HTTP/1.1
Host: api.managebac.com
auth-token: YOUR_API_KEY
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
    }
  ]
}

Create or Update Classes

patch

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
Body
Responses
200

Success

application/json
patch
PATCH /v2/classes HTTP/1.1
Host: api.managebac.com
auth-token: YOUR_API_KEY
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

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

Authorizations
Path parameters
idintegerRequired

Unique identifier for class.

Responses
200

Success

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

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

Authorizations
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
PATCH /v2/classes/{id} HTTP/1.1
Host: api.managebac.com
auth-token: YOUR_API_KEY
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 Teachers to a Class

post

This endpoint adds teachers, as specified by teacher ID/s, to 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 add to the class.

Responses
200

Success

application/json
post
POST /v2/classes/{class_id}/teachers/add_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?