---
type: api
title: Get all spaces
description: Retrieve all available Kibana spaces. The list includes only the spaces that the user is authorized to access.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana-serverless/operation/operation-get-spaces-space
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana-serverless/operation/operation-get-spaces-space
products:
  - Kibana
---

# Get all spaces

- Server: `https://{kibana_url}`

## Paths

- `GET` `/api/spaces/space`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/kibana-serverless/authentication#apikeyauth)

## Description

Retrieve all available Kibana spaces. The list includes only the spaces that the user is authorized to access.

## Query String Parameters

- `purpose` (enum)
  Specifies which authorization checks are applied to the API call. The default value is `any`.
  Values: `any`, `copySavedObjectsIntoSpace`, `shareSavedObjectsIntoSpace`
- `include_authorized_purposes` (boolean)
  When enabled, the API returns any spaces the user is authorized to access in any capacity, each including the purposes for which the user is authorized. This is useful for identifying spaces the user can read but is not authorized for a given purpose. Without the security plugin, this parameter has no effect, because no authorization checks are performed. This parameter cannot be used together with the `purpose` parameter.

## Response

Indicates a successful call.

## Code Examples

#### Console

```console
GET /api/spaces/space
```

#### curl

```curl
curl -X GET "https://{kibana_url}/api/spaces/space"
```

## Response Examples

#### Get all spaces

Get all spaces without specifying any options.

```json
[
  {
    "id": "default",
    "name": "Default",
    "description": "This is the Default Space",
    "disabledFeatures": [],
    "imageUrl": "",
    "_reserved": true
  },
  {
    "id": "marketing",
    "name": "Marketing",
    "description": "This is the Marketing Space",
    "color": "null",
    "disabledFeatures": [
      "apm"
    ],
    "initials": "MK",
    "imageUrl": "data:image/png;base64,iVBORw0KGgoAAAANSU"
  },
  {
    "id": "sales",
    "name": "Sales",
    "initials": "MK",
    "disabledFeatures": [
      "discover"
    ],
    "imageUr\u0022": "",
    "solution": "oblt"
  }
]
```

#### Get all spaces with custom options

The user has read-only access to the Sales space. Get all spaces with the following query parameters: "purpose=shareSavedObjectsIntoSpace&include_authorized_purposes=true"

```json
[
  {
    "id": "default",
    "name": "Default",
    "description": "This is the Default Space",
    "disabledFeatures": [],
    "imageUrl": "",
    "_reserved": true,
    "authorizedPurposes": {
      "any": true,
      "copySavedObjectsIntoSpace": true,
      "findSavedObjects": true,
      "shareSavedObjectsIntoSpace": true
    }
  },
  {
    "id": "marketing",
    "name": "Marketing",
    "description": "This is the Marketing Space",
    "color": "null",
    "disabledFeatures": [
      "apm"
    ],
    "initials": "MK",
    "imageUrl": "data:image/png;base64,iVBORw0KGgoAAAANSU",
    "authorizedPurposes": {
      "any": true,
      "copySavedObjectsIntoSpace": true,
      "findSavedObjects": true,
      "shareSavedObjectsIntoSpace": true
    }
  },
  {
    "id": "sales",
    "name": "Sales",
    "initials": "MK",
    "disabledFeatures": [
      "discover"
    ],
    "imageUrl": "",
    "authorizedPurposes": {
      "any": true,
      "copySavedObjectsIntoSpace": false,
      "findSavedObjects": true,
      "shareSavedObjectsIntoSpace": false
    }
  }
]
```

