Opensearch Dashboards saved objects API object not found

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):

2.14.0

Describe the issue:
I’m trying to export an index pattern from dashboards. Exporting from the UI returns the object. Exporting with curl fails.

curl -XPOST -k http://localhost:5601/api/saved_objects/_export -u user:password -H "osd-xsrf:true" -H 'Content-Type: application/json' -d '{
  "objects": [
    {
      "type": "index-pattern",
      "id": "3cb30f70-1e8b-11ef-947d-bd1d0193c5ea"
    }
  ]
}'

fails with Saved object [index-pattern/3cb30f70-1e8b-11ef-947d-bd1d0193c5ea] not found

while
curl -XPOST -k http://localhost:5601/api/saved_objects/_export -u user:password -H "osd-xsrf:true" -H 'Content-Type: application/json' -d '{ "type": "index-pattern" }'
returns
{“exportedCount”:0,“missingRefCount”:0,“missingReferences”:}%

The index pattern is in the global tenant.

Thanks for any assistance!

That api works well in my local env(2.14.0), could you check if the index pattern exists in .kibana index?

GET .kibana/_doc/index-pattern:3cb30f70-1e8b-11ef-947d-bd1d0193c5ea

I checked, the index pattern exists in .kibana.


{
  "_index": ".kibana_1",
  "_id": "index-pattern:3cb30f70-1e8b-11ef-947d-bd1d0193c5ea",
  "_version": 1,
  "_seq_no": 1,
  "_primary_term": 2,
  "found": true,
  "_source": {
    "index-pattern": {
      "title": "my-data-stream",
      "timeFieldName": "@timestamp",
      "fields": """[{"count":0,"name":"@timestamp","type":"date","esTypes":["date"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"_id","type":"string","esTypes":["_id"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"count":0,"name":"_index","type":"string","esTypes":["_index"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"count":0,"name":"_score","type":"number","scripted":false,"searchable":false,"aggregatable":false,"readFromDocValues":false},{"count":0,"name":"_source","type":"_source","esTypes":["_source"],"scripted":false,"searchable":false,"aggregatable":false,"readFromDocValues":false},{"count":0,"name":"_type","type":"string","scripted":false,"searchable":false,"aggregatable":false,"readFromDocValues":false},{"count":0,"name":"testfield","type":"string","esTypes":["text"],"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"count":0,"name":"testfield.keyword","type":"string","esTypes":["keyword"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"testfield"}}}]"""
    },
    "type": "index-pattern",
    "references": [],
    "migrationVersion": {
      "index-pattern": "7.6.0"
    },
    "updated_at": "2024-05-30T13:48:03.943Z"
  }
}