---
type: api
title: Get all spaces
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v8/operation/operation-get-spaces-space
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v8/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/v8/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/kibana/v8/authentication#basicauth)

## 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` (union enum | boolean)
  When enabled, the API returns any spaces that the user is authorized to access in any capacity and each space will contain the purposes for which the user is authorized. This can be useful to determine which spaces a user can read but not take a specific action in. If the security plugin is not enabled, this parameter has no effect, since no authorization checks take place. This parameter cannot be used in with the `purpose` parameter.
  Values: `false`

## Response

Indicates a successful call.

## Code Examples

#### Console

```console
GET /api/spaces/space?include_authorized_purposes={include_authorized_purposes}
```

#### curl

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

## 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
    }
  }
]
```

