Get all Kibana spaces APIedit

[experimental] This functionality is experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features. Retrieve all Kibana spaces.

Requestedit

GET <kibana host>:<port>/api/spaces/space

Query parametersedit

purpose
(Optional, string) Valid options include any, copySavedObjectsIntoSpace, and shareSavedObjectsIntoSpace. This determines what authorization checks are applied to the API call. If purpose is not provided in the URL, the any purpose is used.
include_authorized_purposes

(Optional, boolean) When enabled, the API will return any spaces that the user is authorized to access in any capacity, and each space will contain the purpose(s) 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 will have no effect, as no authorization checks would take place.

This option cannot be used in conjunction with purpose.

Response codeedit

200
Indicates a successful call.

Examplesedit

Default optionsedit

Retrieve all spaces without specifying any options:

$ curl -X GET api/spaces/space

The API returns the following:

[
  {
    "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": "#aabbcc",
    "disabledFeatures": ["apm"],
    "initials": "MK",
    "imageUrl": "data:image/png;base64,iVBORw0KGgoAAAANSU"
  },
  {
    "id": "sales",
    "name": "Sales",
    "initials": "MK",
    "disabledFeatures": ["discover", "timelion"],
    "imageUrl": ""
  }
]

Custom optionsedit

The user has read-only access to the Sales space. Retrieve all spaces and specify options:

$ curl -X GET api/spaces/space?purpose=shareSavedObjectsIntoSpace&include_authorized_purposes=true

The API returns the following:

[
  {
    "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": "#aabbcc",
    "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", "timelion"],
    "imageUrl": "",
    "authorizedPurposes": {
      "any": true,
      "copySavedObjectsIntoSpace": false,
      "findSavedObjects": true,
      "shareSavedObjectsIntoSpace": false,
    }
  }
]