# Export connector using saved objects api

**URL:** <https://discuss.elastic.co/t/export-connector-using-saved-objects-api/338011>\
**Category:** Kibana\
**Tags:** saved-objects\
**Created:** [July 10, 2023, 9:57am UTC](https://discuss.elastic.co/t/export-connector-using-saved-objects-api/338011 "2023-07-10T09:57:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bhrugu\_Sharma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bhrugu_sharma/32/116623_2.png) [@Bhrugu\_Sharma](https://discuss.elastic.co/u/Bhrugu_Sharma)\
**Post date:** [July 10, 2023, 9:57am UTC](https://discuss.elastic.co/t/export-connector-using-saved-objects-api/338011/1 "2023-07-10T09:57:02Z")

</div>

I am trying to export connectors from few of my spaces using `saved objects api`  
the request body looks like

```auto
body ={
    "type": "connector",
    "includeReferencesDeep": True
}

```

but when i do the request it says  
`"statusCode":400,"error":"Bad Request","message":"Trying to export non-exportable type(s): connector"`  
so the type of connector is not supported for now or am i missing something?  
the full code looks something like

```auto
import requests
import json
from requests.auth import HTTPBasicAuth
import ndjson

kibana_url = 'https://{correct url}/kibana'

headers = {
    'kbn-xsrf': 'true'
}

body ={
    "type": "connector",
    "includeReferencesDeep": True
}

# Get a list of all spaces in Kibana
spaces_url = f'{kibana_url}/api/spaces/space'
response = requests.get(spaces_url, headers=headers, verify=True,auth=HTTPBasicAuth(CORRECT VALUES))
spaces = response.json()
# print(spaces)

for space in spaces:
    space_id = space['id']
    space_name = space['name']
    print("for space id: " + space_id)
    saved_object_url = f'{kibana_url}/s/{space_id}/api/saved_objects/_export'
    res = requests.post(saved_object_url, headers = headers,json=body ,verify=True,auth=HTTPBasicAuth(CORRECT VALUES))
    connector = res.text
    print(connector)
```

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [July 12, 2023, 5:04pm UTC](https://discuss.elastic.co/t/export-connector-using-saved-objects-api/338011/2 "2023-07-12T17:04:16Z")

</div>

Hi, it could be a bug in your version of Kibana. Which version of Kibana is this?

---

<div class="post-metadata">

**Author:** ![Bhrugu\_Sharma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bhrugu_sharma/32/116623_2.png) [@Bhrugu\_Sharma](https://discuss.elastic.co/u/Bhrugu_Sharma)\
**Post date:** [July 12, 2023, 5:52pm UTC](https://discuss.elastic.co/t/export-connector-using-saved-objects-api/338011/3 "2023-07-12T17:52:06Z")

</div>

The version is 8.6.3, I'm able to export dashboards and stuff but in type "connector" says invalid type

---

<div class="post-metadata">

**Author:** ![Patrick\_Mueller](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/patrick_mueller/32/109425_2.png) [@Patrick\_Mueller](https://discuss.elastic.co/u/Patrick_Mueller)\
**Post date:** [July 13, 2023, 1:31pm UTC](https://discuss.elastic.co/t/export-connector-using-saved-objects-api/338011/4 "2023-07-13T13:31:58Z")

</div>

> [@Bhrugu\_Sharma](#):
>
> `connector`

I believe connectors use type "action" - the original name of the feature, changed later to connector, but we left the old type name.

---

<div class="post-metadata">

**Author:** ![Bhrugu\_Sharma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bhrugu_sharma/32/116623_2.png) [@Bhrugu\_Sharma](https://discuss.elastic.co/u/Bhrugu_Sharma)\
**Post date:** [August 7, 2023, 7:42pm UTC](https://discuss.elastic.co/t/export-connector-using-saved-objects-api/338011/5 "2023-08-07T19:42:20Z")

</div>

Thanks a bunch this worked for me perfectly

---

<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:** [September 4, 2023, 7:42pm UTC](https://discuss.elastic.co/t/export-connector-using-saved-objects-api/338011/6 "2023-09-04T19:42:39Z")

</div>

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