# 404 When Using Copy Saved Objects to Space API

**URL:** <https://discuss.elastic.co/t/404-when-using-copy-saved-objects-to-space-api/344942>\
**Category:** Kibana\
**Tags:** saved-objects\
**Created:** [October 12, 2023, 4:38pm UTC](https://discuss.elastic.co/t/404-when-using-copy-saved-objects-to-space-api/344942 "2023-10-12T16:38:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ameindel](https://avatars.discourse-cdn.com/v4/letter/a/94ad74/32.png) [@ameindel](https://discuss.elastic.co/u/ameindel)\
**Post date:** [October 12, 2023, 4:38pm UTC](https://discuss.elastic.co/t/404-when-using-copy-saved-objects-to-space-api/344942/1 "2023-10-12T16:38:51Z")

</div>

Hello, Elastic!

I'm currently trying to use the [Copy Saved Objects](https://www.elastic.co/guide/en/kibana/current/spaces-api-copy-saved-objects.html) api (copying an Uptime status Rule from our 'sandbox' space to our 'default' space) and am having issues with 404s.

The object exists in the Sandbox space and I know the 'id' is correct as well as the 'type' from the .ndjson export.

If you could tell me what I'm missing, I would greatly appreciate it. Thanks in advance!

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/3/e3b568df2f277f0d03fa3a0479f131fb1187e31f.png)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/d/ad48ce52fce864a416dbdd195faa770470526ba5.png)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/d/1/d1a71a442559ed18dd30396f326abe44250d330d.png)

---

<div class="post-metadata">

**Author:** ![jsanz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsanz/32/53734_2.png) [@jsanz](https://discuss.elastic.co/u/jsanz)\
**Post date:** [October 26, 2023, 1:22pm UTC](https://discuss.elastic.co/t/404-when-using-copy-saved-objects-to-space-api/344942/2 "2023-10-26T13:22:35Z")

</div>

Well, from the Kibana UI I see two things.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/c/8/c83bcc6f2aa49d78180e793e2b09f52932efe517.png)

1. There is no action to share or copy a rule between spaces as opposed to other saved objects
2. The tooltip on rules says the object is isolated (which is different from "Global" as stated for the settings). This tells me a rule is assigned to a Space only.

Also, I'm not seeing the `rule` (or `alert`) in the list of supported types for the [`get`](https://www.elastic.co/guide/en/kibana/current/saved-objects-api-get.html), or [`_bulk_get`](https://www.elastic.co/guide/en/kibana/current/saved-objects-api-bulk-get.html) API endpoints. And when calling the `_export` method this object is excluded as you saw in your screenshot

I tested it on a rule as well:

```auto
curl -s -u "${ELASTIC_USER}:${ELASTIC_PASSWORD}" \
  -X POST -H 'kbn-xsrf: true' -H 'Content-Type: application/json' \
  "${KIBANA_HOST}/s/test-observability/api/saved_objects/_export" \
  -d '{"objects":[{"id":"909dd640-73fc-11ee-ad19-59828ae0e5c4","type":"alert"}],"includeReferencesDeep":true}' \
  | jq 
{
  "excludedObjects": [
    {
      "id": "909dd640-73fc-11ee-ad19-59828ae0e5c4",
      "reason": "excluded",
      "type": "alert"
    }
  ],
  "excludedObjectsCount": 1,
  "exportedCount": 0,
  "missingRefCount": 0,
  "missingReferences": []
}

```

I've also tested to run a copy of that rule to another space to confirm that a `404` is thrown.

```auto
curl -s -u "${ELASTIC_USER}:${ELASTIC_PASSWORD}" \
  -X POST -H 'kbn-xsrf: true' -H 'Content-Type: application/json' \
  "${KIBANA_HOST}/s/test-observability/api/spaces/_copy_saved_objects" \
  -d '{"objects":[{"type":"alert","id":"909dd640-73fc-11ee-ad19-59828ae0e5c4"}],"spaces":["public"]}' \
  | jq
{
  "statusCode": 404,
  "error": "Not Found",
  "message": "Saved objects not found",
  "attributes": {
    "objects": [
      {
        "id": "909dd640-73fc-11ee-ad19-59828ae0e5c4",
        "type": "alert"
      }
    ]
  }
}

```

So it seems pretty clear to me that rules are not supported as saved objects that can be managed through the Saved Objects API.

---

<div class="post-metadata">

**Author:** ![ameindel](https://avatars.discourse-cdn.com/v4/letter/a/94ad74/32.png) [@ameindel](https://discuss.elastic.co/u/ameindel)\
**Post date:** [November 16, 2023, 7:15pm UTC](https://discuss.elastic.co/t/404-when-using-copy-saved-objects-to-space-api/344942/3 "2023-11-16T19:15:27Z")

</div>

Thank you for the response, @jsanz. I appreciate it. Hopefully this can eventually be supported in the near future.

---

<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:** [December 14, 2023, 7:16pm UTC](https://discuss.elastic.co/t/404-when-using-copy-saved-objects-to-space-api/344942/4 "2023-12-14T19:16:29Z")

</div>

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