List spaces
Retrieves a list of spaces accessible to the caller, with optional filtering by owner, labels, and name. Results are paginated with a maximum number of spaces per response.
LABEL FILTERS: Supply dynamic query parameters in the form label.<key>=<value> (for example, label.project=AI).
PERMISSION-BASED FILTERING: With LIST_SPACE_ANY and ownerId omitted, returns all visible spaces; otherwise returns caller-owned spaces only.
DEFAULT SORT: Results ordered by created_at DESCENDING unless specified otherwise. MAX_RESULTS
CLAMPING: maxResults defaults to 50 and is clamped to [1, 1000] range. Requires LIST_SPACE_OWN or LIST_SPACE_ANY permission.
In: header
Query Parameters
Filter spaces by owner ID. With LIST_SPACE_ANY permission and ownerId omitted, returns all visible spaces. Otherwise returns caller-owned spaces only. Specifying ownerId without LIST_SPACE_ANY returns PERMISSION_DENIED.
Filter spaces by name using glob pattern matching
Maximum number of results to return in a single page (defaults to 50, clamped to [1, 1000])
50int32Pagination token for retrieving the next set of results
Field to sort by: 'created_time', 'updated_time', or 'name' (default: 'created_time'). Unsupported values return INVALID_ARGUMENT.
"created_time""created_time" | "updated_time" | "name"Sort order (ASCENDING or DESCENDING, default: DESCENDING)
"DESCENDING""ASCENDING" | "DESCENDING" | "SORT_ORDER_UNSPECIFIED"Response Body
curl -X GET "http://localhost:8080/v1/spaces?ownerId=550e8400-e29b-41d4-a716-446655440000&nameFilter=Research*&maxResults=20&nextToken=eyJzdGFydCI6MjAsIm93bmVySWQiOiJiMzMwM2QwYS0...&sortBy=name&sortOrder=ASCENDING"{
"spaces": [
{
"spaceId": "550e8400-e29b-41d4-a716-446655440000",
"name": "Research Project Space",
"createdAt": 1651483320000,
"updatedAt": 1651483320000,
"ownerId": "550e8400-e29b-41d4-a716-446655440000",
"createdById": "550e8400-e29b-41d4-a716-446655440000",
"updatedById": "550e8400-e29b-41d4-a716-446655440000",
"publicRead": false,
"defaultChunkingConfig": {
"recursive": {
"chunkSize": 1000,
"chunkOverlap": 200,
"separators": [
"\n\n",
"\n",
".",
" "
],
"keepStrategy": "KEEP_END",
"separatorIsRegex": false,
"lengthMeasurement": "CHARACTER_COUNT"
},
"sentence": {
"maxChunkSize": 1000,
"minChunkSize": 100,
"enableLanguageDetection": true,
"lengthMeasurement": "CHARACTER_COUNT"
}
}
}
],
"nextToken": "eyJzdGFydCI6MjAsIm93bmVySWQiOiJiMzMwM2QwYS0..."
}