# Space

A *Space* is the workspace that holds all the content of a single project. The *Content Type* that defines content structure, the actual data as *Content*, *Media* such as images and files, and the language settings as *Locale* all live inside one *Space*. A *Space* belongs under its parent container, an *Organization*, and you usually keep one *Space* per service.

You read the list of *Space*s you belong to with [GET /me/space-memberships](/api/reference/cma/space-membership.md).

## Resource structure {#resource-structure}

The following is the single-read response for the *Space* "DailyWear Store". It has `sys` (system properties) and the body property `name`.

```json
{
  "sys": {
    "id": "tcq4V2Xb",
    "type": "Space",
    "organization": { "sys": { "id": "ilLRJxDp", "type": "Refer", "targetType": "Organization" } },
    "createdBy": { "sys": { "id": "3p4tcFbQRwz503VXdtHXNI5dZH5TVB", "type": "Refer", "targetType": "User" } },
    "createdAt": "2026-06-14T14:56:04.737Z",
    "updatedBy": { "sys": { "id": "3p4tcFbQRwz503VXdtHXNI5dZH5TVB", "type": "Refer", "targetType": "User" } },
    "updatedAt": "2026-06-14T14:56:58.670Z",
    "version": 2
  },
  "name": "DailyWear Store"
}
```

Key properties:

- `name`: The name of the *Space* (1-64 characters). It is the display name of the project or service.
- `organization`: A `Refer<Organization>` that points to the parent *Organization* this *Space* belongs to.

The subscription plan is tied to the parent *Organization*, not to the *Space*. To check or change the plan, see [Organization](/api/reference/cma/organization.md).

## System properties (sys) and body {#system-properties-sys-and-body}

Every *Space* carries common system properties in the `sys` object. `organization` is a `Refer<Organization>`, and `createdBy` and `updatedBy` are in the `Refer` shape (`{ "sys": { "id", "type": "Refer", "targetType" } }`).

| Property | Type | Description |
|---|---|---|
| `id` | string | Unique resource identifier. |
| `type` | string | Resource kind. For a *Space* this is always `"Space"`. |
| `organization` | Refer&lt;Organization&gt; | The parent *Organization* this *Space* belongs to. |
| `createdBy` | Refer&lt;User&gt; | The user who created it. |
| `createdAt` | string (date-time) | Creation time. |
| `updatedBy` | Refer&lt;User&gt; | The user who last updated it. |
| `updatedAt` | string (date-time) | Last update time. |
| `version` | integer (≥1) | Resource version. It increases by 1 with every change. |

Body properties:

| Property | Type | Description |
|---|---|---|
| `name` | string (1-64) | The *Space* name. Specified on create and update. |
| `description` | string (1-128) | The *Space* description. Optional. |
| `icon` | string (read) / object (write) | The *Space* icon. In responses it is an image URL string. In update requests you send it as an object that points to an uploaded file: `{ "upload": { "sys": { ..., "targetType": "Upload" } } }` (a reference to an *Upload* obtained from the [Upload API](/api/reference/upload-api.md)). |

A *Space* is a settings resource with no publishing concept. So unlike *Content* and *Media*, its `sys` has no `publish`, `archive`, or `status`, only `version`. The `version` increases each time you update the *Space*.

The setting that replaces a *Space*'s home screen with another page does not live on this resource. It lives on the parent *Organization*: set [Organization](/api/reference/cma/organization.md)'s `consoleHomeUrl`, and the home screen of every *Space* under it shows that page instead.

## Errors {#errors}

These are the codes you meet when working with a *Space*. For codes that are common to every resource, see [common errors](/api/reference/common/errors.md).

| Code | Condition |
|---|---|
| `WGL422024` | The caller tried to delete a *Space* that still had at least one *Content Type*, *Content*, *Media*, or *Web Hosting* inside it. That *Space* can be deleted only after everything left in it has been deleted. |
| `WGL422046` | The file uploaded as the `icon` exceeds the allowed size. |
| `WGL422047` | The file uploaded as the `icon` is not a PNG, JPG, or WebP. |

## API {#api}

