Semestra

Programs, terms and courses

GET
/programs/{program_id}/courses

Use to see all courses of a term or Program. To locate one course the user described in words ("my programming course"), prefer academics.course.find.

Authorization

cookiesemestra_session<token>

Set by the sign-in endpoints for the web app. Requests other than GET, HEAD and OPTIONS also need the X-Semestra-CSRF header set to the semestra_csrf cookie.

Path Parameters

program_id*Program Id

Program id

Query Parameters

term_id?|

Only courses in this term, in the term's display order

subject_code?|

Only this subject

search?|

Fuzzy match on code, title and alias (case and spaces ignored)

fields?array<>|

Agent/MCP only: return just these fields of each course (and its id)

cursor?|

next_cursor of the previous page

limit?Limit

Page size

Default200

Response Body

Successful Response

application/json
  1. response
items*array<>
next_cursor*string|null
Example Request
curl -X GET 'https://example.com/programs/string/courses'
Example Response
{  "items": [    {      "id": "string",      "program_id": "string",      "code": "string",      "title": "string",      "alias": "string",      "subject_code": "string",      "color": {        "palette": 1      },      "resolved_color": "string",      "subject_color": "string",      "credits": 0,      "include_in_gpa": true,      "instructors": [        {          "name": "string",          "email": "string",          "role": "string"        }      ],      "description": "string",      "website_url": "string",      "planned_terms": 0,      "sort_order": 0,      "term_ids": [        "string"      ],      "end_term_id": "string",      "created_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z"    }  ],  "next_cursor": "string"}
POST
/programs/{program_id}/courses

Use when the user adds a course. Get term ids from academics.term.list. For a year-long course whose second term does not exist yet, link the current term only and set planned_terms to 2; the term wizard offers to continue it later.

Authorization

cookiesemestra_session<token>

Set by the sign-in endpoints for the web app. Requests other than GET, HEAD and OPTIONS also need the X-Semestra-CSRF header set to the semestra_csrf cookie.

Path Parameters

program_id*Program Id

Program id

Request Body

application/json
  1. body
code?|

Course code such as 'APS105H1'

title*Title

Course title

Length1 <= length <= 200
alias?|

Short name shown in navigation

subject_code?|

Subject; parsed from the code when omitted

color?||

Own color; null uses the subject's

credits?|

Credits; the Program default when omitted

include_in_gpa?Include In Gpa

Whether the course counts for GPA

Defaulttrue
instructors?array<>

Instructors and TAs

Itemsitems <= 20
description?|

Course description

website_url?|

Course website

planned_terms?Planned Terms

Consecutive terms the course spans; 2 for a year-long course

Range1 <= value <= 6
Default1
term_ids*array<>

Terms the course runs in; consecutive terms for a year-long one

Itemsitems <= 6

Response Body

Successful Response

application/json
  1. response
id*Id
program_id*Program Id
code*string|null
title*Title
alias*string|null
subject_code*Subject Code
color*||

The course's own color, if set

resolved_color*Resolved Color

Color to display: 'subject-<1..12>' (palette token) or '#rrggbb'

subject_color*Subject Color

