Skip to content
REST API

Remove a lesson

DELETE
/schedules/{scheduleId}/elements/{elementId}

Empties one period of a DEFINED schedule kept in WorkRoad. The element keeps its id and stays in the grid with lessonName: null, as when a lesson is removed in the app. Emptying an empty period succeeds. Returns the schedule. Element ids change whenever the timetable is saved in the app, so read GET /schedules/{scheduleId} for the current id instead of keeping one.

Required scopes: schedule:delete

Authorization

AuthorizationBearer <token>

In: header

Path Parameters

scheduleId*string

Schedule id, scoped to the key's user.

Match^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Formatuuid
elementId*string

Element id from the schedule's days[].elements[].

Match^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Formatuuid

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X DELETE "https://example.com/schedules/497f6eca-6276-4993-bfeb-53cbbbba6f08/elements/497f6eca-6276-4993-bfeb-53cbbbba6f08"
{  "data": {    "id": "4d3c2b1a-0f9e-4d8c-8b7a-6f5e4d3c2b1a",    "name": "Year 12",    "type": "DEFINED",    "external": null,    "owned": true,    "editable": true,    "firstDay": 1,    "selectedDays": [      1,      2,      3,      4,      5    ],    "issue": null,    "structure": {      "periods": [        {          "index": 0,          "name": "Period 1",          "start": "09:00",          "end": "10:00"        },        {          "index": 1,          "name": "Period 2",          "start": "10:00",          "end": "11:00"        }      ]    },    "days": [      {        "day": 1,        "elements": [          {            "id": "6e5d4c3b-2a19-4f08-9e7d-6c5b4a392817",            "period": 0,            "lessonName": "Biology",            "subjectId": "5f0c1d2e-3a4b-4c5d-8e6f-7a8b9c0d1e2f",            "subjectLabel": null,            "room": "S2",            "teacher": "Dr Patel",            "timeStart": null,            "timeEnd": null          },          {            "id": "7f6e5d4c-3b2a-4190-8f8e-7d6c5b4a3928",            "period": 1,            "lessonName": null,            "subjectId": null,            "subjectLabel": null,            "room": null,            "teacher": null,            "timeStart": null,            "timeEnd": null          }        ]      }    ]  }}