Create Invite
Mint a join link or code for a chosen scope, org-scoped to the API key’s org.
Scopes: organization (recruit a tutor/admin by email, or get a reusable org
join link), tutor_student (1-on-1), classroom, group, parent. Supply
email to invite a specific person (creates an invite row; EquateIt emails them
where the platform already does); omit email for a reusable shareable
link/code. Cross-org targets return 404. Honours Idempotency-Key.
Authorizations
Org API key as Token token=ei_live_...
Headers
Body
POST /v1/invites → mint a join link or code for a chosen scope.
Delivery is decided by email + scope (there is no send_email flag): supply
email to invite a specific person — this creates an invite row and EquateIt
emails them where the platform already does (organization always, via a DB
trigger; tutor_student when an email is given). Omit email to get a reusable
shareable link/code. Per-scope required/irrelevant fields are validated
server-side (422). organization_id, tokens, and timestamps are always
server-set; the invite RPCs are never called (they are auth.uid()-gated).
organization, classroom, group, tutor_student, parent organization only: 'tutor' (default) | 'admin' | 'student'.
Required for the organization email path; optional elsewhere.
Required for scope=tutor_student.
Required for scope=classroom.
Required for scope=group.
Required for scope=parent (the child).
Optional, scope=tutor_student only — echoed back + audited.
Response
Successful Response
A minted invite. token carries the invite token (organization/tutor_student)
or the code (parent / org-join-code scopes). join_url is null for parent (the
code is entered manually). emailed is true only when EquateIt actually sent an
email (organization, or tutor_student with an email).