Send your key as a bearer token on every call. Keys start with tut_, belong to a tutor account on an active plan, and reach that account's boards (and, for an organisation, its tutors' boards).
Header
Authorization: Bearer tut_your_key
Keep keys on your server. Never put one in a web page or an app.
Errors and limits
A failed call answers with a status code and one shape of body. Each key may make about 120 requests a minute; after that you get a 429 with a Retry-After header in seconds. Wait that long, then carry on.
Error body
{
"error": {
"code": "not_found",
"message": "There is no board with that code on this account."
}
}
Error codes
bad_json400
The body is not valid JSON.
invalid_request400
A field is missing or not allowed. The message says which.
missing_key401
No key was sent in the Authorization header.
invalid_key401
The key is wrong or has been deleted.
plan_required402
The account's Tutorio plan is not active.
not_a_tutor403
The key belongs to an account that is not a tutor.
not_found404
Nothing with that code or id on this account.
rate_limited429
More than about 120 requests a minute. Wait for Retry-After.
Makes a whiteboard and gives back its link. Send external_id (your own id for the lesson, student or booking) and the call is safe to repeat: the same id always gives back the same board.
Body (JSON)
namestring
What the board is called. Up to 80 characters.
external_idstring
Your id for what this board is for. Asking again with it returns the same board.
host_emailstring
Give the board to a tutor in your organisation instead of to you.
A link that takes one person straight into the board, already signed in. Put it behind your own Join button. A participant link works until it expires; send external_id and that person always comes back to the same Tutorio account. A host link signs in as the board's tutor: it works once and lasts ten minutes, so make it at the moment they click.
Path
codestringrequired
The board's code: the last part of its link.
Body (JSON)
rolestring
"participant" (the default) or "host".
namestring
The name the room shows. Needed for a participant.
external_idstring
Your id for this person, so they keep one account.
emailstring
Their email, if you have it. Only kept for your records.
expires_ininteger
Seconds until the link stops working. A participant link lasts a day unless you say, 90 days at most; a host link ten minutes, an hour at most.
embedboolean
true makes a link for an iframe on your own page instead: url is the frame's src, and fallback_url the board as a page of its own. The board's tutor must have allowed your site under Integrations, and a participant needs external_id. An embed link signs in to that one room only and works nowhere but in a frame. See Embedding.
Tutorio will POST each event to your URL as it happens. Leave events out to get all of them. The secret in the answer signs every delivery; it is shown once, here, and never again (not in the list either), so keep it. People's names are left out of what is sent unless you ask for them with include_names: without it each participant comes with their id, your external_id for them, their role and their times, and a recording comes without its list of people and without its summary (which is written about the lesson and can name a child): the event carries "summary_available": true instead, and GET /recordings/{id} has the summary and the transcript.
Body (JSON)
urlstringrequired
Where to send events. Must be https.
eventsarray
The event types you want. Empty means all.
include_namesboolean
true sends participants' names, the names of the people in a recording, and a recording's summary. Left out or false, deliveries carry ids, roles and times only. Ask for names only if you need them: the people in a room are mostly children.
Add a URL in Integrations or with POST /webhooks and Tutorio posts each event to it as JSON. Answer with any 2xx within 15 seconds. If you do not, we try again after 5 seconds and after 30. Every attempt is kept in the delivery log for a week, and "Send a test" posts a ping.
Every body has the same envelope: id, type, created (Unix seconds) and data.
People's names are left out unless you ask for them. Each participant comes with an id, the external_id you gave them, a role and their times, which is what the examples below show. Make the webhook with include_names (or turn on "Include names" in Integrations) and each participant also has a name, and a recording a people list.
session.startedThe first person enters a board.session.started
Each delivery carries a Tutorio-Signature header: t=<unix>,v1=<hex>. The hex is the HMAC-SHA256 of <t>.<body> using your webhook's secret (it starts whsec_ and is shown once, when the webhook is made). Compute the same and compare, and turn away anything more than a few minutes old.
verify.js
const crypto = require('crypto');
// rawBody is the request body exactly as received, before JSON.parse.
function verify(secret, header, rawBody) {
const parts = Object.fromEntries(header.split(',').map((p) => p.trim().split('=')));
const want = crypto.createHmac('sha256', secret)
.update(parts.t + '.' + rawBody)
.digest('hex');
const fresh = Math.abs(Date.now() / 1000 - Number(parts.t)) < 300;
return fresh && parts.v1.length === want.length &&
crypto.timingSafeEqual(Buffer.from(parts.v1), Buffer.from(want));
}
verify.py
import hashlib, hmac, time
# raw_body is the request body as bytes, exactly as received.
def verify(secret: str, header: str, raw_body: bytes) -> bool:
parts = dict(p.strip().split("=", 1) for p in header.split(","))
signed = parts["t"].encode() + b"." + raw_body
want = hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest()
fresh = abs(time.time() - int(parts["t"])) < 300
return fresh and hmac.compare_digest(want, parts.get("v1", ""))
Sign-in links
A sign-in link takes one person straight into a board, already named. Make it on your server at the moment they press Join, and redirect them to it.
Participant links work until they expire: a day unless you say, 90 days at most.
Host links sign in as the board's tutor. They work once and last ten minutes.
external_id keeps a person on one Tutorio account each time they come back.
join.js
// When someone presses Join in your product:
app.get('/lessons/:id/join', async (req, res) => {
const lesson = await db.lessons.find(req.params.id);
const user = req.user;
// The same external_id always returns the same board.
const board = await tutorio('POST', '/boards', {
name: lesson.title,
external_id: 'lesson-' + lesson.id,
});
const link = await tutorio('POST', '/boards/' + board.code + '/links', {
role: user.isTutor ? 'host' : 'participant',
name: user.name,
external_id: 'user-' + user.id,
});
res.redirect(link.url);
});
Embedding
The simplest way in is a Join button anywhere in your product: the board opens as a page of its own, in the same tab or a new one.
Join button
<!-- The board opens as its own page, so cameras and microphones work. -->
<a href="/lessons/4821/join" target="_blank" rel="noopener">Join lesson</a>
The room inside your page
To show the live room inside your own lesson page, put it in an iframe. Three things make that work:
Allow your site. The tutor who hosts the boards adds your site's exact address (like https://lessons.example.com) under Integrations, Developers, Embed your whiteboard. Https only, no wildcards, ten sites at most. Every other site is refused by the browser, and so is every other Tutorio page.
Make an embed link. Send "embed": true when you create a sign-in link and use its url as the frame's src. A participant needs an external_id. An embed link only works in a frame: it signs the person in to that one room, never to their Tutorio account.
Pass on the camera. The frame needs the allow attribute below, or the browser blocks the camera, microphone and screen sharing inside it. The room says so when it is missing.
lesson.js
// The lesson page in your product, rendered on your server:
app.get('/lessons/:id', async (req, res) => {
const lesson = await db.lessons.find(req.params.id);
const user = req.user;
const board = await tutorio('POST', '/boards', {
name: lesson.title,
external_id: 'lesson-' + lesson.id,
});
// "embed": true makes a link that only works as the src of a frame.
// Make a fresh one each time the page is rendered.
const link = await tutorio('POST', '/boards/' + board.code + '/links', {
role: user.isTutor ? 'host' : 'participant',
name: user.name,
external_id: 'user-' + user.id,
embed: true,
});
res.render('lesson', { roomSrc: link.url, roomTab: link.fallback_url });
});
lesson.html
<iframe id="room"
src="{{ roomSrc }}"
allow="camera; microphone; display-capture; fullscreen; clipboard-write; autoplay"
allowfullscreen
style="width:100%;height:720px;border:0"
title="Whiteboard"></iframe>
<a href="{{ roomTab }}" target="_blank" rel="noopener">Open in a new tab</a>
<script>
window.addEventListener('message', function (e) {
if (e.origin !== 'https://tutorio.app') return;
if (e.source !== document.getElementById('room').contentWindow) return;
switch (e.data && e.data.type) {
case 'tutorio:ready': break; // the room has loaded
case 'tutorio:joined': break; // e.data.role is "host" or "participant"
case 'tutorio:left': break; // they left the room
case 'tutorio:ended': break; // the host ended the session
case 'tutorio:error': break; // e.data.code says why; render the page again for a fresh link
}
});
</script>
Messages from the frame
tutorio:ready
The room has loaded and is showing its Join screen.
tutorio:joined
They are in the room. role is host or participant.
tutorio:left
They left, or the host removed them.
tutorio:ended
The host ended the session for everyone.
tutorio:error
The frame cannot show the room. code says why: link_expired, no_session, locked, own_account, embed_off, permissions.
What works in the frame The board, tabs, apps and websites, uploads, chat, the call with cameras and screen sharing, and the host's room controls.
What needs a tab of its own Recording, Rio, the invite sheet, cloud files, Print Studio and live lessons. The room has an Open in a new tab button; fallback_url is the same address for your own.
Sessions The frame stays signed in while it is open (two hours without activity, twelve at most) and across reloads. A host link works once, so make a new link every time you render the page. Removing a site from the list signs out every embedded room.
No cookies Nothing depends on third-party cookies.
To go the other way and put your content inside the board, use the Custom Apps SDK below. For a learning platform, LTI 1.3 adds the board to a course with no code.
Custom Apps SDK
Any https page that allows framing can be an app on the board. Add it under Custom apps in Integrations, load one script, and it is shared by everyone in the room.
A promise for the room: me, people, state, and standalone when the page is not in a board.
state.set(key, value)
Sets a shared value. Everyone gets it; the last write to a key wins. 32 KB in all.
state.get(key)
Reads a shared value.
on('state', fn)
Called with the whole state whenever it changes.
send(data)
A message to everyone else in the room. Not kept.
on('message', fn)
Called with each message someone sends.
people
Who is in the room right now.
Zapier
The Zapier app wraps this API for people who do not write code. It is waiting for Zapier's review, so it is not in their app list yet; ask us for an invite link. It needs your own Zapier account.