# Exporting all alerts from a space into a json file

**URL:** <https://discuss.elastic.co/t/exporting-all-alerts-from-a-space-into-a-json-file/391251>\
**Category:** Kibana\
**Created:** [October 28, 2026, 7:48pm UTC](https://discuss.elastic.co/t/exporting-all-alerts-from-a-space-into-a-json-file/391251 "2026-10-28T19:48:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Benjamin\_Tyler](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/benjamin_tyler/32/148490_2.png) [@Benjamin\_Tyler](https://discuss.elastic.co/u/Benjamin_Tyler)\
**Post date:** [October 28, 2026, 7:48pm UTC](https://discuss.elastic.co/t/exporting-all-alerts-from-a-space-into-a-json-file/391251/1 "2026-10-28T19:48:25Z")

</div>

Hello,

I am trying to test a tool and I am in need of a way to export all alerts from a space into a json or txt file. I have looked around online and cannot find forum posts involving this and when asking claude I only face errors.

If anyone has any tips, ideas or solutions please let me know.

from,

Ben Tyler

---

<div class="post-metadata">

**Author:** ![covj12](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/covj12/32/147474_2.png) [@covj12](https://discuss.elastic.co/u/covj12)\
**Post date:** [October 29, 2026, 2:00am UTC](https://discuss.elastic.co/t/exporting-all-alerts-from-a-space-into-a-json-file/391251/2 "2026-10-29T02:00:44Z")

</div>

Hi, you can call Kibana directly using a curl command in terminal.

```auto
// curl export API
curl -k -X POST "https://[kibana_url]/s/[space]/api/saved_objects/_export" -H "kbn-xsrf: true" -H "Content-Type: application/json" -d '{"type":["alert"],"includeReferencesDeep":true}' -o alerts_rules.ndjson -u ID:PASSWORD

// result
cat alerts_rules.ndjson
{"excludedObjects":[{"id":"30d8ac54-4b33-410a-bcf9-4b361e27b4a8","reason":"excluded","type":"alert"}],"excludedObjectsCount":1,"exportedCount":0,"missingRefCount":0,"missingReferences":[]}

```
