GoodMemGoodMem
ReferenceAPIREST APISpaces

List spaces

GET /v1/spaces: Retrieves a list of spaces accessible to the caller, with optional filtering by owner, labels, and name.

GET
/v1/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: 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.

Authorization

ApiKeyAuth
headerx-api-key<token>

Query Parameters

ownerId?string

Filter the already-authorized result set by owner principal UUID. Omitting this parameter does not bypass per-space READ_SPACE filtering.

nameFilter?string

Filter spaces by name using glob pattern matching

maxResults?integer

Maximum number of results to return in a single page (defaults to 50, clamped to [1, 1000])

Formatint32
Default50
nextToken?string

Pagination token for retrieving the next set of results

sortBy?string

Field to sort by: 'created_time', 'updated_time', or 'name' (default: 'created_time'). Unsupported values return INVALID_ARGUMENT.

Default"created_time"
Value in"created_time""updated_time""name"
sortOrder?string

Sort order (ASCENDING or DESCENDING, default: DESCENDING)

Default"DESCENDING"
Value in"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).

Example
{  "environment": "production",  "team": "nlp"}

Header Parameters

GoodMem-Timeout-Ms?integer

Optional 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.

Formatint64
Range1 <= value <= 86400000

Response Body

Successfully retrieved spaces

application/json
  1. 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.

Example"eyJzdGFydCI6MjAsIm93bmVySWQiOiJiMzMwM2QwYS0..."
Example Request
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'
Example Response
{  "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..."}