Skip to main content
GET
/
:projectId
/
api
/
v7
/
spaces
/
mutual
/
:userId
Fetch Mutual Spaces
curl --request GET \
  --url https://api.sublay.io/api/v6/:projectId/api/v7/spaces/mutual/:userId
{
  "data": [
    {}
  ],
  "pagination": {}
}
Returns a paginated list of spaces that both the authenticated user and another user are active members of — i.e. their spaces in common. Requires an authenticated user.

Path Parameters

userId
string
required
The other user’s Sublay ID. Mutual spaces are computed between this user and the authenticated user.

Query Parameters

actingUserId
string
The authenticated user to act as. Only accepted with a service or master key — a user token always acts as itself and may not name a different user. Ignored (the token’s user is used) for end-user requests.
page
number
Page number. Defaults to 1.
limit
number
Results per page. Max 100. Defaults to 20.
include
string
Optional comma-separated includes. Pass "files" to include avatar and banner file objects on each space.

Response

data
Space[]
The spaces both users are active members of. Computed fields such as membersCount and isMember are populated from the authenticated user’s perspective.
pagination
object
Standard pagination metadata (page, pageSize, totalPages, totalItems, hasMore).
See also: useFetchMutualSpaces