Get all Kibana spaces API

edit

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

Request

edit

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

Query parameters

edit
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 code

edit
200
Indicates a successful call.

Examples

edit

Default options

edit

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"],
    "imageUrl": "",
    "solution": "oblt"
  }
]

Custom options

edit

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