Account and API tokens
semestra_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.
multipart/form-data- body
file*FileSuccessful Response
application/json- response
id*Idemail*Emaildisplay_name*Display Nameavatar_url*string|nulllocale*string|nullhas_password*Has Passwordidentities*array<>created_at*Created Atdate-timecurl -X POST 'https://example.com/account/avatar' \ -F 'file=string'{ "id": "string", "email": "string", "display_name": "string", "avatar_url": "string", "locale": "string", "has_password": true, "identities": [ { "provider": "google", "email": "string", "created_at": "2019-08-24T14:15:22Z" } ], "created_at": "2019-08-24T14:15:22Z"}Public: the URL embeds a random version, so it is unguessable and cacheable forever.
user_id*User Id^[A-Za-z0-9_-]+$version*Version^[A-Za-z0-9_-]+$Successful Response
image/webpcurl -X GET 'https://example.com/account/avatars/string/string'Finishes an email change started with account.email.change_start.
semestra_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.
application/json- body
code*CodeThe 6-digit code sent to the new address
^\d{6}$Successful Response
application/json- response
id*Idemail*Emaildisplay_name*Display Nameavatar_url*string|nulllocale*string|nullhas_password*Has Passwordidentities*array<>created_at*Created Atdate-timecurl -X POST 'https://example.com/account/email/change-confirm' \ -H 'Content-Type: application/json' \ -d '{ "code": "string"}'{ "id": "string", "email": "string", "display_name": "string", "avatar_url": "string", "locale": "string", "has_password": true, "identities": [ { "provider": "google", "email": "string", "created_at": "2019-08-24T14:15:22Z" } ], "created_at": "2019-08-24T14:15:22Z"}Sends a verification code to the new address. Not available to agents.
semestra_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.
application/json- body
new_email*New EmailThe new email address; a code is sent to it
password?|Current password; needed unless the session signed in during the last 10 minutes
Successful Response
application/json- response
resend_in_seconds*Resend In Secondsexpires_in_seconds*Expires In Secondscurl -X POST 'https://example.com/account/email/change-start' \ -H 'Content-Type: application/json' \ -d '{ "new_email": "string"}'{ "resend_in_seconds": 0, "expires_in_seconds": 0}Links the Google account behind the given ID token. Not available to agents.
semestra_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.
application/json- body
id_token*Id TokenGoogle Identity Services ID token
length <= 4096Successful Response
application/json- response
id*Idemail*Emaildisplay_name*Display Nameavatar_url*string|nulllocale*string|nullhas_password*Has Passwordidentities*array<>created_at*Created Atdate-timecurl -X POST 'https://example.com/account/google/link' \ -H 'Content-Type: application/json' \ -d '{ "id_token": "string"}'{ "id": "string", "email": "string", "display_name": "string", "avatar_url": "string", "locale": "string", "has_password": true, "identities": [ { "provider": "google", "email": "string", "created_at": "2019-08-24T14:15:22Z" } ], "created_at": "2019-08-24T14:15:22Z"}Removes the Google sign-in. Email code sign-in always remains available.
semestra_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.
Successful Response
application/json- response
id*Idemail*Emaildisplay_name*Display Nameavatar_url*string|nulllocale*string|nullhas_password*Has Passwordidentities*array<>created_at*Created Atdate-timecurl -X POST 'https://example.com/account/google/unlink'{ "id": "string", "email": "string", "display_name": "string", "avatar_url": "string", "locale": "string", "has_password": true, "identities": [ { "provider": "google", "email": "string", "created_at": "2019-08-24T14:15:22Z" } ], "created_at": "2019-08-24T14:15:22Z"}Change the password (or set the first one). Signs out all other sessions.
semestra_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.
application/json- body
current_password?|Current password; omit when the account has none yet
new_password*New PasswordThe new password
1 <= length <= 256Successful Response
application/json- response
id*Idemail*Emaildisplay_name*Display Nameavatar_url*string|nulllocale*string|nullhas_password*Has Passwordidentities*array<>created_at*Created Atdate-timecurl -X POST 'https://example.com/account/password/change' \ -H 'Content-Type: application/json' \ -d '{ "new_password": "string"}'{ "id": "string", "email": "string", "display_name": "string", "avatar_url": "string", "locale": "string", "has_password": true, "identities": [ { "provider": "google", "email": "string", "created_at": "2019-08-24T14:15:22Z" } ], "created_at": "2019-08-24T14:15:22Z"}Use when you need the user's name, email address or preferred language. Do not use to read academic data; use the academics, grading or schedule capabilities.
semestra_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.
Successful Response
application/json- response
id*Idemail*Emaildisplay_name*Display Nameavatar_url*string|nulllocale*string|nullhas_password*Has Passwordidentities*array<>created_at*Created Atdate-timecurl -X GET 'https://example.com/account/me'{ "id": "string", "email": "string", "display_name": "string", "avatar_url": "string", "locale": "string", "has_password": true, "identities": [ { "provider": "google", "email": "string", "created_at": "2019-08-24T14:15:22Z" } ], "created_at": "2019-08-24T14:15:22Z"}Change the signed-in user's profile. Not available to agents.
semestra_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.
application/json- body
display_name?|New display name
avatar_url?|HTTPS URL of the avatar image; send null to fall back to initials
Successful Response
application/json- response
id*Idemail*Emaildisplay_name*Display Nameavatar_url*string|nulllocale*string|nullhas_password*Has Passwordidentities*array<>created_at*Created Atdate-timecurl -X PATCH 'https://example.com/account/profile' \ -H 'Content-Type: application/json' \ -d '{}'{ "id": "string", "email": "string", "display_name": "string", "avatar_url": "string", "locale": "string", "has_password": true, "identities": [ { "provider": "google", "email": "string", "created_at": "2019-08-24T14:15:22Z" } ], "created_at": "2019-08-24T14:15:22Z"}Lists active sessions of the signed-in user. Not available to agents.
semestra_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.
Successful Response
application/json- response
items*array<>curl -X GET 'https://example.com/account/sessions'{ "items": [ { "id": "string", "kind": "web", "user_agent": "string", "ip": "string", "created_at": "2019-08-24T14:15:22Z", "last_used_at": "2019-08-24T14:15:22Z", "expires_at": "2019-08-24T14:15:22Z", "current": true } ]}Revokes a session. Revoking the current session signs this browser out.
semestra_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.
session_id*Session IdId of the session to sign out
Successful Response
application/json- response
ok?Oktruecurl -X DELETE 'https://example.com/account/sessions/string'{ "ok": true}Revokes every session except the current one.
semestra_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.
Successful Response
application/json- response
ok?Oktruecurl -X POST 'https://example.com/account/sessions/revoke-others'{ "ok": true}Lists the user's non-revoked personal access tokens (never the secrets).
semestra_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.
Successful Response
application/json- response
items*array<>curl -X GET 'https://example.com/account/tokens'{ "items": [ { "id": "string", "name": "string", "prefix": "string", "scopes": [ "read" ], "created_at": "2019-08-24T14:15:22Z", "last_used_at": "2019-08-24T14:15:22Z", "expires_at": "2019-08-24T14:15:22Z" } ]}Creates a token. The plaintext is returned once and cannot be retrieved again.
semestra_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.
application/json- body
name*NameA label, e.g. the client name
1 <= length <= 60scopes?array<>read allows read capabilities only; write also allows changes
1 <= itemsexpires_in_days?|Lifetime in days; omit for no expiry
password?|Current password; needed unless the session signed in during the last 10 minutes
Successful Response
application/json- response
id*Idname*Nameprefix*Prefixscopes*array<>created_at*Created Atdate-timelast_used_at*|nullexpires_at*|nulltoken*TokenThe plaintext token. Shown once, never stored.
curl -X POST 'https://example.com/account/tokens' \ -H 'Content-Type: application/json' \ -d '{ "name": "string"}'{ "id": "string", "name": "string", "prefix": "string", "scopes": [ "read" ], "created_at": "2019-08-24T14:15:22Z", "last_used_at": "2019-08-24T14:15:22Z", "expires_at": "2019-08-24T14:15:22Z", "token": "string"}Revokes the token immediately.
semestra_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.
id*IdId of the token to revoke
Successful Response
application/json- response
ok?Oktruecurl -X DELETE 'https://example.com/account/tokens/string'{ "ok": true}