﻿---
title: stack kb spaces get-spaces-space cli command
description: Get all spaces Behaviour flags: --dry-run — validate all inputs and exit without performing any action 
url: https://www.elastic.co/elastic/docs-builder/docs/4118/reference/elastic-cli/cli/stack/kb/spaces/get-spaces-space
applies_to:
  - Elastic Cloud Serverless: Preview
  - Elastic Stack: Preview
---

# stack kb spaces get-spaces-space cli command
<cli-modifiers>
</cli-modifiers>

```bash
elastic stack kb spaces get-spaces-space [options]
```

Get all spaces
**Behaviour flags:**
`--dry-run` — validate all inputs and exit without performing any action

## Options

<definitions>
  <definition term="--purpose enum">
    Specifies which authorization checks are applied to the API call. The default value is `any`.
    **Values:** any, copySavedObjectsIntoSpace, shareSavedObjectsIntoSpace
  </definition>
  <definition term="--include-authorized-purposes">
    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.
  </definition>
  <definition term="--input-file string">
    path to a JSON file to use as command input
  </definition>
  <definition term="--dry-run">
    validate all inputs and exit without performing any action (preview changes without applying them)
  </definition>
</definitions>


## Global Options

<definitions>
  <definition term="--json">
    output as JSON
  </definition>
</definitions>