> For the complete documentation index, see [llms.txt](https://developer.emporix.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.emporix.io/api-references/readme/api-reference-33/export-import.md). Agents can also search and read this documentation through its [MCP server](https://developer.emporix.io/~gitbook/mcp).

# Export / Import

## Exporting search indexes

> !\[Preview]\(<https://res.cloudinary.com/saas-ag/image/upload/v1752824268/emporix/icons/preview\\_api1.png)\\>
> \
> {% hint style="danger" %}\
> This functionality is in preview mode - some of the features may not be fully operational yet.\
> {% endhint %}\
> \
> Exports the configuration of the selected search indexes as one package. The package can be imported on another tenant.\
> \
> \`data\` is a base64-encoded JSON array. Each decoded item has \`id\`, \`type\`, and \`fields\`. \`name\` and \`description\` are optional localized maps. The array does not include \`status\` or \`metadata\`. Unknown properties in the request are ignored.\
> \
> A selection that names an index that does not exist returns \`404 Not Found\`. An empty selection, a null item, or an item without \`type\` or \`id\` returns \`400 Bad Request\`.

```json
{"openapi":"3.0.0","info":{"title":"Search Service","version":"0.0.1"},"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["search.search_manage"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"search.search_read":"Needed to search documents, to read saved searches, and to read search indexes and index jobs.","search.search_manage":"Needed to create, update, and delete saved searches and search indexes.","schema.custominstance_read":"Needed to read every custom entity instance. When this scope is absent, `custom.{type}_read` or `custom.{type}_read_own` can still allow the search.","customer.customer_read":"Needed to search every customer. A restricted form such as `customer.customer_read--DE#AT` returns only customers whose `restriction` matches one of the listed values.","customer.customer_read_own":"Needed to search only the caller's own customer.","customermanagement.legalentity_read":"Needed to search every legal entity. A restricted form such as `customermanagement.legalentity_read--DE#AT` returns only legal entities whose `restrictions` contain one of the listed values.","customermanagement.legalentity_read_own":"Needed to search only the caller's own legal entity."}}}}},"schemas":{"IndexSelection":{"type":"object","description":"One index to export. Unknown properties are ignored.","properties":{"type":{"type":"string","description":"Type this index belongs to. A custom schema type, `customer`, or `legal-entity`."},"id":{"type":"string","description":"Index id. Use 1 to 66 characters. Allowed characters are letters, digits, underscore, and hyphen."}},"required":["type","id"]},"IndexExportPackage":{"type":"object","description":"Package of search index configuration. `data` is the base64 encoding of a JSON array.\n\nEach decoded item has `id`, `type`, and `fields`. `name`, `description`, and `analyzers` are optional. Export omits `status` and `metadata`. Import accepts `metadata.version` when the caller sends it.","properties":{"exportedAt":{"type":"string","format":"date-time","description":"Date and time when the package was exported."},"data":{"type":"string","description":"Base64-encoded JSON array of index configurations."}},"required":["exportedAt","data"]},"ErrorMessage":{"type":"object","description":"Error returned for a failed request.","properties":{"code":{"type":"integer","description":"HTTP status code."},"status":{"type":"string","description":"HTTP status code as text."},"message":{"type":"string","description":"Explanation of the failure."},"details":{"type":"array","description":"Field-level or scope-level messages, when the failure has more than one part.","items":{"type":"object","properties":{"message":{"type":"string","description":"One part of the failure."}}}}}},"ErrorMessageFault":{"type":"object","description":"Authorization error returned by the API gateway.","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string","description":"Authorization failure."},"detail":{"type":"object","properties":{"errorcode":{"type":"string","description":"Gateway error code."}}}}}}}},"responses":{"401_resp_common":{"description":"The authorization token is invalid or has expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessageFault"}}}},"403_search_manage":{"description":"The access token does not include `search.search_manage`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"500_resp_common":{"description":"A server-side error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}}},"paths":{"/search/{tenant}/search/indexes/export":{"post":{"summary":"Exporting search indexes","operationId":"POST-search-tenant-indexes-export","tags":["Export / Import"],"description":"![Preview](https://res.cloudinary.com/saas-ag/image/upload/v1752824268/emporix/icons/preview_api1.png)\n\n{% hint style=\"danger\" %}\nThis functionality is in preview mode - some of the features may not be fully operational yet.\n{% endhint %}\n\nExports the configuration of the selected search indexes as one package. The package can be imported on another tenant.\n\n`data` is a base64-encoded JSON array. Each decoded item has `id`, `type`, and `fields`. `name` and `description` are optional localized maps. The array does not include `status` or `metadata`. Unknown properties in the request are ignored.\n\nA selection that names an index that does not exist returns `404 Not Found`. An empty selection, a null item, or an item without `type` or `id` returns `400 Bad Request`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/IndexSelection"}}}}},"responses":{"200":{"description":"The request succeeded. The body is the export package.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IndexExportPackage"}}}},"400":{"description":"The selection is empty, an item is null, or an item is missing `type` or `id`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"401":{"$ref":"#/components/responses/401_resp_common"},"403":{"$ref":"#/components/responses/403_search_manage"},"404":{"description":"No index exists for one of the selected type and id pairs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"500":{"$ref":"#/components/responses/500_resp_common"}}}}}}
```

## Importing search indexes

> !\[Preview]\(<https://res.cloudinary.com/saas-ag/image/upload/v1752824268/emporix/icons/preview\\_api1.png)\\>
> \
> {% hint style="danger" %}\
> This functionality is in preview mode - some of the features may not be fully operational yet.\
> {% endhint %}\
> \
> Creates or updates each index in the package. Each index uses the same checks as saving an index. The type must be a custom schema type, \`customer\`, or \`legal-entity\`, and each field must be allowed on that type.\
> \
> \`data\` is a base64-encoded JSON array of index configurations. \`metadata\` can be omitted. When \`metadata.version\` is present, it is the optimistic lock. A missing version still updates an index that already exists. Unknown properties in a decoded item are ignored.\
> \
> The response has one item per index, in the same order as the package. \`jobId\` and \`jobType\` are present when a build job starts. They are omitted when the index is already ready and its field definition is unchanged. \`create\_index\` means the index was created. \`update\_index\` means an existing index's field definition changed.\
> \
> Indexes earlier in the package stay created or updated when a later index fails. The response is then the error for the index that failed.

```json
{"openapi":"3.0.0","info":{"title":"Search Service","version":"0.0.1"},"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["search.search_manage"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"search.search_read":"Needed to search documents, to read saved searches, and to read search indexes and index jobs.","search.search_manage":"Needed to create, update, and delete saved searches and search indexes.","schema.custominstance_read":"Needed to read every custom entity instance. When this scope is absent, `custom.{type}_read` or `custom.{type}_read_own` can still allow the search.","customer.customer_read":"Needed to search every customer. A restricted form such as `customer.customer_read--DE#AT` returns only customers whose `restriction` matches one of the listed values.","customer.customer_read_own":"Needed to search only the caller's own customer.","customermanagement.legalentity_read":"Needed to search every legal entity. A restricted form such as `customermanagement.legalentity_read--DE#AT` returns only legal entities whose `restrictions` contain one of the listed values.","customermanagement.legalentity_read_own":"Needed to search only the caller's own legal entity."}}}}},"parameters":{"header_Content-Language":{"name":"Content-Language","in":"header","required":false,"description":"Language of the localized `name` and `description` in the request body. Each language key in those maps must be configured for the tenant.","schema":{"type":"string"}}},"schemas":{"IndexExportPackage":{"type":"object","description":"Package of search index configuration. `data` is the base64 encoding of a JSON array.\n\nEach decoded item has `id`, `type`, and `fields`. `name`, `description`, and `analyzers` are optional. Export omits `status` and `metadata`. Import accepts `metadata.version` when the caller sends it.","properties":{"exportedAt":{"type":"string","format":"date-time","description":"Date and time when the package was exported."},"data":{"type":"string","description":"Base64-encoded JSON array of index configurations."}},"required":["exportedAt","data"]},"IndexImportResult":{"type":"object","description":"Result of importing one index. `jobId` and `jobType` are omitted when the ready index is unchanged.","properties":{"id":{"type":"string","description":"Index id."},"type":{"type":"string","description":"Type this index belongs to. A custom schema type, `customer`, or `legal-entity`."},"jobId":{"type":"string","description":"Identifier of the job that builds the index. Present when a job starts."},"jobType":{"type":"string","description":"Kind of index change. Present when a job starts.\n* `create_index` – the index was created.\n* `update_index` – an existing index's field definition changed.","enum":["create_index","update_index"]}},"required":["id","type"]},"ErrorMessage":{"type":"object","description":"Error returned for a failed request.","properties":{"code":{"type":"integer","description":"HTTP status code."},"status":{"type":"string","description":"HTTP status code as text."},"message":{"type":"string","description":"Explanation of the failure."},"details":{"type":"array","description":"Field-level or scope-level messages, when the failure has more than one part.","items":{"type":"object","properties":{"message":{"type":"string","description":"One part of the failure."}}}}}},"ErrorMessageFault":{"type":"object","description":"Authorization error returned by the API gateway.","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string","description":"Authorization failure."},"detail":{"type":"object","properties":{"errorcode":{"type":"string","description":"Gateway error code."}}}}}}}},"responses":{"401_resp_common":{"description":"The authorization token is invalid or has expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessageFault"}}}},"403_search_manage":{"description":"The access token does not include `search.search_manage`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"500_resp_common":{"description":"A server-side error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}}},"paths":{"/search/{tenant}/search/indexes/import":{"post":{"summary":"Importing search indexes","operationId":"POST-search-tenant-indexes-import","tags":["Export / Import"],"description":"![Preview](https://res.cloudinary.com/saas-ag/image/upload/v1752824268/emporix/icons/preview_api1.png)\n\n{% hint style=\"danger\" %}\nThis functionality is in preview mode - some of the features may not be fully operational yet.\n{% endhint %}\n\nCreates or updates each index in the package. Each index uses the same checks as saving an index. The type must be a custom schema type, `customer`, or `legal-entity`, and each field must be allowed on that type.\n\n`data` is a base64-encoded JSON array of index configurations. `metadata` can be omitted. When `metadata.version` is present, it is the optimistic lock. A missing version still updates an index that already exists. Unknown properties in a decoded item are ignored.\n\nThe response has one item per index, in the same order as the package. `jobId` and `jobType` are present when a build job starts. They are omitted when the index is already ready and its field definition is unchanged. `create_index` means the index was created. `update_index` means an existing index's field definition changed.\n\nIndexes earlier in the package stay created or updated when a later index fails. The response is then the error for the index that failed.","parameters":[{"$ref":"#/components/parameters/header_Content-Language"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IndexExportPackage"}}}},"responses":{"200":{"description":"The request succeeded. The body lists one result for each index in the package.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/IndexImportResult"}}}}},"400":{"description":"The package cannot be read, or an index in the package fails validation or field checks.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"401":{"$ref":"#/components/responses/401_resp_common"},"403":{"$ref":"#/components/responses/403_search_manage"},"409":{"description":"An index job is already in progress, or `metadata.version` does not match the stored index.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"500":{"$ref":"#/components/responses/500_resp_common"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.emporix.io/api-references/readme/api-reference-33/export-import.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
