Skip to main content
Fetch Space by Slug
Fetches a space using its slug. Slugs are optional and unique per project. A space the viewer can’t see — a private space they aren’t an active member of, or a space under one — answers 404 space/not-found, exactly like one that doesn’t exist. parentSpace is null when the viewer can’t see the parent, childSpaces lists the direct sub-spaces the viewer can see that are public or that the viewer is an active member of, and childSpacesCount counts exactly those. See Space visibility.

Query Parameters

string
Service key only: the user to read as. The response is exactly what that user’s own access token would get (their role, memberPermissions and membership). Leave it out for the anonymous view. A user token always acts as its own user and must not send it, and neither may a request with no credentials (400 space/acting-user-not-allowed).
string
required
The URL slug of the space.
string
Associations to include, as a comma-separated value or repeated params. The only value is:
  • files — the processed avatarFile and bannerFile objects (requires the files-images bundle)
Matching ignores case. An unknown value returns 400 space/invalid-query.

Response

Returns a SpaceDetailed object.

Error Responses

The space doesn’t exist, or the viewer can’t see it.
Returned with code space/invalid-query for an unknown include value.
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.
See also: useFetchSpaceBySlug