Skip to main content
The events module covers the full events surface: creating and editing events, the RSVP lifecycle, host and invite management, and the guest list. It maps directly to the Events API. Because the Node SDK authenticates with a service key (it acts as the whole project, not a single end user), functions that act as a user take that user in actingUserId. On the event-management functions (updateEvent, cancelEvent, deleteEvent, the host and invite functions, fetchInvitees), actingUserId is the host the call acts as, with exactly that host’s powers. On the host and invite functions, userId is the target user (the host or invitee).
Image upload caveat. The Node SDK does not support inline cover/gallery upload on createEvent/updateEvent yet. Create the event first, then attach images with sublay.storage.uploadImage using its eventId parameter. (The browser JS SDK and the React SDK do support inline upload.)
Requires the events bundle. Space-scoping needs the spaces bundle; images need files-images; notifications need notifications.

createEvent

Creates an event. The actingUserId you pass becomes the creator and is auto-added to hostIds. Returns the event with inline rsvpCounts.
string
required
Event title. 1–300 characters.
string
required
ISO datetime when the event starts.
"online" | "physical" | "hybrid"
required
Event format. online requires url; physical requires address or location; hybrid requires both.
string
required
The user the service key acts as: the event’s creator and first host, held to their own permissions (a space-scoped event needs them to be an active member). A user that doesn’t exist returns 404 event/user-not-found.
string
Optional description.
string
Optional ISO end datetime.
string
Optional IANA timezone.
string
Join/stream URL.
string
Venue name.
string
Street address.
{ latitude: number; longitude: number }
Coordinates for proximity search.
string
Scope the event to a space. Required when visibility is "members".
"public" | "members" | "invite"
Defaults to "public".
number
Max going RSVPs. Omit for unlimited.
boolean
Allow "maybe" RSVPs. Defaults to true.
boolean
Expose the named guest list to non-hosts. Defaults to true.
string[]
Additional host user IDs (the creator is always added).
object
Arbitrary key-value data. Up to 1 MB.
Returns — Promise<Event>

fetchEvent

Fetches a single event by ID. Pass actingUserId to resolve visibility for that user and to populate userRsvp (with the userRsvp include).
string
required
The event ID.
EventIncludeParam
Associations to expand, as a single value or an array: "user", "space", "files", "userRsvp".
string
The user to read as: exactly what their own access token would get (visibility, userRsvp). Omit it for the anonymous view: only a public event is returned, any other answers 404.
Returns — Promise<Event>

fetchManyEvents

Lists events with visibility enforced, plus filtering, sorting, geo, and free-text search. Pass actingUserId to resolve member/invite/host visibility and to use the myRsvp filter.
number
Page number (1-indexed). Defaults to 1.
number
Results per page. Capped at 100.
"startTime" | "going"
Sort field. Defaults to "startTime".
"asc" | "desc"
Sort direction. Left out, the sort’s natural direction: soonest first for "startTime", most going first for "going".
"upcoming" | "ongoing" | "past"
Derived time window.
string
ISO datetime lower bound on startTime.
string
ISO datetime upper bound on startTime.
string | "none"
Only this space’s events, or "none" for events not in any space. Left out: every event.
string
Only events this user hosts.
"online" | "physical" | "hybrid"
Filter by type.
"active" | "cancelled"
Defaults to "active".
RsvpStatus | RsvpStatus[]
Statuses the requester RSVP’d with: "going", "maybe" or "not-going", e.g. ["going", "maybe"]. Sent as one comma-separated value; values match exactly. Requires actingUserId.
{ latitude: string; longitude: string; radius: string }
Proximity filter (radius in meters).
{ hasTitle?; includes?; doesNotInclude? }
Free-text filter on title.
{ hasDescription?; includes?; doesNotInclude? }
Free-text filter on description.
EventIncludeParam
Associations to expand, as a single value or an array: "user", "space", "files", "userRsvp".
string
The user to list as: exactly what their own access token would get (visibility, myRsvp, userRsvp). Omit it for the anonymous view: public events only.
Returns — Promise<PaginatedResponse<Event>>

updateEvent

