Skip to main content
Fetch Root Collection
Returns the root collection for the authenticated user. If no root collection exists yet, one is created automatically with the name "root".

Query Parameters

string
Service key only, and required with one: the user this request acts as. Their root collection is returned. A user token always acts as its own user and must not send it (400 collection/acting-user-not-allowed).

Response

Returns a Collection object with parentCollectionId: null and isRoot: true, with its entityCount.
This endpoint is the entry point for the collections system. Call it once on load to initialize the user’s collection tree. Sub-collections are fetched separately via the sub-collections endpoint.

Error Responses

A service key sent no actingUserId.
A user token 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: