Update Batch
Updates a batch: name, manager, dates, attendance mode and its classes. Classes you send with a `class_id` are updated, classes without one are created (and the batch's learners are added to them), and existing classes you leave out are removed from the batch.
/masterbatch/{batchId}curl --request POST \
--url 'https://<your-api-host>/nuSource/api/v1/masterbatch/{batchId}' \
--header 'APIKEY: <your-api-key>' \
--header 'ORGID: <your-org-id>' \
--form 'JSONString={
"class_name": "Paid testing One Two",
"tutor_id": 3846680,
"organization_id": <organizationId>,
"start_date": "18 Aug 2021",
"end_date": "31 Jul 2023",
"courses_array": [
{
"class_id": 121333,
"course_id": 2559,
"batch_name": "maths",
"tutor_id": 3846680,
"is_live": 1,
"zoom_room_waiting": 0,
"batch_class_count": 0,
"display_index": 121333,
"virtual_class_type": 1
},
{
"class_id": 121334,
"course_id": 2557,
"batch_name": "Physics Audio",
"tutor_id": 3846680,
"is_live": 1,
"zoom_room_waiting": 0,
"batch_class_count": 0,
"display_index": 121334,
"virtual_class_type": 5
},
{
"class_id": 121335,
"course_id": 2573,
"batch_name": "Organic Chemistry",
"tutor_id": 3846680,
"is_live": 0,
"zoom_room_waiting": 0,
"batch_class_count": 0,
"display_index": 121335,
"virtual_class_type": 0
}
],
"bundle_id": 12511,
"individual_batch_attendance": 0
}'{
"code": 200,
"message": "Class Updated"
}Access: Institute admins, tutors, plus custom roles that can manage batches.
Request body: form-data with one field, JSONString, containing this JSON:
JSONString18 Aug 2021.31 Jul 2023.0 (default) attendance is taken per class. 1 one common attendance for all classes held on the same day.Fields in each courses_array object (one per class, i.e. one subject taught in the batch):
| Name | Required | Type | Description |
|---|---|---|---|
| class_id | No | integer | An existing class to keep (on update) or reuse (on create). Leave it out to create a new class. |
| course_id | Yes for new classes | integer | Curriculum ID the class teaches. Use a curriculum linked to the course. |
| batch_name | Yes | string | Class name. |
| tutor_id | Yes | integer | User ID of the class tutor. |
| description | No | string | Class description. |
| is_live | No | integer | 1 the class has live sessions, 0 (default) it does not. |
| virtual_class_type | No | integer | Live platform when is_live is 1: 1 Zoom Meeting (default), 2 BotSite, 3 GoTo, 4 GoTo Meeting, 5 Zoom Webinar, 6 Custom link, 7 Super Live, 8 MS Teams. |
| external_class_link | No | string | Meeting URL, used only with virtual_class_type 6. |
| zoom_room_waiting | No | integer | 1 turns on the Zoom waiting room. Default 0. |
| batch_class_count | No | integer | Planned number of sessions. Default 0. |
| display_index | No | integer | Position of the class in the batch (update only). |
Notes: This is a full replace. Send every class you want to keep: a class missing from courses_array is removed from the batch and archived unless another batch still uses it. start_date and end_date are cleared if you leave them out. Read the current values first with "Get Batch". Rate limit: 30 requests per 1 minute; going over locks you out for 30 minutes.