List spaces
GET /v1/spaces: Retrieves a list of spaces accessible to the caller, with optional filtering by owner, labels, and name.
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: Label filters accept either label.<key>=<value> or label[key]=value (for example, label.environment=production or label[environment]=production).
AUTHORIZATION: Requires LIST_SPACE on the GoodMem instance. Each returned space must also be visible through READ_SPACE; unauthorized spaces are filtered in PostgreSQL. The ownerId parameter filters that already-authorized result set and does not grant additional visibility.
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.
ApiKeyAuthx-api-key<token>ownerId?stringFilter the already-authorized result set by owner principal UUID. Omitting this parameter does not bypass per-space READ_SPACE filtering.
nameFilter?stringFilter spaces by name using glob pattern matching
maxResults?integerMaximum number of results to return in a single page (defaults to 50, clamped to [1, 1000])
int3250nextToken?stringPagination token for retrieving the next set of results
sortBy?stringField to sort by: 'created_time', 'updated_time', or 'name' (default: 'created_time'). Unsupported values return INVALID_ARGUMENT.
"created_time""created_time""updated_time""name"sortOrder?stringSort order (ASCENDING or DESCENDING, default: DESCENDING)
"DESCENDING""ASCENDING""DESCENDING""SORT_ORDER_UNSPECIFIED"label?Filter by label key-value pairs. Label filters accept either label.<key>=<value> or label[key]=value (for example, label.environment=production or label[environment]=production).
{ "environment": "production", "team": "nlp"}GoodMem-Timeout-Ms?integerOptional waiting budget in milliseconds, measured from REST servlet ingress and shared across all internal gRPC calls. Supply one decimal integer from 1 to 86400000. Omission adds no deadline. Existing shorter deadlines still apply. Expiry returns HTTP 504 before streaming starts; after streaming starts, no successful completion event is sent. Use SSE or opt into GoodMem-Stream-Terminal for an explicit terminal outcome. Retrieval work is cooperatively cancelled. An accepted mutation may still commit after timeout or disconnect; a failed response does not imply rollback.
int641 <= value <= 86400000Successfully retrieved spaces
application/json- response
Response containing a list of spaces and optional pagination token.
spaces*array<>The list of spaces matching the query criteria.
nextToken?|Pagination token for retrieving the next set of results. Only present if there are more results available.
"eyJzdGFydCI6MjAsIm93bmVySWQiOiJiMzMwM2QwYS0..."curl -X GET 'https://your-goodmem-server.example.com/v1/spaces?ownerId=550e8400-e29b-41d4-a716-446655440000&nameFilter=Research*&maxResults=20&nextToken=eyJzdGFydCI6MjAsIm93bmVySWQiOiJiMzMwM2QwYS0...&sortBy=name&sortOrder=ASCENDING' \ -H 'GoodMem-Timeout-Ms: 30000'{ "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", "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..."}