Get all spaces

GET /api/spaces/space

Headers

  • The version of the API to use

    Value is 2023-10-31. Default value is 2023-10-31.

Query parameters

  • purpose string

    Specifies which authorization checks are applied to the API call. The default value is any.

    Values are any, copySavedObjectsIntoSpace, or shareSavedObjectsIntoSpace.

  • include_authorized_purposes array | boolean | number | object | string Required

    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.

Responses

  • 200 application/json; Elastic-Api-Version=2023-10-31

    Indicates a successful call.

GET /api/spaces/space
curl \
 -X GET https://localhost:5601/api/spaces/space? \
 -H "elastic-api-version: 2023-10-31"
Response examples (200)
Get all spaces without specifying any options.
[
  {
    "id": "default",
    "name": "Default",
    "imageUrl": "",
    "_reserved": true,
    "description": "This is the Default Space",
    "disabledFeatures": []
  },
  {
    "id": "marketing",
    "name": "Marketing",
    "color": null,
    "imageUrl": "data:image/png;base64,iVBORw0KGgoAAAANSU",
    "initials": "MK",
    "description": "This is the Marketing Space",
    "disabledFeatures": [
      "apm"
    ]
  },
  {
    "id": "sales",
    "name": "Sales",
    "imageUr\"": "",
    "initials": "MK",
    "solution": "oblt",
    "disabledFeatures": [
      "discover"
    ]
  }
]
The user has read-only access to the Sales space. Get all spaces with the following query parameters: "purpose=shareSavedObjectsIntoSpace&include_authorized_purposes=true"
[
  {
    "id": "default",
    "name": "Default",
    "imageUrl": "",
    "_reserved": true,
    "description": "This is the Default Space",
    "disabledFeatures": [],
    "authorizedPurposes": {
      "any": true,
      "findSavedObjects": true,
      "copySavedObjectsIntoSpace": true,
      "shareSavedObjectsIntoSpace": true
    }
  },
  {
    "id": "marketing",
    "name": "Marketing",
    "color": null,
    "imageUrl": "data:image/png;base64,iVBORw0KGgoAAAANSU",
    "initials": "MK",
    "description": "This is the Marketing Space",
    "disabledFeatures": [
      "apm"
    ],
    "authorizedPurposes": {
      "any": true,
      "findSavedObjects": true,
      "copySavedObjectsIntoSpace": true,
      "shareSavedObjectsIntoSpace": true
    }
  },
  {
    "id": "sales",
    "name": "Sales",
    "imageUrl": "",
    "initials": "MK",
    "disabledFeatures": [
      "discover"
    ],
    "authorizedPurposes": {
      "any": true,
      "findSavedObjects": true,
      "copySavedObjectsIntoSpace": false,
      "shareSavedObjectsIntoSpace": false
    }
  }
]