Skip to content
REST API

Set a schedule's periods

PUT
/schedules/{scheduleId}/structure

Replaces the periods of a DEFINED schedule kept in WorkRoad. Once the first lesson is added, the number of periods is fixed; names and times can still change. The app stores a time that is still being set up as an empty string, so the structure from GET /schedules/{scheduleId} can be sent back unchanged.

Required scopes: schedule:update

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

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PUT "https://example.com/schedules/497f6eca-6276-4993-bfeb-53cbbbba6f08/structure" \  -H "Content-Type: application/json" \  -d '{    "periods": [      {        "name": "string",        "start": "string",        "end": "string"      }    ]  }'
{  "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          }        ]      }    ]  }}