Export all saved objects

I found a way in kibana UI-> management-> saved objects to export all objects at a time in export.ndjson file.
But I want to export all saved objects by a single query in kibana 7.6.2.
I tried to export all saved objects by API
POST http://localhost:5601/api/saved_objects/_export

But it is not working.

Someone kibana expert can help me.
Thanks in advance.

Hi,
Could you provide more information into what is not working? What error are you getting? Please note that this is a POST request and you'll need to includeContent-Type: application/json and kbn-xsrf: true headers. Here are some examples

Hi,
I am using postman and I also including Content-type and kbn-xsrf.

This is my my http request

POST /api/saved_objects/_export HTTP/1.1
Host: myhostname:5601
kbn-xsrf: true
Content-Type: application/json
Authorization: Basic ZWxhc3RpYzpvSHlOR2h5Und5M3VGZ2paN0wweA==
Cache-Control: no-cache
Postman-Token: c6148e7c-3006-45e5-525c-b739e6c167fa

And it is giving erorr

{
    "statusCode": 400,
    "error": "Bad Request",
    "message": "\"value\" must be an object",
    "validation": {
        "source": "payload",
        "keys": [
            "value"
        ]
    }
}

And what error are you getting?

The body needs to contain either objects or type. Try adding "type": "index-pattern" in your request body.

I used this

POST /api/saved_objects/_export HTTP/1.1
Host: myhostname:5601
kbn-xsrf: true
Content-Type: application/json
Authorization: Basic ZWxhc3RpYzpvSHlOR2h5Und5M3VGZ2paN0wweA==
Cache-Control: no-cache
Postman-Token: ab89a447-80b1-f563-3d28-ba8896e9ae90

{
	"type":"index-pattern"
}

but now it is giving

Syntax error

The request seems fine to me. Could you try cURL and check if you're getting the same error?

one more question.
How to include "include related objects" option in api

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.