Skip to main content
Add Invite
Creates an EventInvite for a user. Host-only: the caller must be the owner or in hostIds, and, for an event in a space, an active member of that space who isn’t banned in it or a space above it. A service key acts as the host it names in actingUserId. The invite is keyed on a Sublay userId (never a foreign ID) and is idempotent against the unique (eventId, userId) constraint — re-inviting an already-invited user who can still be invited is a no-op success. For an invite-visibility event, the invited user can now see and RSVP to the event. When the notifications bundle is present, the invitee receives an event-invite notification (best-effort). Who can be invited. For an event in a space, the invitee must be able to take part in that space:
  • They must be able to read the space, and not be banned in it or in any space above it.
  • When the space is private or members-only, or sits under such a space, or the event itself is members-only, they must be an active member of the event’s space itself. Members of a space above it must join the event’s space first.
One refusal covers every case — 409 event/invitee-not-invitable — so the answer doesn’t say which rule applied; in a space everyone can read, that can still tell you the invitee is banned there. Re-inviting someone already invited who no longer qualifies gets the same 409, and their existing invite is kept. Events with no space accept any invitee. People who take part in an open sub-space through membership of a space above it (commenting, reacting, RSVPing) can be seen doing so, even though they can’t be invited until they join the sub-space.

Path Parameters

string
required
UUID of the event.

Body Parameters

string
required
The user to invite.
string
Required with a service key: the user this request acts as. It has exactly that user’s powers, so it is refused unless they are a host of the event, and it is recorded as theirs. A user token always acts as its own user and must not send it (400 event/acting-user-not-allowed).

Response

Returns the updated Event.

Error Responses

A service key sent no actingUserId.
actingUserId is not a user id.
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.
actingUserId was sent in the query string. On this endpoint every field goes in the request body.
Returned when a service key names an actingUserId that isn’t a user in this project.
The event doesn’t exist, or the caller can’t see it and isn’t one of its hosts.
The caller isn’t a host. The space’s admins and moderators can see the invite list but can’t change it.
The caller is a host, but the event is in a space they aren’t an active member of, or they are banned in it or a space above it. One body for every case.
The invitee can’t take part in the event’s space (see Who can be invited above). One body for every cause.
See also: useAddInvite