The base URL for all endpoints below is `https://cma.weegloo.com/v1`, and a Bearer token that authenticates against CMA is required in the `Authorization` header. Update and partial update must also send the `X-Weegloo-Version` header (the current resource's `sys.version`) for optimistic concurrency control. Create and delete do not have this header. List, create, update, partial update, and delete live under the parent *Organization* path (`/organizations/{organizationId}/spaces`). The single read can use the direct `/spaces/{spaceId}` path as shown below (the single read is also available on the parent *Organization* path `/organizations/{organizationId}/spaces/{spaceId}`).

```api-endpoint
{
  "title": "List Spaces",
  "method": "GET",
  "path": "/organizations/{organizationId}/spaces",
  "description": "Lists the Spaces that belong to one Organization.",
  "responseStatus": 200,
  "baseUrl": "https://cma.weegloo.com/v1",
  "pathParameterSchema": {
    "organizationId": { "type": "string", "description": "The sys.id of the Organization", "required": true }
  },
  "queryParameterSchema": {
    "limit": { "type": "integer", "description": "Number of items to return at once (1-100)", "default": 15 },
    "skip": { "type": "integer", "description": "Number of items to skip" },
    "next": { "type": "string", "description": "Next-page cursor (extracted from links.next)" },
    "prev": { "type": "string", "description": "Previous-page cursor (extracted from links.prev)" },
    "order": { "type": "string", "description": "Sort order. Example: -sys.createdAt,sys.id" },
    "include": { "type": "integer", "description": "Related-resource inclusion level. 0=default, 1=related resources, 2=nested relations, 3=full", "default": 0 },
    "select": { "type": "string", "description": "Fields to include/exclude. Example: sys.id,name" },
    "filter": { "type": "string", "description": "Filter condition. In the form {field}[{operator}]=value. Example: name[prefix]=DailyWear" }
  },
  "additionalQueryParams": true,
  "requestHeaderSchema": {
    "Authorization": { "type": "string", "description": "Bearer token (CMA authentication)" }
  },
  "responseExample": {
    "sys": { "type": "TotalPageResponse" },
    "limit": 15,
    "totalCount": 1,
    "items": [
      {
        "sys": {
          "id": "tcq4V2Xb",
          "type": "Space",
          "organization": { "sys": { "id": "ilLRJxDp", "type": "Refer", "targetType": "Organization" } },
          "createdBy": { "sys": { "id": "3p4tcFbQRwz503VXdtHXNI5dZH5TVB", "type": "Refer", "targetType": "User" } },
          "createdAt": "2026-06-14T14:56:04.737Z",
          "updatedBy": { "sys": { "id": "3p4tcFbQRwz503VXdtHXNI5dZH5TVB", "type": "Refer", "targetType": "User" } },
          "updatedAt": "2026-06-14T14:56:58.670Z",
          "version": 2
        },
        "name": "DailyWear Store"
      }
    ],
    "links": { "self": "/v1/organizations/ilLRJxDp/spaces" }
  }
}
```

```api-endpoint
{
  "title": "Read a single Space",
  "method": "GET",
  "path": "/spaces/{spaceId}",
  "description": "Reads one Space by sys.id. Besides this direct path, you can also read it through the parent Organization path (/organizations/{organizationId}/spaces/{spaceId}).",
  "responseStatus": 200,
  "baseUrl": "https://cma.weegloo.com/v1",
  "pathParameterSchema": {
    "spaceId": { "type": "string", "description": "The sys.id of the Space", "required": true }
  },
  "queryParameterSchema": {
    "include": { "type": "integer", "description": "Related-resource inclusion level. 0=default, 1=related resources, 2=nested relations, 3=full", "default": 0 }
  },
  "requestHeaderSchema": {
    "Authorization": { "type": "string", "description": "Bearer token (CMA authentication)" }
  },
  "responseExample": {
    "sys": {
      "id": "tcq4V2Xb",
      "type": "Space",
      "organization": { "sys": { "id": "ilLRJxDp", "type": "Refer", "targetType": "Organization" } },
      "createdBy": { "sys": { "id": "3p4tcFbQRwz503VXdtHXNI5dZH5TVB", "type": "Refer", "targetType": "User" } },
      "createdAt": "2026-06-14T14:56:04.737Z",
      "updatedBy": { "sys": { "id": "3p4tcFbQRwz503VXdtHXNI5dZH5TVB", "type": "Refer", "targetType": "User" } },
      "updatedAt": "2026-06-14T14:56:58.670Z",
      "version": 2
    },
    "name": "DailyWear Store"
  }
}
```

```api-endpoint
{
  "title": "Create Space",
  "method": "POST",
  "path": "/organizations/{organizationId}/spaces",
  "description": "Creates a new Space under an Organization. The body holds name, the optional description, and locale, the code of the new Space's initial default Locale. Each plan has a limit on how many Spaces you can create, and exceeding the limit responds with an error.",
  "responseStatus": 201,
  "baseUrl": "https://cma.weegloo.com/v1",
  "pathParameterSchema": {
    "organizationId": { "type": "string", "description": "The sys.id of the Organization", "required": true }
  },
  "requestHeaderSchema": {
    "Authorization": { "type": "string", "description": "Bearer token (CMA authentication)" }
  },
  "requestBodySchema": {
    "type": "object",
    "required": ["name"],
    "properties": {
      "name": { "type": "string", "minLength": 1, "maxLength": 64, "description": "The Space name (1-64 characters)" },
      "description": { "type": "string", "minLength": 1, "maxLength": 128, "description": "The Space description (1-128 characters, optional)" },
      "locale": { "type": "string", "description": "The code of the new Space's initial default Locale (optional, default en-US)", "default": "en-US" }
    },
    "example": {
      "name": "DailyWear Store",
      "description": "Online store selling clothing and accessories",
      "locale": "en-US"
    }
  },
  "responseExample": {
    "sys": {
      "id": "3trmXRM3RqbgSnifyg7PVspc01Ex",
      "type": "Space",
      "organization": { "sys": { "id": "ilLRJxDp", "type": "Refer", "targetType": "Organization" } },
      "createdBy": { "sys": { "id": "3p4tcFbQRwz503VXdtHXNI5dZH5TVB", "type": "Refer", "targetType": "User" } },
      "createdAt": "2026-06-18T11:10:00.000Z",
      "updatedBy": { "sys": { "id": "3p4tcFbQRwz503VXdtHXNI5dZH5TVB", "type": "Refer", "targetType": "User" } },
      "updatedAt": "2026-06-18T11:10:00.000Z",
      "version": 1
    },
    "name": "DailyWear Store",
    "description": "Online store selling clothing and accessories"
  }
}
```

```api-endpoint
{
  "title": "Update Space",
  "method": "PUT",
  "path": "/organizations/{organizationId}/spaces/{spaceId}",
  "description": "Updates the Space's name, description, and icon. You must carry the current sys.version in the X-Weegloo-Version header.",
  "responseStatus": 200,
  "baseUrl": "https://cma.weegloo.com/v1",
  "pathParameterSchema": {
    "organizationId": { "type": "string", "description": "The sys.id of the Organization", "required": true },
    "spaceId": { "type": "string", "description": "The sys.id of the Space", "required": true }
  },
  "requestHeaderSchema": {
    "Authorization": { "type": "string", "description": "Bearer token (CMA authentication)" },
    "X-Weegloo-Version": { "type": "integer", "description": "The current resource's sys.version (optimistic concurrency control)" }
  },
  "requestBodySchema": {
    "type": "object",
    "required": ["name"],
    "properties": {
      "name": { "type": "string", "minLength": 1, "maxLength": 64, "description": "The Space name (1-64 characters)" },
      "description": { "type": "string", "minLength": 1, "maxLength": 128, "description": "The Space description (1-128 characters)" },
      "icon": { "type": "object", "description": "The Space icon. A reference to an uploaded file's Upload", "properties": { "upload": { "type": "object", "description": "A Refer to an Upload obtained from the Upload API", "properties": { "sys": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" }, "targetType": { "type": "string" } } } } } } }
    },
    "example": {
      "name": "DailyWear Store",
      "description": "Online store selling clothing, accessories, and footwear"
    }
  },
  "responseExample": {
    "sys": {
      "id": "tcq4V2Xb",
      "type": "Space",
      "organization": { "sys": { "id": "ilLRJxDp", "type": "Refer", "targetType": "Organization" } },
      "createdBy": { "sys": { "id": "3p4tcFbQRwz503VXdtHXNI5dZH5TVB", "type": "Refer", "targetType": "User" } },
      "createdAt": "2026-06-14T14:56:04.737Z",
      "updatedBy": { "sys": { "id": "3p4tcFbQRwz503VXdtHXNI5dZH5TVB", "type": "Refer", "targetType": "User" } },
      "updatedAt": "2026-06-18T11:11:00.000Z",
      "version": 3
    },
    "name": "DailyWear Store",
    "description": "Online store selling clothing, accessories, and footwear"
  }
}
```

```api-endpoint
{
  "title": "Partially update Space (JSON Patch)",
  "method": "PATCH",
  "path": "/organizations/{organizationId}/spaces/{spaceId}",
  "description": "Updates only part of a Space using RFC 6902 JSON Patch. The request Content-Type header must be application/json-patch+json. You must carry the current sys.version in the X-Weegloo-Version header.",
  "responseStatus": 200,
  "baseUrl": "https://cma.weegloo.com/v1",
  "requestContentType": "application/json-patch+json",
  "pathParameterSchema": {
    "organizationId": { "type": "string", "description": "The sys.id of the Organization", "required": true },
    "spaceId": { "type": "string", "description": "The sys.id of the Space", "required": true }
  },
  "requestHeaderSchema": {
    "Authorization": { "type": "string", "description": "Bearer token (CMA authentication)" },
    "Content-Type": { "type": "string", "description": "application/json-patch+json (RFC 6902 JSON Patch)" },
    "X-Weegloo-Version": { "type": "integer", "description": "The current resource's sys.version (optimistic concurrency control)" }
  },
  "requestBodySchema": {
    "type": "array",
    "description": "An array of RFC 6902 JSON Patch operations (op / path / value / from). path is an RFC 6901 JSON Pointer.",
    "items": {
      "type": "object",
      "required": ["op", "path"],
      "properties": {
        "op": { "type": "string", "enum": ["add", "remove", "replace", "move", "copy", "test"], "description": "Operation kind" },
        "path": { "type": "string", "description": "Target location (JSON Pointer). Example: /name" },
        "value": { "description": "The value used by add/replace/test" },
        "from": { "type": "string", "description": "The source location for move/copy" }
      }
    },
    "example": [
      { "op": "replace", "path": "/name", "value": "DailyWear Shop" }
    ]
  },
  "responseExample": {
    "sys": {
      "id": "tcq4V2Xb",
      "type": "Space",
      "organization": { "sys": { "id": "ilLRJxDp", "type": "Refer", "targetType": "Organization" } },
      "createdBy": { "sys": { "id": "3p4tcFbQRwz503VXdtHXNI5dZH5TVB", "type": "Refer", "targetType": "User" } },
      "createdAt": "2026-06-14T14:56:04.737Z",
      "updatedBy": { "sys": { "id": "3p4tcFbQRwz503VXdtHXNI5dZH5TVB", "type": "Refer", "targetType": "User" } },
      "updatedAt": "2026-06-18T11:12:00.000Z",
      "version": 4
    },
    "name": "DailyWear Shop"
  }
}
```

```api-endpoint
{
  "title": "Delete Space",
  "method": "DELETE",
  "path": "/organizations/{organizationId}/spaces/{spaceId}",
  "description": "Deletes a Space. On success it responds with 204 No Content and no response body.",
  "responseStatus": 204,
  "baseUrl": "https://cma.weegloo.com/v1",
  "pathParameterSchema": {
    "organizationId": { "type": "string", "description": "The sys.id of the Organization", "required": true },
    "spaceId": { "type": "string", "description": "The sys.id of the Space", "required": true }
  },
  "requestHeaderSchema": {
    "Authorization": { "type": "string", "description": "Bearer token (CMA authentication)" }
  }
}
```

## Related documents {#related-documents}

- [Organization](/api/reference/cma/organization.md): The parent *Organization* this *Space* belongs to.
- [Space Membership](/api/reference/cma/space-membership.md): *Space* members and reading the *Space*s you belong to.
- [Locale](/api/reference/cma/locale.md): The language settings of a *Space*.