Edits an event’s mutable fields. Host-only: actingUserId must be one of the event’s hosts. hostIds, status, and spaceId are not editable here.
string
required
The event ID.
string
required
The user the call acts as, with exactly their powers on the event; the action is recorded as theirs.
string
New title.
string
New description.
string
New ISO start datetime.
string
New ISO end datetime.
string
New timezone.
"online" | "physical" | "hybrid"
New type (re-validates location fields).
string
New URL.
string
New venue name.
string
New address.
{ latitude: number; longitude: number }
New coordinates.
"public" | "members" | "invite"
New visibility.
number
New capacity.
boolean
Allow "maybe" RSVPs.
boolean
Expose the guest list.
object
New metadata.
Returns — Promise<Event>

cancelEvent

Cancels an event (sets status: "cancelled"). The event stays fetchable but rejects new RSVPs. actingUserId must be a host, or an active admin or moderator of the event’s space.
string
required
The event ID.
string
required
The user the call acts as, with exactly their powers on the event; the action is recorded as theirs.
Returns — Promise<Event>

deleteEvent

Permanently (or soft-, per the project’s eventDeletion settings) deletes an event and cleans up its RSVPs and invites. actingUserId must be a host, or an active admin or moderator of the event’s space.
string
required
The event ID.
string
required
The user the call acts as, with exactly their powers on the event; the action is recorded as theirs.
Returns — Promise<void>

setRsvp

Sets or changes a user’s RSVP. Transitions into going are capacity-checked.
string
required
The event ID.
"going" | "maybe" | "not-going"
required
The RSVP response.
string
required
The user the service key acts as, who RSVPs, held to their own event visibility (an event they can’t see returns 404).
Returns — Promise<Event> (with refreshed rsvpCounts)

withdrawRsvp

Removes a user’s RSVP. Idempotent. It sends DELETE /events/:eventId/rsvp with actingUserId in the query and no body.
string
required
The event ID.
string
required
The user the service key acts as, whose RSVP is withdrawn, held to their own event visibility.
Returns — Promise<Event>

addHost

Grants a user host privileges. The userId is the target host; actingUserId must be an existing host.
string
required
The event ID.
string
required
The user the call acts as, with exactly their powers on the event; the action is recorded as theirs.
string
required
The user to grant host on the event.
Returns — Promise<Event>

removeHost

Revokes a user’s host privileges. Rejected if it would leave the event with no hosts. It sends DELETE /events/:eventId/hosts/:userId: the host in the path, actingUserId in the query, no body.
string
required
The event ID.
string
required
The user the call acts as, with exactly their powers on the event; the action is recorded as theirs.
string
required
The host to remove.
Returns — Promise<Event>

addInvite

Invites a user to the event. Idempotent. The userId is the target invitee.
string
required
The event ID.
string
required
The user the call acts as, with exactly their powers on the event; the action is recorded as theirs.
string
required
The user to invite (userId only — never a foreign ID).
Returns — Promise<Event>

removeInvite

Removes a user’s invite, revoking their access and dropping their RSVP. It sends DELETE /events/:eventId/invites/:userId: the invitee in the path, actingUserId in the query, no body.
string
required
The event ID.
string
required
The user the call acts as, with exactly their powers on the event; the action is recorded as theirs.
string
required
The invitee to remove.
Returns — Promise<Event>

fetchInvitees

Host-only invitee (guest) list. Returns paginated EventInvite records with the invited user populated.
string
required
The event ID.
string
required
The user the call acts as, with exactly their powers on the event; the action is recorded as theirs.
number
Page number (1-indexed).
number
Results per page. Capped at 100.
Returns — Promise<PaginatedResponse<EventInvite>>

fetchEventRsvps

Named RSVP (guest) list. Returns paginated EventRsvp records with the user populated. Visible to hosts always, and to anyone who can see the event when guestListVisible is true; otherwise 403 event/guest-list-hidden. Pass actingUserId to read as that user. RSVP counts themselves are public via the event’s rsvpCounts.
string
required
The event ID.
RsvpStatus | RsvpStatus[]
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.
string
The user to read as: exactly what their own access token would get (event visibility, whether they host it). Omit it for the anonymous view.
number
Page number (1-indexed).
number
Results per page. Capped at 100.
Returns — Promise<PaginatedResponse<EventRsvp>>

Attaching images

Create the event, then upload a cover or gallery image and associate it with eventId:
Uploading via storage.uploadImage attaches a gallery image (a File with the event’s eventId). Setting it as the event’s single cover (coverImageId) is done by the inline-upload path, which the Node SDK does not yet expose.