> 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-19/data.md).

# Data

Read imported records.

## Retrieving imported data types

> Retrieves the distinct target types that currently hold imported records.

```json
{"openapi":"3.0.0","info":{"title":"Import Service","version":"0.0.1"},"tags":[{"name":"Data","description":"Read imported records."}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["importtool.import_trigger"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"importtool.import_trigger":"Needed to trigger, schedule, monitor, and cancel import runs; to manage a file-based stream's file queue; and to read configurations, streams, schedules, runs, and imported data."}}}}},"responses":{"Unauthorized_401":{"description":"Given request is unauthorized - the authorization token is invalid or has expired. Details will be provided in the response payload.","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"Forbidden_403":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}},"InternalServiceError_500":{"description":"An unexpected error occurred in the service. The body is the framework's default error body, not the error schema of the other responses.","content":{"application/json":{"schema":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time","description":"When the error occurred."},"status":{"type":"integer","description":"The HTTP status code."},"error":{"type":"string","description":"The HTTP status reason phrase."},"path":{"type":"string","description":"The request path."}}}}}}},"schemas":{"errorMessage":{"title":"Error","description":"Schema for specific API errors.","type":"object","properties":{"code":{"type":"integer","description":"HTTP status code.","minimum":100,"maximum":599},"status":{"description":"The HTTP status reason phrase, for example `Conflict`.","type":"string"},"message":{"description":"Descriptive error message for debugging.","type":"string"},"resourceId":{"description":"Identifier of the resource the error concerns, for example the configuration of a run that conflicts with an active run, or the run a retry was requested for. `null` when the error concerns no single resource.","type":"string","nullable":true},"details":{"description":"List of problems causing this error.","type":"array","items":{"title":"Error Detail","description":"One problem causing the error.","type":"object","properties":{"message":{"type":"string","description":"What is wrong."},"field":{"type":"string","description":"The field the problem concerns, when there is one."}}}}},"required":["status","code","message"]}}},"paths":{"/importtool/{tenant}/data/types":{"get":{"summary":"Retrieving imported data types","description":"Retrieves the distinct target types that currently hold imported records.","operationId":"GET-importtool-list-data-types","tags":["Data"],"responses":{"200":{"description":"The request was successful. The types are returned.","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}},"401":{"$ref":"#/components/responses/Unauthorized_401"},"403":{"$ref":"#/components/responses/Forbidden_403"},"500":{"$ref":"#/components/responses/InternalServiceError_500"}}}}}}
```

## Searching imported records

