Skip to main content
Accept Invite
Accepts an invitation. Note the path is not :workspaceId-scoped — it is addressed by the (non-secret) invitation id. Acceptance is identity-matched + verified-email, no token:
  • The caller must be the invite’s target (by userId or normalized email).
  • The caller must have a verified email — required to accept any invite (userId- or email-addressed). An unverified accept returns workspace/email-not-verified so your app can prompt verification.
  • Knowing the inviteId does not let a non-target accept.
A service key does not bypass either gate. Naming an actingUserId means being that user, so a backend auto-join flow must satisfy the invitee’s own conditions: the invitation must be actually addressed to the named user (otherwise 404 workspace/invite-not-found — accepting Alice’s invite while naming Bob does not work), and that user’s email must be verified (otherwise 403 workspace/email-not-verified). An acceptance has to land on somebody’s membership row, so actingUserId is required for a key — omitting it is a 400 workspace/missing-user-id. If your onboarding pre-accepts invites server-side, verify the address first. See Acting on behalf of a user.
On accept, the stored grant is applied and the WorkspaceMember is created transactionally; the invite is marked accepted. Fires both workspace.invite.accepted and workspace.member.added (invitation-lifecycle vs roster-sync — intentionally two streams). Already a member: if the caller is already a member (or owner), accept makes no membership change — the invite is marked accepted, no duplicate row is created, the existing grant is not overwritten, and no workspace.member.added fires. Accepting again: accepting an invite you already accepted, while you are still a member (or owner) of the workspace, answers 200 with your standing and changes nothing. Any other invite that is no longer pending — revoked, declined, accepted by someone else, or accepted by you before you left the workspace — answers 409 workspace/not-pending.

Path Parameters

string
required
The (non-secret) invitation UUID.

Body Parameters

string
required
Service keys only — the accepting user. Required for a key: an acceptance has to land on somebody’s membership row, so a key that names nobody is refused with 400 workspace/missing-user-id. Enforced: both gates above run against that user.A user token always acts as its own user and must not send it (400 workspace/acting-user-not-allowed). See Acting on behalf of a user.

Response

Your standing in the workspace after the accept: exactly the record Fetch My Membership returns, with every field present.
  • user — the accepting user’s public profile.
  • reasons — why you have standing, as structured { type, viaWorkspaceId? } entries (member, owner, …).
  • capabilities — the resolved set (direct + reach + ownership).
  • permissions — the per-node permissions of your membership on this workspace (may be empty).
  • rank — your membership rank, or null when you have no member row here (the owner).
  • relativeRank — 0 when you hold a member row here, null when you don’t.
  • title / metadata — from your member row (for the owner, their profile row); null / {} when there are none.

Error Responses

A caller who is not the invitation’s target receives the same 404 as a non-existent invitation — knowing an invite id must never confirm to a non-target that it exists.
The invitation is still pending but past its expiresAt, so it can’t be accepted. A resend gives it a new expiry.
The invitation is declined or revoked, was accepted by another user, or was accepted by you but you are no longer a member of the workspace. Accepting an invite you accepted while you are still a member answers 200 instead.
A service key called this route without naming an actingUserId. An acceptance creates someone’s membership row, so there is nobody for it to land on.
A user token sent actingUserId, even naming its own user. Only a service key names the user it acts as; a user token always acts as its own user.
A field this endpoint reads from the body was sent in the query string. actingUserId and every body field go in the JSON body.
Returned when a service key names an actingUserId that isn’t a user in this project.
The user behind the request no longer exists, for example a user token that outlived its user.
Every path id on the workspaces bundle is checked for UUID shape before the route runs, so a malformed one is a plain 400 rather than a 500 from the database.
See also: useAcceptWorkspaceInvite