Create Object

edit

This functionality is beta. It’s on track to become a stable, permanent feature of Kibana. Caution should be exercised because it is possible a breaking change to these APIs will occur in a minor version, but we’ll avoid this wherever possible.

The create saved object API enables you to persist a Kibana saved object.

Note: You cannot access this endpoint via the Console in Kibana.

Request

edit

POST /api/saved_objects/<type>

POST /api/saved_objects/<type>/<id>

Path Parameters

edit
type (required)
(string) Valid options, include: visualization, dashboard, search, index-pattern, config, and timelion-sheet
id (optional)
(string) Enables specifying an ID to use, as opposed to one being randomly generated

Query Parameters

edit
overwrite (optional)
(boolean) If true, will overwrite the document with the same ID.

Request Body

edit
attributes (required)
(object) The data to persist
references (optional)
(array) An array of objects with name, id, and type properties that describe the other saved objects this object references. The name can be used in the attributes to refer to the other saved object, but never the id, which may be updated automatically in the future during migrations or import/export.

Examples

edit

The following example creates an index pattern object with a pattern of my-pattern-*.

POST api/saved_objects/index-pattern/my-pattern
{
  "attributes": {
    "title": "my-pattern-*"
  }
}

A successful call returns a response code of 200 and a response body containing a JSON structure similar to the following example:

{
  "id": "my-pattern", 
  "type": "index-pattern",
  "version": 1,
  "attributes": {
    "title": "my-pattern-*"
  }
}

If my-pattern was not specified in the path, a unique ID would have been generated.

Known issues

edit
  1. Attributes are not validated at creation time. This means you can pass arbitrary and ill-formed data into this API that can break Kibana. Make sure any data you send to this API is properly formed.