Room Invites

Prev Next

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. userId is the user who created the invite.

  • days and expires: How long the invite is valid. days: 0 means it never expires.

  • maxUses and uses: How many times the invite may be used and how many times it has been. maxUses: 0 means unlimited.

Common workflows

Invite someone with a link

  1. Find or create an invite for the room, setting days and maxUses. If a matching invite already exists, the same one is returned.

  2. Share the returned link; the recipient joins the room by using the invite token.

  3. List the invites to review usage, and delete an invite to revoke it early.

Conventions

  • Creating invites requires the create-invite-links permission on the room.

  • An invite stops working when it expires or reaches maxUses; set both to 0 for a permanent, unlimited link.

  • Whether invited external users can register depends on the workspace's registration settings.