> 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/import-tool/import-configuration-examples/http-example.md).

# Importing Using HTTP

This example shows how to create an HTTP / REST API connection and a stream that imports records from an HTTPS source into Emporix.

This example shows how to use the Import Tool with an HTTPS REST API: create an **HTTP / REST API** connection, discover source fields, then create a stream that calls the endpoint and writes records into Emporix.

The walkthrough uses a public Petstore-style API with connection **Petstore**, source record `findPetsByStatus`, and `GET /pet/findByStatus`. Replace the base URL, path, and target type with your own source when you import production data.

{% hint style="info" %}
Complete the Emporix [Prerequisites for the Import Tool](/import-tool/import-setup-and-jobs/prerequisites.md) first. For the general UI procedures, see [Connections](/import-tool/import-setup-and-jobs/connections.md), [Imports](/import-tool/import-setup-and-jobs/imports.md), and [Streams](/import-tool/import-setup-and-jobs/imports/streams.md).
{% endhint %}

## Source API requirements

The source must be reachable over HTTPS from the Import Tool.

For this example, the API:

* Exposes records on an HTTPS **Base URL**, for example `https://petstore.swagger.io/v2`.
* Returns JSON. The records can be the response body itself, or nested under a records path.
* Provides a stable identifier per record, for example `id`, so the stream can upsert.

If the API requires credentials, set **Authentication** on the connection to the method the source uses. This example uses **None** because the sample Petstore endpoint is public.

## Create an HTTP connection

Follow [Create a connection](/import-tool/import-setup-and-jobs/connections.md#create-a-connection) and [HTTP / REST API](/import-tool/import-setup-and-jobs/connections.md#http-rest-api). For this example, use:

* **Name** – `Petstore`
* **Source type** – **HTTP / REST API**
* **Base URL** – `https://petstore.swagger.io/v2`
* **Authentication** – **None** for this public example

For field discovery, choose **Auto-sample the live API (poll a few pages)**, enter `/pet/findByStatus` in **Sample path**, and choose **Sample now**.

## Create a stream from the HTTP source

{% stepper %}
{% step %}

#### Create the stream

[Create a stream](/import-tool/import-setup-and-jobs/imports/creating-streams.md) with name `My Pets`, connection **Petstore**, source record `findPetsByStatus`, key field `id`, target `emporix.customEntity`, and target type `PETSTORE_PET`.
{% endstep %}

{% step %}

#### Configure the HTTP endpoint

Expand the stream and open the **HTTP endpoint** tab. On **Endpoint**, set:

* **Method** – **GET**
* **Path** – `/pet/findByStatus`
* **Response format** – **JSON**
* **Records path** – **(response is the array)**

Choose **Save**. For pagination, parameters, and headers, see [HTTP endpoint](/import-tool/import-setup-and-jobs/imports/configuring-streams.md#http-endpoint).
{% endstep %}

{% step %}

#### Complete the stream setup

Complete the stream's [source and target configuration](/import-tool/import-setup-and-jobs/imports/configuring-streams.md), then [map and publish its fields](/import-tool/import-setup-and-jobs/imports/field-mapping.md).
{% endstep %}
{% endstepper %}

## Run the HTTP import

In the import details view, choose **Dry run** to validate without writing. To import records, open **Run options** and choose the required full or delta mode. Scheduled runs use **DELTA** mode. See [Running and Monitoring Imports](/import-tool/import-setup-and-jobs/imports/running-imports.md).

You can also trigger the same import from the Import Service API after the configuration exists. Use a token with the `importtool.import_trigger` scope.

To validate without writing:

```bash
curl -i -X POST \
  'https://api.emporix.io/importtool/{tenant}/configs/{configId}/runs' \
  -H 'Authorization: Bearer {{OAUTH2_ACCESS_TOKEN}}' \
  -H 'Content-Type: application/json' \
  -d '{
    "mode": "DELTA",
    "dryRun": true
  }'
```

To run a full import:

```bash
curl -i -X POST \
  'https://api.emporix.io/importtool/{tenant}/configs/{configId}/runs' \
  -H 'Authorization: Bearer {{OAUTH2_ACCESS_TOKEN}}' \
  -H 'Content-Type: application/json' \
  -d '{
    "mode": "FULL"
  }'
```

List configurations with `GET /importtool/{tenant}/configs` to obtain `{configId}`. For monitoring, cancellation, and imported-record search, see the [Import Service tutorial](https://developer.emporix.io/api-references/api-guides/utilities/import-service/import-service).

## Next steps

* Review [Run history](/import-tool/import-setup-and-jobs/imports/running-imports.md#run-history) and [Run order](/import-tool/import-setup-and-jobs/imports/running-imports.md#run-order-and-dependencies).
* Monitor health and failures on the [Dashboard](/import-tool/dashboard.md).
* Inspect record-level results in [Imported Data](/import-tool/import-setup-and-jobs/imported-data.md).


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developer.emporix.io/import-tool/import-configuration-examples/http-example.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