Color the course shows without its own color (its subject's), same format

credits*Credits
include_in_gpa*Include In Gpa
instructors*array<>
description*string|null
website_url*string|null
planned_terms*Planned Terms
sort_order*Sort Order
term_ids*array<string>

Linked terms in chronological order

end_term_id*End Term Id

The latest linked term; grades count there

created_at*Created At
Formatdate-time
updated_at*Updated At
Formatdate-time
Example Request
curl -X POST 'https://example.com/programs/string/courses' \  -H 'Content-Type: application/json' \  -d '{  "title": "string",  "term_ids": [    "string"  ]}'
Example Response
{  "id": "string",  "program_id": "string",  "code": "string",  "title": "string",  "alias": "string",  "subject_code": "string",  "color": {    "palette": 1  },  "resolved_color": "string",  "subject_color": "string",  "credits": 0,  "include_in_gpa": true,  "instructors": [    {      "name": "string",      "email": "string",      "role": "string"    }  ],  "description": "string",  "website_url": "string",  "planned_terms": 0,  "sort_order": 0,  "term_ids": [    "string"  ],  "end_term_id": "string",  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
POST
/programs/{program_id}/courses:batch

Use when the user adds courses in the chat, one or several. Get term ids from academics.term.list. For a year-long course whose second term does not exist yet, link the current term only and set planned_terms to 2; the term wizard offers to continue it later. Courses in a document or file (a timetable, a syllabus) go through imports.session.create instead.

Authorization

cookiesemestra_session<token>

Set by the sign-in endpoints for the web app. Requests other than GET, HEAD and OPTIONS also need the X-Semestra-CSRF header set to the semestra_csrf cookie.

Path Parameters

program_id*Program Id

Program id

Request Body

application/json
  1. body
courses*array<>

Courses to create

Items1 <= items <= 100

Response Body

Successful Response

application/json
  1. response
items*array<>
Example Request
curl -X POST 'https://example.com/programs/string/courses:batch' \  -H 'Content-Type: application/json' \  -d '{  "courses": [    {      "title": "string",      "term_ids": [        "string"      ]    }  ]}'
Example Response
{  "items": [    {      "id": "string",      "program_id": "string",      "code": "string",      "title": "string",      "alias": "string",      "subject_code": "string",      "color": {        "palette": 1      },      "resolved_color": "string",      "subject_color": "string",      "credits": 0,      "include_in_gpa": true,      "instructors": [        {          "name": "string",          "email": "string",          "role": "string"        }      ],      "description": "string",      "website_url": "string",      "planned_terms": 0,      "sort_order": 0,      "term_ids": [        "string"      ],      "end_term_id": "string",      "created_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z"    }  ]}
GET
/courses/{course_id}

Use when you need the details of a course whose id you know.

Authorization

cookiesemestra_session<token>

Set by the sign-in endpoints for the web app. Requests other than GET, HEAD and OPTIONS also need the X-Semestra-CSRF header set to the semestra_csrf cookie.

Path Parameters

course_id*Course Id

Course id

Response Body

Successful Response

application/json
  1. response
id*Id
program_id*Program Id
code*string|null
title*Title
alias*string|null
subject_code*Subject Code
color*||

The course's own color, if set

resolved_color*Resolved Color

Color to display: 'subject-<1..12>' (palette token) or '#rrggbb'

subject_color*Subject Color

Color the course shows without its own color (its subject's), same format

credits*Credits
include_in_gpa*Include In Gpa
instructors*array<>
description*string|null
website_url*string|null
planned_terms*Planned Terms
sort_order*Sort Order
term_ids*array<string>

Linked terms in chronological order

end_term_id*End Term Id

The latest linked term; grades count there

created_at*Created At
Formatdate-time
updated_at*Updated At
Formatdate-time
Example Request
curl -X GET 'https://example.com/courses/string'
Example Response
{  "id": "string",  "program_id": "string",  "code": "string",  "title": "string",  "alias": "string",  "subject_code": "string",  "color": {    "palette": 1  },  "resolved_color": "string",  "subject_color": "string",  "credits": 0,  "include_in_gpa": true,  "instructors": [    {      "name": "string",      "email": "string",      "role": "string"    }  ],  "description": "string",  "website_url": "string",  "planned_terms": 0,  "sort_order": 0,  "term_ids": [    "string"  ],  "end_term_id": "string",  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
PATCH
/courses/{course_id}

Partial update: only the fields that are sent change. To move a course to other terms or make it year-long, use academics.course.set_terms.

Authorization

cookiesemestra_session<token>

Set by the sign-in endpoints for the web app. Requests other than GET, HEAD and OPTIONS also need the X-Semestra-CSRF header set to the semestra_csrf cookie.

Path Parameters

course_id*Course Id

Course id

Request Body

application/json
  1. body
code?|

Code

title?|

Title

alias?|

Alias

subject_code?|

Subject code

color?||

Own color, or null for the subject's

credits?|

Credits

include_in_gpa?|

Counts for GPA

instructors?array<>|

Replaces all instructors

description?|

Description

website_url?|

Website

planned_terms?|

Consecutive terms the course spans

sort_order?|

Display position (then code, title)

Response Body

Successful Response

application/json
  1. response
id*Id
program_id*Program Id
code*string|null
title*Title
alias*string|null
subject_code*Subject Code
color*||

The course's own color, if set

resolved_color*Resolved Color

Color to display: 'subject-<1..12>' (palette token) or '#rrggbb'

subject_color*Subject Color

Color the course shows without its own color (its subject's), same format

credits*Credits
include_in_gpa*Include In Gpa
instructors*array<>
description*string|null
website_url*string|null
planned_terms*Planned Terms
sort_order*Sort Order
term_ids*array<string>

Linked terms in chronological order

end_term_id*End Term Id

The latest linked term; grades count there

created_at*Created At
Formatdate-time
updated_at*Updated At
Formatdate-time
Example Request
curl -X PATCH 'https://example.com/courses/string' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "id": "string",  "program_id": "string",  "code": "string",  "title": "string",  "alias": "string",  "subject_code": "string",  "color": {    "palette": 1  },  "resolved_color": "string",  "subject_color": "string",  "credits": 0,  "include_in_gpa": true,  "instructors": [    {      "name": "string",      "email": "string",      "role": "string"    }  ],  "description": "string",  "website_url": "string",  "planned_terms": 0,  "sort_order": 0,  "term_ids": [    "string"  ],  "end_term_id": "string",  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
DELETE
/courses/{course_id}

Irreversible. Use only when the user clearly asks to delete the course.

Authorization

cookiesemestra_session<token>

Set by the sign-in endpoints for the web app. Requests other than GET, HEAD and OPTIONS also need the X-Semestra-CSRF header set to the semestra_csrf cookie.

Path Parameters

course_id*Course Id

Course id

Response Body

Successful Response

application/json
  1. response
deleted?Deleted
Defaulttrue
Example Request
curl -X DELETE 'https://example.com/courses/string'
Example Response
{  "deleted": true}
PUT
/courses/{course_id}/terms

Replaces the course's terms. They must belong to its Program and be next to each other in time.

Authorization

cookiesemestra_session<token>

Set by the sign-in endpoints for the web app. Requests other than GET, HEAD and OPTIONS also need the X-Semestra-CSRF header set to the semestra_csrf cookie.

Path Parameters

course_id*Course Id

Course id

Request Body

application/json
  1. body
term_ids*array<>

All terms of the course; must be consecutive

Itemsitems <= 6

Response Body

Successful Response

application/json
  1. response
id*Id
program_id*Program Id
code*string|null
title*Title
alias*string|null
subject_code*Subject Code
color*||

The course's own color, if set

resolved_color*Resolved Color

Color to display: 'subject-<1..12>' (palette token) or '#rrggbb'

subject_color*Subject Color

Color the course shows without its own color (its subject's), same format

credits*Credits
include_in_gpa*Include In Gpa
instructors*array<>
description*string|null
website_url*string|null
planned_terms*Planned Terms
sort_order*Sort Order
term_ids*array<string>

Linked terms in chronological order

end_term_id*End Term Id

The latest linked term; grades count there

created_at*Created At
Formatdate-time
updated_at*Updated At
Formatdate-time
Example Request
curl -X PUT 'https://example.com/courses/string/terms' \  -H 'Content-Type: application/json' \  -d '{  "term_ids": [    "string"  ]}'
Example Response
{  "id": "string",  "program_id": "string",  "code": "string",  "title": "string",  "alias": "string",  "subject_code": "string",  "color": {    "palette": 1  },  "resolved_color": "string",  "subject_color": "string",  "credits": 0,  "include_in_gpa": true,  "instructors": [    {      "name": "string",      "email": "string",      "role": "string"    }  ],  "description": "string",  "website_url": "string",  "planned_terms": 0,  "sort_order": 0,  "term_ids": [    "string"  ],  "end_term_id": "string",  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
GET
/programs

Use to find the Program ids of the user, e.g. before listing terms or courses when no Program is given. Most users have exactly one Program.

Authorization

cookiesemestra_session<token>

Set by the sign-in endpoints for the web app. Requests other than GET, HEAD and OPTIONS also need the X-Semestra-CSRF header set to the semestra_csrf cookie.

Response Body

Successful Response

application/json
  1. response
items*array<>
Example Request
curl -X GET 'https://example.com/programs'
Example Response
{  "items": [    {      "id": "string",      "name": "string",      "institution": "string",      "timezone": "string",      "default_course_credits": 0,      "credit_requirement": 0,      "subject_colors": {        "property1": {          "palette": 1        },        "property2": {          "palette": 1        }      },      "sort_order": 0,      "term_count": 0,      "course_count": 0,      "created_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z"    }  ]}
POST
/programs

Use only when the user explicitly wants a new, separate Program, e.g. a second degree. Do not use to add a term or a course; use academics.term.create or academics.course.create_many.

Authorization

cookiesemestra_session<token>

Set by the sign-in endpoints for the web app. Requests other than GET, HEAD and OPTIONS also need the X-Semestra-CSRF header set to the semestra_csrf cookie.

Request Body

application/json
  1. body
name*Name

Program name, e.g. 'BASc Computer Engineering'

Length1 <= length <= 200
institution?|

School or university

timezone*Timezone

IANA time zone of the school, e.g. 'America/Toronto'

Length1 <= length <= 64
default_course_credits?Default Course Credits

Credits a new course gets when none are given

Range0 <= value <= 100
Default0.5
credit_requirement?|

Credits needed to graduate, if known

setup?

Choices of other modules' setup fields (e.g. a GPA scale preset), passed on to them with the academics.program.created event

Response Body

Successful Response

application/json
  1. response
id*Id
name*Name
institution*string|null
timezone*Timezone
default_course_credits*Default Course Credits
credit_requirement*number|null
subject_colors*

Color of each subject code

sort_order*Sort Order
term_count*Term Count
course_count*Course Count
created_at*Created At
Formatdate-time
updated_at*Updated At
Formatdate-time
Example Request
curl -X POST 'https://example.com/programs' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "timezone": "string"}'
Example Response
{  "id": "string",  "name": "string",  "institution": "string",  "timezone": "string",  "default_course_credits": 0,  "credit_requirement": 0,  "subject_colors": {    "property1": {      "palette": 1    },    "property2": {      "palette": 1    }  },  "sort_order": 0,  "term_count": 0,  "course_count": 0,  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
GET
/programs/{program_id}

Use when you need a Program's details such as its time zone or credit goal.

Authorization

cookiesemestra_session<token>

Set by the sign-in endpoints for the web app. Requests other than GET, HEAD and OPTIONS also need the X-Semestra-CSRF header set to the semestra_csrf cookie.

Path Parameters

program_id*Program Id

Program id

Response Body

Successful Response

application/json
  1. response
id*Id
name*Name
institution*string|null
timezone*Timezone
default_course_credits*Default Course Credits
credit_requirement*number|null
subject_colors*

Color of each subject code

sort_order*Sort Order
term_count*Term Count
course_count*Course Count
created_at*Created At
Formatdate-time
updated_at*Updated At
Formatdate-time
Example Request
curl -X GET 'https://example.com/programs/string'
Example Response
{  "id": "string",  "name": "string",  "institution": "string",  "timezone": "string",  "default_course_credits": 0,  "credit_requirement": 0,  "subject_colors": {    "property1": {      "palette": 1    },    "property2": {      "palette": 1    }  },  "sort_order": 0,  "term_count": 0,  "course_count": 0,  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
PATCH
/programs/{program_id}

Partial update: only the fields that are sent change. Get the Program with academics.program.get first when you need its current values. Terms and courses are changed with academics.term.update and academics.course.update.

Authorization

cookiesemestra_session<token>

Set by the sign-in endpoints for the web app. Requests other than GET, HEAD and OPTIONS also need the X-Semestra-CSRF header set to the semestra_csrf cookie.

Path Parameters

program_id*Program Id

Program id

Request Body

application/json
  1. body
name?|

Program name

institution?|

School, or null

timezone?|

IANA time zone

default_course_credits?|

Credits a new course gets

credit_requirement?|

Credits needed to graduate, or null

sort_order?|

Position in the Program switcher

Response Body

Successful Response

application/json
  1. response
id*Id
name*Name
institution*string|null
timezone*Timezone
default_course_credits*Default Course Credits
credit_requirement*number|null
subject_colors*

Color of each subject code

sort_order*Sort Order
term_count*Term Count
course_count*Course Count
created_at*Created At
Formatdate-time
updated_at*Updated At
Formatdate-time
Example Request
curl -X PATCH 'https://example.com/programs/string' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "id": "string",  "name": "string",  "institution": "string",  "timezone": "string",  "default_course_credits": 0,  "credit_requirement": 0,  "subject_colors": {    "property1": {      "palette": 1    },    "property2": {      "palette": 1    }  },  "sort_order": 0,  "term_count": 0,  "course_count": 0,  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
DELETE
/programs/{program_id}

Irreversible. Use only when the user clearly asks to delete the whole Program. To remove one term or course use academics.term.delete or academics.course.delete.

Authorization

cookiesemestra_session<token>

Set by the sign-in endpoints for the web app. Requests other than GET, HEAD and OPTIONS also need the X-Semestra-CSRF header set to the semestra_csrf cookie.

Path Parameters

program_id*Program Id

Program id

Response Body

Successful Response

application/json
  1. response
deleted?Deleted
Defaulttrue
Example Request
curl -X DELETE 'https://example.com/programs/string'
Example Response
{  "deleted": true}
PUT
/programs/{program_id}/subject-colors/{subject_code}

Use when the user wants every course of a subject in another color. To color a single course differently, use academics.course.update with color.

Authorization

cookiesemestra_session<token>

Set by the sign-in endpoints for the web app. Requests other than GET, HEAD and OPTIONS also need the X-Semestra-CSRF header set to the semestra_csrf cookie.

Path Parameters

program_id*Program Id

Program id

subject_code*Subject Code

Subject code such as 'APS'

Request Body

application/json
  1. body
color*|

Palette slot or custom hex color

Response Body

Successful Response

application/json
  1. response
id*Id
name*Name
institution*string|null
timezone*Timezone
default_course_credits*Default Course Credits
credit_requirement*number|null
subject_colors*

Color of each subject code

sort_order*Sort Order
term_count*Term Count
course_count*Course Count
created_at*Created At
Formatdate-time
updated_at*Updated At
Formatdate-time
Example Request
curl -X PUT 'https://example.com/programs/string/subject-colors/string' \  -H 'Content-Type: application/json' \  -d '{  "color": {    "palette": 1  }}'
Example Response
{  "id": "string",  "name": "string",  "institution": "string",  "timezone": "string",  "default_course_credits": 0,  "credit_requirement": 0,  "subject_colors": {    "property1": {      "palette": 1    },    "property2": {      "palette": 1    }  },  "sort_order": 0,  "term_count": 0,  "course_count": 0,  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
GET
/programs/{program_id}/terms

Use to find a term id, or which term is current (is_current), before creating courses or answering questions about a semester.

Authorization

cookiesemestra_session<token>

Set by the sign-in endpoints for the web app. Requests other than GET, HEAD and OPTIONS also need the X-Semestra-CSRF header set to the semestra_csrf cookie.

Path Parameters

program_id*Program Id

Program id

Response Body

Successful Response

application/json
  1. response
items*array<>

Sorted by start date

Example Request
curl -X GET 'https://example.com/programs/string/terms'
Example Response
{  "items": [    {      "id": "string",      "program_id": "string",      "name": "string",      "start_date": "2019-08-24",      "end_date": "2019-08-24",      "breaks": [        {          "id": "string",          "name": "string",          "start_date": "2019-08-24",          "end_date": "2019-08-24"        }      ],      "count_break_weeks": true,      "is_current": true,      "course_count": 0,      "created_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z"    }  ]}
POST
/programs/{program_id}/terms

Use when the user starts a new semester. Check academics.term.list first so the term does not exist already. courses creates courses in the new term; continue_course_ids extends year-long courses of the previous term into it.

Authorization

cookiesemestra_session<token>

Set by the sign-in endpoints for the web app. Requests other than GET, HEAD and OPTIONS also need the X-Semestra-CSRF header set to the semestra_csrf cookie.

Path Parameters

program_id*Program Id

Program to add the term to

Request Body

application/json
  1. body
name*Name

E.g. 'Fall 2026'

Length1 <= length <= 200
start_date*Start Date

First day of the term

Formatdate
end_date*End Date

Last day of the term

Formatdate
breaks?array<>

Reading weeks and holidays

Itemsitems <= 20
count_break_weeks?Count Break Weeks

Whether break weeks get a week number

Defaultfalse
courses?array<>

Courses to create in the new term

Itemsitems <= 50
continue_course_ids?array<>

Year-long courses of the previous term that continue into the new term (from academics.course.list of that term)

Itemsitems <= 50

Response Body

Successful Response

application/json
  1. response
term*
course_ids*array<string>

Ids of the created courses, in input order

continued_course_ids*array<string>
Example Request
curl -X POST 'https://example.com/programs/string/terms' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "start_date": "2019-08-24",  "end_date": "2019-08-24"}'
Example Response
{  "term": {    "id": "string",    "program_id": "string",    "name": "string",    "start_date": "2019-08-24",    "end_date": "2019-08-24",    "breaks": [      {        "id": "string",        "name": "string",        "start_date": "2019-08-24",        "end_date": "2019-08-24"      }    ],    "count_break_weeks": true,    "is_current": true,    "course_count": 0,    "created_at": "2019-08-24T14:15:22Z",    "updated_at": "2019-08-24T14:15:22Z"  },  "course_ids": [    "string"  ],  "continued_course_ids": [    "string"  ]}
GET
/terms/{term_id}

Use when you need a term's dates, reading weeks or holidays. Find the id with academics.term.list; for teaching week numbers use academics.term.get_weeks. Changes go through academics.term.update.

Authorization

cookiesemestra_session<token>

Set by the sign-in endpoints for the web app. Requests other than GET, HEAD and OPTIONS also need the X-Semestra-CSRF header set to the semestra_csrf cookie.

Path Parameters

term_id*Term Id

Term id

Response Body

Successful Response

application/json
  1. response
id*Id
program_id*Program Id
name*Name
start_date*Start Date
Formatdate
end_date*End Date
Formatdate
breaks*array<>
count_break_weeks*Count Break Weeks
is_current*Is Current

The term the Program is in now (see academics rules)

course_count*Course Count
created_at*Created At
Formatdate-time
updated_at*Updated At
Formatdate-time
Example Request
curl -X GET 'https://example.com/terms/string'
Example Response
{  "id": "string",  "program_id": "string",  "name": "string",  "start_date": "2019-08-24",  "end_date": "2019-08-24",  "breaks": [    {      "id": "string",      "name": "string",      "start_date": "2019-08-24",      "end_date": "2019-08-24"    }  ],  "count_break_weeks": true,  "is_current": true,  "course_count": 0,  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
PATCH
/terms/{term_id}

Partial update. breaks replaces the whole list; keep the ids of breaks that stay. Fails with academics.course_terms_not_adjacent when new dates would separate the terms of a year-long course.

Authorization

cookiesemestra_session<token>

Set by the sign-in endpoints for the web app. Requests other than GET, HEAD and OPTIONS also need the X-Semestra-CSRF header set to the semestra_csrf cookie.

Path Parameters

term_id*Term Id

Term id

Request Body

application/json
  1. body
name?|

Term name

start_date?|

First day

end_date?|

Last day

breaks?array<>|

Replaces all breaks

count_break_weeks?|

Whether break weeks get a week number

Response Body

Successful Response

application/json
  1. response
id*Id
program_id*Program Id
name*Name
start_date*Start Date
Formatdate
end_date*End Date
Formatdate
breaks*array<>
count_break_weeks*Count Break Weeks
is_current*Is Current

The term the Program is in now (see academics rules)

course_count*Course Count
created_at*Created At
Formatdate-time
updated_at*Updated At
Formatdate-time
Example Request
curl -X PATCH 'https://example.com/terms/string' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "id": "string",  "program_id": "string",  "name": "string",  "start_date": "2019-08-24",  "end_date": "2019-08-24",  "breaks": [    {      "id": "string",      "name": "string",      "start_date": "2019-08-24",      "end_date": "2019-08-24"    }  ],  "count_break_weeks": true,  "is_current": true,  "course_count": 0,  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
DELETE
/terms/{term_id}

Irreversible. Year-long courses that also run in other terms are kept and only lose this term. Show academics.term.preview_delete to the user first.

Authorization

cookiesemestra_session<token>

Set by the sign-in endpoints for the web app. Requests other than GET, HEAD and OPTIONS also need the X-Semestra-CSRF header set to the semestra_csrf cookie.

Path Parameters

term_id*Term Id

Term id

Response Body

Successful Response

application/json
  1. response
deleted_course_count*Deleted Course Count
kept_course_count*Kept Course Count
Example Request
curl -X DELETE 'https://example.com/terms/string'
Example Response
{  "deleted_course_count": 0,  "kept_course_count": 0}
GET
/terms/{term_id}/calendar-info

Use to translate between dates and week numbers ("week 6", "reading week"), e.g. to resolve "the Friday of week 3". Week 1 is the week the term starts in.

Authorization

cookiesemestra_session<token>

Set by the sign-in endpoints for the web app. Requests other than GET, HEAD and OPTIONS also need the X-Semestra-CSRF header set to the semestra_csrf cookie.

Path Parameters

term_id*Term Id

Term id

Response Body

Successful Response

application/json
  1. response
term_id*Term Id
timezone*Timezone
week_start*Week Start

1 = Monday, 7 = Sunday

Value in17
weeks*array<>
today*Today

Today in the Program's time zone

Formatdate
today_week*|

Index into weeks of today's week, if in term

Example Request
curl -X GET 'https://example.com/terms/string/calendar-info'
Example Response
{  "term_id": "string",  "timezone": "string",  "week_start": 1,  "weeks": [    {      "start_date": "2019-08-24",      "end_date": "2019-08-24",      "number": 0,      "break_info": {        "id": "string",        "name": "string"      }    }  ],  "today": "2019-08-24",  "today_week": 0}
GET
/terms/{term_id}/delete-preview

Use before academics.term.delete to tell the user what will be deleted.

Authorization

cookiesemestra_session<token>

Set by the sign-in endpoints for the web app. Requests other than GET, HEAD and OPTIONS also need the X-Semestra-CSRF header set to the semestra_csrf cookie.

Path Parameters

term_id*Term Id

Term id

Response Body

Successful Response

application/json
  1. response
deleted_course_count*Deleted Course Count

Courses only in this term, deleted with it

kept_course_count*Kept Course Count

Multi-term courses that stay in their other terms

deleted_course_ids*array<string>
kept_course_ids*array<string>
Example Request
curl -X GET 'https://example.com/terms/string/delete-preview'
Example Response
{  "deleted_course_count": 0,  "kept_course_count": 0,  "deleted_course_ids": [    "string"  ],  "kept_course_ids": [    "string"  ]}