Get your API key
Timetable administrators (organisation admins, global admins and group admins) can generate a personal API key for use in scripts. The key is a bearer token that lasts 7 days; when it expires, generate a new one.
The browser access token you sign in with is short-lived and is no longer suitable for scripting.
Generate a key
- Sign in to the EdCal website for the academic year you wish to manage.
- Click your profile icon in the top right-hand corner.
- In the API key section, click Generate API key.
- Copy the key immediately. It is shown only once and cannot be viewed again. If you lose it, generate a new one.
If you already have an active key, the button reads Generate new key and asks you to confirm,
because generating a new key immediately revokes the old one. Any script still using the old key
will start receiving 401 Unauthorized.
Use the key
Send the key as a bearer token, exactly as you previously sent the access token:
Authorization: Bearer edcal_ak_...
For example:
curl -H "Authorization: Bearer edcal_ak_..." https://timetable.example.ac.uk/api/me
A key only works on the site it was generated on. It stops working if it expires, if you revoke it, or if you generate a replacement. It also stops working once your administrator rights are removed (allow a short while for cached permissions to refresh).
Revoke a key
Open the same dialog and click Revoke key. Revocation takes effect immediately.