Goatlab API Docs

Get spaces

GET
/v1/spaces

This endpoint retrieves a paginated list of spaces for a specific user within a tenant.

Access Control:

  • Users can only see spaces they own private spaces or public spaces within their tenant

Pagination:

  • Results are paginated with configurable page size (default: 10, max: 100)
  • Returns total count along with current page data

Sorting:

  • Can sort by creation date, update date, or name
  • Supports both ascending and descending order

Authorization

ApiTokenAuth PRODUCT
x-api-key<token>

API Key with role based permission

In: header

Scope: PRODUCT

Query Parameters

page?integer

Page number for pagination (starts at 1)

limit?integer

Number of items per page

sortBy?string

Field to sort by

sortOrder?string

Sort order (ascending or descending)

Header Parameters

x-user-id*string

The ID of the user retrieving spaces

x-tenant-id*string

The ID of the tenant

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/spaces" \  -H "x-user-id: string" \  -H "x-tenant-id: string"
{
  "data": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "Product Development",
      "description": "Space for tracking product development activities",
      "type": "PROJECT",
      "visibility": "PRIVATE",
      "ownerId": "user-123",
      "tenantId": "tenant-456",
      "fileCount": 1,
      "lastUpload": "2026-01-29T10:19:29.754Z",
      "createdAt": "2025-12-30T10:30:00.000Z",
      "updatedAt": "2025-12-30T10:30:00.000Z"
    },
    {
      "id": "660e8400-e29b-41d4-a716-446655440001",
      "name": "Marketing Campaign",
      "description": "Public space for marketing activities",
      "type": "PROJECT",
      "visibility": "PUBLIC",
      "ownerId": "user-789",
      "tenantId": "tenant-456",
      "fileCount": 0,
      "lastUpload": null,
      "createdAt": "2025-12-29T14:20:00.000Z",
      "updatedAt": "2025-12-29T14:20:00.000Z"
    }
  ],
  "limit": 10,
  "page": 1,
  "total": 2
}
{
  "message": "string"
}
{
  "message": "Invalid API Key"
}
{
  "message": "Internal Server Error"
}