events module covers the full events surface: creating and editing events (with inline cover, image and file upload), the RSVP lifecycle, host and invite management, and the guest list. It maps directly to the Events API.
Because the JS SDK authenticates as an end user (bearer token), you never send actingUserId — the server derives who is acting from the token. The only userId arguments are targets: the host or invitee on the host/invite functions.
Requires the events bundle. Space-scoping needs the spaces bundle; images need files-images; notifications need notifications.
createEvent
Creates an event. The logged-in user becomes the event’s owner and first host. For an event in a space it’s refused when the creator isn’t an active member of the space, banned in it included (403 event/not-space-member), when they’re banned in a space above it or the space’s postingPermission is "team" and they aren’t one of its admins or moderators (403 space/posting-not-allowed), or when a user in hostIds isn’t an active member of the space (409 event/host-not-member). Pass coverFile, images and/or files to upload them inline (the request is sent as multipart/form-data).
When the event starts: an ISO 8601 datetime in UTC (ending in
Z), or a Date (sent as its ISO string).online requires url; physical requires address or location; hybrid requires both.Additional host user IDs (the logged-in user is auto-added). For an event in a space, each must be an active member of it.
The cover image plus its processing options (
mode is required). It is returned in the event’s files, and coverImageId points at it. Requires the files-images bundle.Images in the event’s files, plus the processing options applied to every one (
mode is required). A request takes at most 20 files in all. Requires the files-images bundle.Files in the event’s files, stored as uploaded. Each file’s
type comes from its MIME type; an image sent here isn’t processed, so it has no image data. Requires the files-images bundle.Promise<Event>: the created event, with files ([] for none, the cover first) and the host’s user.avatarFile / user.bannerFile whenever the files-images bundle is installed; without the bundle, no files.
fetchEvent
Fetches a single event by ID. Visibility anduserRsvp are resolved from the logged-in user’s token. The space’s active admins and moderators see every event in their space, invite events included; a host who isn’t an active member of the event’s space sees only what a regular viewer would; events in a space the viewer can’t read are hidden. See Event visibility.
Associations to expand, as a single value or an array:
"user", "space", "files", "userRsvp".Promise<Event>
fetchManyEvents
Lists events with visibility enforced (rows and totals alike), plus filtering, sorting, geo, and free-text search. The space’s active admins and moderators see every event in their space,invite events included; a host who isn’t an active member of the event’s space sees only what a regular viewer would; events in a space the viewer can’t read are hidden. See Event visibility. The myRsvp filter and userRsvp enrichment use the logged-in user.
Results per page: a whole number from
1 to 100. Defaults to 10. A larger value is rejected with 400 event/invalid-query, never lowered to 100.Sort direction. Left out, the sort’s natural direction: soonest first for
"startTime", most going first for "going".Only this space’s events, or
"none" for events not in any space. Left out: every event.Statuses the logged-in user RSVP’d with:
"going", "maybe" or "not-going", e.g. ["going", "maybe"]. Sent as one comma-separated value; values match exactly.Associations to expand, as a single value or an array:
"user", "space", "files", "userRsvp".Promise<PaginatedResponse<Event>>
updateEvent
Edits an event’s mutable fields. Host-only (403 event/forbidden): 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 edit events they don’t host. hostIds, status, and spaceId are not editable here.
Pass coverFile to replace the cover, images and files to append to the event’s files, and removeFileIds to remove the event’s files. Uploads send multipart/form-data; any file operation requires the files-images bundle.
New cover image plus its processing options — replaces the current cover, whose file is deleted.
Images to append after the event’s existing files, plus their processing options (
mode is required).Files to append after the event’s existing files, stored as uploaded.
Ids of the event’s files to remove: list files and/or the cover (
coverImageId; removing it clears the cover). Works alone or with uploads. Any other id throws a 400 (event/invalid-remove-file-ids, with invalidIds).What the response adds:
"files", the event’s files as they now are (cover first) and the host’s avatar and banner files. Without it the response has no files, even after an upload or removal.Promise<Event>
cancelEvent
Cancels an event (setsstatus: "cancelled"). The event stays fetchable but rejects new RSVPs. Allowed for the event’s owner (also when they are no longer an active member of its space) and for the active admins and moderators of its space; other hosts of an event that has an owner get 403 event/forbidden. When the owner’s account was deleted (userId is null), any of its hosts may cancel it — for an event in a space, only while an active member of that space who isn’t banned in it or a space above it (403 event/not-space-member otherwise).
Promise<Event | { id: string; status: "cancelled" }>: the cancelled event, or only { id, status } when the logged-in user can’t see the event (for example its owner who is no longer an active member of its space).
deleteEvent
Deletes an event (soft or hard per the project’seventDeletion settings). Allowed for the same users as cancelEvent: the event’s owner and the active admins and moderators of its space, and, when the owner’s account was deleted, its hosts.
Promise<void>
setRsvp
Sets or changes the logged-in user’s RSVP. Transitions intogoing are capacity-checked. Refused with 404 event/not-found when the user can’t see the event (for example a members event once a ban ends their active membership), 403 space/posting-not-allowed when they can see it but are banned in its space or a space above it, and 403 event/not-invited on an invite event they see only as an admin or moderator of its space, without an invite.
Promise<Event> (with refreshed rsvpCounts)
withdrawRsvp
Removes the logged-in user’s RSVP, also from an event they can no longer see. Withdrawing with no RSVP succeeds and changes nothing if they can see the event, and answers404 if they can’t.
Promise<Event | { id: string; userRsvp: null }>: the event, or only { id, userRsvp: null } when the logged-in user can no longer see it.
addHost
Makes a user a host. Owner-only: the logged-in user must be the event’s owner, 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 otherwise); other hosts get 403 event/forbidden. The userId is the target host, and for an event in a space must be an active member of it (409 event/host-not-member).
Promise<Event>
removeHost
Removes a host. Removing another host is owner-only (the owner, for an event in a space, while an active member of that space who isn’t banned in it or a space above it;403 event/not-space-member otherwise); other hosts get 403 event/forbidden. Any host other than the owner may step down by passing their own userId, active member or not. The owner can’t step down or be removed (409 event/owner-is-host). On an event whose owner’s account was deleted, nobody can remove another host and its last host can’t step down (409 event/last-host). It sends DELETE /events/:eventId/hosts/:userId, with the host in the path and no body.
Promise<Event | { id: string }>: the event, or only { id } after stepping down from an event the logged-in user can no longer see.
addInvite
Invites a user to the event. Host-only: the owner or a user inhostIds, 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). The userId is the target invitee. Re-inviting someone already invited who can still be invited is a no-op; one who no longer qualifies gets the same 409 and keeps their invite. For an event in a space the invitee must be able to read it and not be banned in it or a space above it, and, when the space is private or members-only (or sits under such a space) or the event is members-only, be an active member of the event’s space itself; one 409 event/invitee-not-invitable covers every case.
Promise<Event>
removeInvite
Removes a user’s invite, revoking their access to aninvite event. Their RSVP is dropped only when an invite was actually removed and the user can no longer RSVP to the event: on an invite event, a host who is an active member of the event’s space keeps it, and anyone else (a space admin or moderator who isn’t a host included) loses it; on public and members events the RSVP is never touched. Host-only. It sends DELETE /events/:eventId/invites/:userId, with the invitee in the path and no body.
Promise<Event>
fetchInvitees
Invitee (guest) list, open to the event’s hosts — for an event in a space, while they are active members of it and not banned in it or a space above it (otherwise403 event/not-space-member) — and to the space’s active admins and moderators; anyone else who can see the event gets 403 event/forbidden. Returns paginated EventInvite records with the invited user populated.
Results per page: a whole number from
1 to 100. Defaults to 10. A larger value is rejected with 400 event/invalid-query, never lowered to 100.Promise<PaginatedResponse<EventInvite>>
fetchEventRsvps
Named RSVP (guest) list. Returns paginated EventRsvp records with the user populated. Visible to anyone who can see the event whenguestListVisible is true; when it’s false, only to hosts who are active members of the event’s space and not banned in it or a space above it (any host, for an event with no space) and the space’s active admins and moderators. RSVP counts themselves are public via the event’s rsvpCounts.
Statuses to filter by:
"going", "maybe" or "not-going", e.g. ["going", "maybe"]. Sent as one comma-separated value; values match exactly. Omit for all.Results per page: a whole number from
1 to 100. Defaults to 10. A larger value is rejected with 400 event/invalid-query, never lowered to 100.Promise<PaginatedResponse<EventRsvp>>
