Skip to main content
Decline Invite
Declines an invitation. Identity-matched (the caller must be the invite’s target) and verification-gated — a verified email is required, exactly as it is to accept. Without that gate, someone who signed up with another person’s address and never verified it could burn the real target’s invite by moving it to the terminal declined state. This is not a key-bypass gate: a service key acting as a named actingUserId still requires that user to be verified. Marks the invite declined and fires workspace.invite.declined.

Path Parameters

string
required
The invitation UUID.

Body Parameters

string
required
Service keys only — the declining user (must be the invite’s target). Required for a key: a decline is an act by the invitee, so a key that names nobody is refused with 400 workspace/missing-user-id.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

204 No Content on success, with no body.

Error Responses

A caller who is not the invitation’s target receives the same 404 as a non-existent invitation.
The invitation is already accepted, declined, or revoked.
A service key called this route without naming an actingUserId. A decline is an act by the invitee; there is nobody to attribute it to.
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: useDeclineWorkspaceInvite