You can invite external and workspace users to rooms using invite links. Use the Room Invites API to:
Create or find invite links.
View the created links.
Delete invite links.
See the Manage Room Members user guide to learn more about room invites and how to use them.
The invite object
Invite endpoints return an invite object. A trimmed example from List Invites:
{
"_id": "kDKQ3H",
"rid": "s7CE842q9WtvLctD7",
"userId": "sNiDqHit5nGAGFg8X",
"days": 1,
"maxUses": 1,
"uses": 1,
"createdAt": "2019-12-20T03:31:56.774Z",
"expires": "2019-12-21T03:31:56.774Z"
}Fields you use most often:
_id: The invite ID, which is also the token in the invite link and what you pass to delete the invite.rid: The room the invite adds users to.userIdis the user who created the invite.daysandexpires: How long the invite is valid.days: 0means it never expires.maxUsesanduses: How many times the invite may be used and how many times it has been.maxUses: 0means unlimited.
Common workflows
Invite someone with a link
Find or create an invite for the room, setting
daysandmaxUses. If a matching invite already exists, the same one is returned.Share the returned link; the recipient joins the room by using the invite token.
List the invites to review usage, and delete an invite to revoke it early.
Conventions
Creating invites requires the
create-invite-linkspermission on the room.An invite stops working when it expires or reaches
maxUses; set both to0for a permanent, unlimited link.Whether invited external users can register depends on the workspace's registration settings.