Skip to content

Add section about how to make API requests to default and specific spaces with Kibana APIs #3772

@florent-leborgne

Description

@florent-leborgne

In this page: https://www.elastic.co/docs/deploy-manage/manage-spaces, we should mention that calls to non-default spaces using the Kibana API require a /<space> path element to target the correct space. Not specifying this element directs the API call to the default space.

This is explained in this section: https://www.elastic.co/docs/api/doc/kibana/topic/topic-kibana-spaces of the API docs. But we also very often link to https://www.elastic.co/docs/deploy-manage/manage-spaces when talking about spaces in general, including in some API-related docs, while this information isn't present there. While it would duplicate what is already in the API docs, it will make the information available at a quite visible location too in the narrative docs, along with where most docs about spaces also exist.

This path element exists for both the Kibana API and the Kibana Serverless API.

Action

added by (@georgewallace )

  • Add a section to the the Spaces content for using the Kibana APIs with spaces

  • Give examples of both calls, with and without
    Default (no space)

    curl -u user:pass -H "kbn-xsrf: true" \
    "https://kibana.example.com/api/saved_objects/_find?type=dashboard"

    Specific space (i.e marketing)

    curl -u user:pass -H "kbn-xsrf: true" \
    "https://kibana.example.com/s/marketing/api/saved_objects/_find?type=dashboard"
  • Also call out that this is the same with serverless

  • Link back to the Kibana spaces page

  • (Optional) update the Kibana spaces page in the API docs to give better examples

In the API docs we state:

To run APIs in non-default spaces, you must add s/{space_id}/ to the path. For example:

curl -X GET "http://${KIBANA_URL}/s/marketing/api/data_views" \ -H "Authorization: ApiKey ${API_KEY}"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Team:AdminIssues owned by the Admin Docs Team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions