Overview
useAddInvite returns a callable that invites a user to an event. Host-only: the logged-in user 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 (403 event/not-space-member); the space’s admins and moderators can’t (403 event/forbidden). Re-inviting an already-invited user who can still be invited is a no-op.
For an event in a space, the invitee must be able to take part in that space: able to read it and not banned in it or in any space above it, and — when the space is private or members-only, or sits under such a space, or the event itself is members-only — an active member of the event’s space itself (members of a space above must join the event’s space first). One refusal covers every case, 409 event/invitee-not-invitable, also for re-inviting someone already invited who no longer qualifies (their invite is kept). Events with no space accept any invitee. For an invite-visibility event, the invited user can now see and RSVP to it; when the notifications bundle is enabled, the invitee receives an event-invite notification.
Usage Example
Parameters
The user to invite (userId only — never a foreign ID).
Returns
Returns a Promise<Event> — the updated Event.
See Also