# How to import and export Canvas workpads via rest call,curl or any other way?

**URL:** <https://discuss.elastic.co/t/how-to-import-and-export-canvas-workpads-via-rest-call-curl-or-any-other-way/182981>\
**Category:** Kibana\
**Tags:** canvas\
**Created:** [May 28, 2019, 4:52am UTC](https://discuss.elastic.co/t/how-to-import-and-export-canvas-workpads-via-rest-call-curl-or-any-other-way/182981 "2019-05-28T04:52:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gnanendra](https://avatars.discourse-cdn.com/v4/letter/g/65b543/32.png) [@Gnanendra](https://discuss.elastic.co/u/Gnanendra)\
**Post date:** [May 28, 2019, 4:52am UTC](https://discuss.elastic.co/t/how-to-import-and-export-canvas-workpads-via-rest-call-curl-or-any-other-way/182981/1 "2019-05-28T04:52:44Z")

</div>

Hi,

How to Import and export Canvas workpads via rest call,curl or any other way.

Please help me.

Thanks,  
gnanendracurl.

---

<div class="post-metadata">

**Author:** ![Andre\_Letterer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andre_letterer/32/42248_2.png) [@Andre\_Letterer](https://discuss.elastic.co/u/Andre_Letterer)\
**Post date:** [May 29, 2019, 1:06am UTC](https://discuss.elastic.co/t/how-to-import-and-export-canvas-workpads-via-rest-call-curl-or-any-other-way/182981/2 "2019-05-29T01:06:05Z")

</div>

Yes, you can do that.  
You can list all workpads by using this request

```auto
GET kibanahost:kibanaport/api/canvas/workpad/find?name=

```

In the resulting JSON file there will be fields called `id`.  
And now you can export a workpad like that:

```auto
GET kibanahost:kibanaport/api/canvas/workpad/<id-you-want-export>

```

the id normally has a name scheme like `workpad-<uuid>`  
Import a workpad you have two possibilities.  
You just can open the drag and drop icon in kibana and after words you just can drag and drop to Canvas.

Second possibility if you want to import by API. For doing this you will have to do a step in advance. You need to open the JSON file and just remove the whole string like `"id": "workpad-<uuid>",` and then you can import the JSON file:

```auto
POST kibanahost:kibanaport/api/canvas/workpad @<json file>
or
POST kibanahost:kibanaport/api/canvas/workpad
{
  content of json
}

```

You can do the same in case you just want to update a workpad, remove the id field again:

```auto
PUT kibanahost:kibanaport/api/canvas/workpad/<id-of-workpad>
{
  content of json
}

```

For importing and exporting all workpads at once, I didn't find an API possibility.

---

<div class="post-metadata">

**Author:** ![Gnanendra](https://avatars.discourse-cdn.com/v4/letter/g/65b543/32.png) [@Gnanendra](https://discuss.elastic.co/u/Gnanendra)\
**Post date:** [May 29, 2019, 6:52am UTC](https://discuss.elastic.co/t/how-to-import-and-export-canvas-workpads-via-rest-call-curl-or-any-other-way/182981/3 "2019-05-29T06:52:15Z")

</div>

Hi Andre\_letterer,

Thanks a lot to above information.but one thing i am using java rest call post data it is not working.  
i have open the json file and remove the whole id string also.

String indexResponse = RestClient.sendRequest("[http://kibanaip](http://kibanaip):kibanaport/api/canvas/workpad @/root/Downloads/canvas-workpad-PieWorkpad-workpad-1ccdfd1c-554c-4d01-9810-46c3a8fb0a25.json", 3000, "POST", userName, password);

please help me.

Thanks,  
gnanendra

---

<div class="post-metadata">

**Author:** ![Andre\_Letterer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andre_letterer/32/42248_2.png) [@Andre\_Letterer](https://discuss.elastic.co/u/Andre_Letterer)\
**Post date:** [May 29, 2019, 4:25pm UTC](https://discuss.elastic.co/t/how-to-import-and-export-canvas-workpads-via-rest-call-curl-or-any-other-way/182981/4 "2019-05-29T16:25:58Z")

</div>

I am not such a Java programmer, but just in case... Did you replace kibanahost with you kibanaip and kibanaport with the port you use normally?  
How you are opening kibana normally, I mean, what is the url for that?

---

<div class="post-metadata">

**Author:** ![Gnanendra](https://avatars.discourse-cdn.com/v4/letter/g/65b543/32.png) [@Gnanendra](https://discuss.elastic.co/u/Gnanendra)\
**Post date:** [May 30, 2019, 4:55am UTC](https://discuss.elastic.co/t/how-to-import-and-export-canvas-workpads-via-rest-call-curl-or-any-other-way/182981/5 "2019-05-30T04:55:27Z")

</div>

Hi Andre\_Letterer,

Sorry it is working.Thank you so much to your help.

Thanks,  
gnanendra

---

<div class="post-metadata">

**Author:** ![Andre\_Letterer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andre_letterer/32/42248_2.png) [@Andre\_Letterer](https://discuss.elastic.co/u/Andre_Letterer)\
**Post date:** [June 5, 2019, 11:40pm UTC](https://discuss.elastic.co/t/how-to-import-and-export-canvas-workpads-via-rest-call-curl-or-any-other-way/182981/6 "2019-06-05T23:40:41Z")

</div>

Hi, that's great to hear.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 3, 2019, 11:41pm UTC](https://discuss.elastic.co/t/how-to-import-and-export-canvas-workpads-via-rest-call-curl-or-any-other-way/182981/7 "2019-07-03T23:41:05Z")

</div>

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