Skip to main content
Fetch Many Events
Returns a paginated list of events. The server-side visibility predicate is always applied, to the rows and to totalItems alike: anonymous callers see only public events; authenticated callers additionally see members events of spaces they belong to, invite events they were invited to, the events they host while they are active members of the event’s space (a host who isn’t sees only what a regular viewer would), and, as an active admin or moderator of a space, every event in that space (invite events included). Events in a space the caller can’t read are left out, and so are events kept after the spaces bundle was uninstalled. A service key sees exactly what the user it names in actingUserId sees, and only what an anonymous caller sees when it names nobody. 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

number
Page number (1-indexed): a whole number, 1 or more. Defaults to 1. Any other value returns 400 event/invalid-query with param: "page".
number
Results per page: a whole number from 1 to 100. Defaults to 10. A larger value returns 400 event/invalid-query with param: "limit" (it is never lowered to 100), as does 0, a negative number or a value that isn’t a whole number. See Pagination.
string
"startTime" (chronological) or "going" (by going-RSVP count). Defaults to "startTime".
string
"asc" or "desc" (either case). Left out, the sort’s natural direction: soonest first for "startTime", most going first for "going".
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.
string
ISO datetime. Only events starting after this. ANDed with timeWindow.
string
ISO datetime. Only events starting before this.
string
Only this space’s events. none returns events not in any space. Left out, or sent empty, every event is returned. null and undefined are refused with 400 event/unsupported-param (see Saying “no value”).
string
Only events hosted by this user: events whose hostIds contain them, and events they own (userId). It filters by who hosts, not by what that user may do; visibility still applies to the caller.
string
Filter by "online", "physical", or "hybrid".
string
"active" or "cancelled". Defaults to "active".
string
Comma-separated RSVP statuses the caller responded with, e.g. "going,maybe": any of going, maybe and not-going, matched exactly (another case returns 400 event/invalid-query; not_going returns 400 event/unsupported-param). Requires an authenticated caller (or a service key sending actingUserId); otherwise returns 400.
object
Proximity filter { latitude, longitude, radius }. Uses ST_DWithin. radius is in meters: a number greater than 0 and at most 20000000 (20,000 km, about half the Earth’s circumference, which reaches any point). A value outside that range, or one that isn’t a finite number (Infinity, 1e999), returns 400 event/invalid-query.
object
Free-text filter on title: { hasTitle?, includes?, doesNotInclude? }. includes/doesNotInclude accept a string or array.
object
Free-text filter on description: { hasDescription?, includes?, doesNotInclude? }.
string
Associations to expand, as a comma-separated value (include=user,space) or repeated params. Values:
  • user — the creator’s user profile
  • space — the space the event belongs to
  • files — the event’s files: the cover, then its images and files in the order they were uploaded. Find the cover by coverImageId; one uploaded through v8 comes first
  • userRsvp — the caller’s own RSVP status (needs a viewer; otherwise null)
Matching ignores case. An unknown value returns 400 event/invalid-query.
string
Service key only: the user to list as. The page is exactly what that user’s own access token would get (visibility, userRsvp, the myRsvp filter). Leave it out for the anonymous view: public events in no space or in a space anyone can read. A user token always acts as its own user and must not send it, and neither may a request with no credentials (400 event/acting-user-not-allowed).

Response

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

Error Responses

A user token, or a request with no credentials, 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.
Returned when a service key names an actingUserId that isn’t a user in this project.
The request sent userId. On this route the user a service key acts as is actingUserId.With a service key:
With a user token, or with no credentials:
Also returned when a myRsvp entry is not_going. Not going is not-going:
spaceId=null or spaceId=undefined. The error names the spelling to use instead.
Returned when page or limit breaks the pagination rule, with param naming it:
Also returned for a myRsvp entry that isn’t exactly going, maybe or not-going:
And for an unknown include value:
And for a locationFilters.radius that isn’t a number greater than 0 and at most 20000000:
See also: useFetchManyEvents · useFetchManyEventsWrapper