> Searches imported records of a given type with an optional \`search\` filter on the natural key or Emporix identifier, paginated.

```json
{"openapi":"3.0.0","info":{"title":"Import Service","version":"0.0.1"},"tags":[{"name":"Data","description":"Read imported records."}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["importtool.import_trigger"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"importtool.import_trigger":"Needed to trigger, schedule, monitor, and cancel import runs; to manage a file-based stream's file queue; and to read configurations, streams, schedules, runs, and imported data."}}}}},"parameters":{"trait_page":{"name":"page","in":"query","required":false,"description":"The zero-based page number. A negative value returns HTTP 400.","schema":{"type":"integer","minimum":0,"default":0}},"trait_size":{"name":"size","in":"query","required":false,"description":"The page size. Defaults to 20 for run history, 50 for run errors, and 25 for imported records. A value below 1 returns HTTP 400.","schema":{"type":"integer","minimum":1}}},"schemas":{"ImportedRecordPage":{"title":"Imported record page","allOf":[{"$ref":"#/components/schemas/Page"},{"type":"object","properties":{"content":{"type":"array","description":"The imported records on this page.","items":{"$ref":"#/components/schemas/ImportedRecord"}}}}]},"Page":{"title":"Page","type":"object","description":"Pagination metadata for a page of results.","properties":{"totalElements":{"type":"integer","description":"The total number of elements across all pages."},"totalPages":{"type":"integer","description":"The total number of pages."},"number":{"type":"integer","description":"The current zero-based page number."},"size":{"type":"integer","description":"The page size."}}},"ImportedRecord":{"title":"Imported record","type":"object","description":"A record that was imported. Holds keys and outcome; for composite parents it also holds the embedded child arrays.","properties":{"id":{"type":"string","format":"uuid","description":"The imported-record identifier."},"configId":{"type":"string","format":"uuid","description":"The configuration the record belongs to."},"streamId":{"type":"string","format":"uuid","description":"The stream that produced the record."},"runId":{"type":"string","format":"uuid","description":"The run that last touched the record."},"targetEntity":{"type":"string","description":"The target writer code."},"targetType":{"type":"string","description":"The target type."},"naturalKey":{"type":"string","description":"The source natural key."},"targetId":{"type":"string","description":"The deterministic Emporix instance ID the record was written under. It's derived from the natural key and allows the record to be located in the target."},"fields":{"type":"object","description":"The stored fields."},"outcome":{"type":"string","description":"The last outcome, one of `UPSERTED`, `DELETED`, `FAILED`, or `DRY_RUN`."},"importedAt":{"type":"string","format":"date-time","description":"When the record was last imported."}}},"errorMessage":{"title":"Error","description":"Schema for specific API errors.","type":"object","properties":{"code":{"type":"integer","description":"HTTP status code.","minimum":100,"maximum":599},"status":{"description":"The HTTP status reason phrase, for example `Conflict`.","type":"string"},"message":{"description":"Descriptive error message for debugging.","type":"string"},"resourceId":{"description":"Identifier of the resource the error concerns, for example the configuration of a run that conflicts with an active run, or the run a retry was requested for. `null` when the error concerns no single resource.","type":"string","nullable":true},"details":{"description":"List of problems causing this error.","type":"array","items":{"title":"Error Detail","description":"One problem causing the error.","type":"object","properties":{"message":{"type":"string","description":"What is wrong."},"field":{"type":"string","description":"The field the problem concerns, when there is one."}}}}},"required":["status","code","message"]}},"responses":{"InvalidPaging_400":{"description":"The `page` or `size` query parameter is out of range. The message names the parameter.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}},"Unauthorized_401":{"description":"Given request is unauthorized - the authorization token is invalid or has expired. Details will be provided in the response payload.","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"Forbidden_403":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}},"InternalServiceError_500":{"description":"An unexpected error occurred in the service. The body is the framework's default error body, not the error schema of the other responses.","content":{"application/json":{"schema":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time","description":"When the error occurred."},"status":{"type":"integer","description":"The HTTP status code."},"error":{"type":"string","description":"The HTTP status reason phrase."},"path":{"type":"string","description":"The request path."}}}}}}}},"paths":{"/importtool/{tenant}/data/records":{"get":{"summary":"Searching imported records","description":"Searches imported records of a given type with an optional `search` filter on the natural key or Emporix identifier, paginated.","operationId":"GET-importtool-search-data-records","tags":["Data"],"parameters":[{"name":"type","in":"query","required":true,"description":"The target type to search.","schema":{"type":"string"}},{"name":"search","in":"query","required":false,"description":"Optional filter. Returns the records whose natural key or Emporix identifier starts with the given text. The natural key can be given with its key name (`ID:SKU-1001`) or as the source value alone (`SKU-1001`). The match is case-sensitive and matches from the start only: text from the middle of a key matches nothing. Emporix identifiers are lower case, so the identifier is also matched with the text converted to lower case: `3FA85F64` finds `3fa85f64-…`. This is not the Emporix query language, so field selectors and operators are not supported.","schema":{"type":"string","default":""}},{"name":"outcome","in":"query","required":false,"description":"Optional filter by import outcome. Omit to return records of all outcomes. The value must match\nexactly, in upper case. Any other value returns no records. Possible values:\n\n* `UPSERTED` – created or updated.\n* `DELETED` – removed at the source.\n* `FAILED` – the record could not be imported.\n* `DRY_RUN` – produced by a dry run.","schema":{"type":"string","enum":["UPSERTED","DELETED","FAILED","DRY_RUN"]}},{"$ref":"#/components/parameters/trait_page"},{"$ref":"#/components/parameters/trait_size"}],"responses":{"200":{"description":"The request was successful. The records are returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportedRecordPage"}}}},"400":{"$ref":"#/components/responses/InvalidPaging_400"},"401":{"$ref":"#/components/responses/Unauthorized_401"},"403":{"$ref":"#/components/responses/Forbidden_403"},"500":{"$ref":"#/components/responses/InternalServiceError_500"}}}}}}
```

## Searching a stream's imported records

> Searches the imported records produced by a specific stream with an optional \`search\` filter on the natural key or Emporix identifier, paginated.

```json
{"openapi":"3.0.0","info":{"title":"Import Service","version":"0.0.1"},"tags":[{"name":"Data","description":"Read imported records."}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["importtool.import_trigger"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"importtool.import_trigger":"Needed to trigger, schedule, monitor, and cancel import runs; to manage a file-based stream's file queue; and to read configurations, streams, schedules, runs, and imported data."}}}}},"parameters":{"trait_page":{"name":"page","in":"query","required":false,"description":"The zero-based page number. A negative value returns HTTP 400.","schema":{"type":"integer","minimum":0,"default":0}},"trait_size":{"name":"size","in":"query","required":false,"description":"The page size. Defaults to 20 for run history, 50 for run errors, and 25 for imported records. A value below 1 returns HTTP 400.","schema":{"type":"integer","minimum":1}}},"schemas":{"ImportedRecordPage":{"title":"Imported record page","allOf":[{"$ref":"#/components/schemas/Page"},{"type":"object","properties":{"content":{"type":"array","description":"The imported records on this page.","items":{"$ref":"#/components/schemas/ImportedRecord"}}}}]},"Page":{"title":"Page","type":"object","description":"Pagination metadata for a page of results.","properties":{"totalElements":{"type":"integer","description":"The total number of elements across all pages."},"totalPages":{"type":"integer","description":"The total number of pages."},"number":{"type":"integer","description":"The current zero-based page number."},"size":{"type":"integer","description":"The page size."}}},"ImportedRecord":{"title":"Imported record","type":"object","description":"A record that was imported. Holds keys and outcome; for composite parents it also holds the embedded child arrays.","properties":{"id":{"type":"string","format":"uuid","description":"The imported-record identifier."},"configId":{"type":"string","format":"uuid","description":"The configuration the record belongs to."},"streamId":{"type":"string","format":"uuid","description":"The stream that produced the record."},"runId":{"type":"string","format":"uuid","description":"The run that last touched the record."},"targetEntity":{"type":"string","description":"The target writer code."},"targetType":{"type":"string","description":"The target type."},"naturalKey":{"type":"string","description":"The source natural key."},"targetId":{"type":"string","description":"The deterministic Emporix instance ID the record was written under. It's derived from the natural key and allows the record to be located in the target."},"fields":{"type":"object","description":"The stored fields."},"outcome":{"type":"string","description":"The last outcome, one of `UPSERTED`, `DELETED`, `FAILED`, or `DRY_RUN`."},"importedAt":{"type":"string","format":"date-time","description":"When the record was last imported."}}},"errorMessage":{"title":"Error","description":"Schema for specific API errors.","type":"object","properties":{"code":{"type":"integer","description":"HTTP status code.","minimum":100,"maximum":599},"status":{"description":"The HTTP status reason phrase, for example `Conflict`.","type":"string"},"message":{"description":"Descriptive error message for debugging.","type":"string"},"resourceId":{"description":"Identifier of the resource the error concerns, for example the configuration of a run that conflicts with an active run, or the run a retry was requested for. `null` when the error concerns no single resource.","type":"string","nullable":true},"details":{"description":"List of problems causing this error.","type":"array","items":{"title":"Error Detail","description":"One problem causing the error.","type":"object","properties":{"message":{"type":"string","description":"What is wrong."},"field":{"type":"string","description":"The field the problem concerns, when there is one."}}}}},"required":["status","code","message"]}},"responses":{"InvalidPaging_400":{"description":"The `page` or `size` query parameter is out of range. The message names the parameter.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}},"Unauthorized_401":{"description":"Given request is unauthorized - the authorization token is invalid or has expired. Details will be provided in the response payload.","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"Forbidden_403":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}},"InternalServiceError_500":{"description":"An unexpected error occurred in the service. The body is the framework's default error body, not the error schema of the other responses.","content":{"application/json":{"schema":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time","description":"When the error occurred."},"status":{"type":"integer","description":"The HTTP status code."},"error":{"type":"string","description":"The HTTP status reason phrase."},"path":{"type":"string","description":"The request path."}}}}}}}},"paths":{"/importtool/{tenant}/data/streams/{streamId}/records":{"get":{"summary":"Searching a stream's imported records","description":"Searches the imported records produced by a specific stream with an optional `search` filter on the natural key or Emporix identifier, paginated.","operationId":"GET-importtool-search-stream-records","tags":["Data"],"parameters":[{"name":"search","in":"query","required":false,"description":"Optional filter. Returns the records whose natural key or Emporix identifier starts with the given text. The natural key can be given with its key name (`ID:SKU-1001`) or as the source value alone (`SKU-1001`). The match is case-sensitive and matches from the start only: text from the middle of a key matches nothing. Emporix identifiers are lower case, so the identifier is also matched with the text converted to lower case: `3FA85F64` finds `3fa85f64-…`. This is not the Emporix query language, so field selectors and operators are not supported.","schema":{"type":"string","default":""}},{"name":"outcome","in":"query","required":false,"description":"Optional filter by import outcome. Omit to return records of all outcomes. The value must match\nexactly, in upper case. Any other value returns no records. Possible values:\n\n* `UPSERTED` – created or updated.\n* `DELETED` – removed at the source.\n* `FAILED` – the record could not be imported.\n* `DRY_RUN` – produced by a dry run.","schema":{"type":"string","enum":["UPSERTED","DELETED","FAILED","DRY_RUN"]}},{"$ref":"#/components/parameters/trait_page"},{"$ref":"#/components/parameters/trait_size"}],"responses":{"200":{"description":"The request was successful. The records are returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportedRecordPage"}}}},"400":{"$ref":"#/components/responses/InvalidPaging_400"},"401":{"$ref":"#/components/responses/Unauthorized_401"},"403":{"$ref":"#/components/responses/Forbidden_403"},"500":{"$ref":"#/components/responses/InternalServiceError_500"}}}}}}
```


---

# 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-19/data.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.
