Skip to main content
GET
/
:projectId
/
api
/
v7
/
events
Fetch Many Events
curl --request GET \
  --url https://api.sublay.io/api/v6/:projectId/api/v7/events
Returns a paginated list of events. The server-side visibility predicate is always applied: anonymous callers see only public events; authenticated callers additionally see members events of spaces they belong to, invite events they were invited to, and any event they host. Service/master keys see everything. Each event includes inline rsvpCounts, and—with the userRsvp include and an authenticated caller—the caller’s own userRsvp. Authentication is optional (optionalUserAuth). Several filters interact with the caller’s identity (myRsvp, userRsvp).

Query Parameters

page
number
Page number (1-indexed). Defaults to 1.
limit
number
Results per page. Capped at 100. Defaults to 10.
sortBy
string
"startTime" (chronological) or "going" (by going-RSVP count). Defaults to "startTime".
sortDir
string
"asc" or "desc". Defaults to "asc".
timeWindow
string
Derived time window: "upcoming" (startTime in the future), "ongoing" (started, has an endTime, not yet ended), or "past". Events without an endTime become past once they start.
startsAfter
string
ISO datetime. Only events starting after this. ANDed with timeWindow.
startsBefore
string
ISO datetime. Only events starting before this.
spaceId
string
Restrict to events scoped to this space. Omit for all scopes.
hostId
string
Only events hosted by this user (array containment on hostIds).
type
string
Filter by "online", "physical", or "hybrid".
status
string
"active" or "cancelled". Defaults to "active".
myRsvp
string
Comma-separated RSVP statuses the caller responded with, e.g. "going,maybe". Requires an authenticated caller (or a service/master key passing userId); otherwise returns 400.
locationFilters
object
Proximity filter { latitude, longitude, radius } (radius in meters). Uses ST_DWithin.
titleFilters
object
Free-text filter on title: { hasTitle?, includes?, doesNotInclude? }. includes/doesNotInclude accept a string or array.
descriptionFilters
object
Free-text filter on description: { hasDescription?, includes?, doesNotInclude? }.
include
string
Comma-separated associations to expand: "user", "space", "files", "userRsvp".
userId
string
The requester id. Used for the myRsvp filter, userRsvp enrichment, and visibility resolution. For non-privileged callers the server infers this from the auth token; service/master keys may pass it explicitly.

Response

Returns a paginated response: { data: Event[], pagination: { page, limit, totalItems, hasMore, ... } }. See Event.

Error Responses

{ "error": "The myRsvp filter requires an authenticated caller (or a service/master key acting via a userId query param).", "code": "event/my-rsvp-requires-auth" }
{ "error": "Limit must be a positive number", "code": "event/invalid-query" }
See also: useFetchManyEvents · useFetchManyEventsWrapper