GoodMem
ReferenceAPIREST APISpaces

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.

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.

GET
/v1/spaces
x-api-key<token>

In: header

Query Parameters

ownerId?string

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.

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
nextToken?string

Pagination token for retrieving the next set of results

sortBy?string

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

sortOrder?string

Sort order (ASCENDING or DESCENDING, default: DESCENDING)

label.*?string

Filter by label value. Multiple label filters can be specified (e.g., ?label.project=AI&label.team=NLP)

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&label.*=%3Flabel.project%3DAI%26label.team%3DNLP"
{
  "spaces": [
    {
      "spaceId": "550e8400-e29b-41d4-a716-446655440000",
      "name": "Research Project Space",
      "labels": "{\"project\": \"AI Research\", \"team\": \"NLP Group\"}",
      "spaceEmbedders": [
        {
          "spaceId": "550e8400-e29b-41d4-a716-446655440000",
          "embedderId": "550e8400-e29b-41d4-a716-446655440000",
          "defaultRetrievalWeight": "1.0",
          "createdAt": "1651483320000",
          "updatedAt": "1651483320000",
          "createdById": "550e8400-e29b-41d4-a716-446655440000",
          "updatedById": "550e8400-e29b-41d4-a716-446655440000"
        }
      ],
      "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": {
        "none": {},
        "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..."
}
Empty
Empty
Empty