> 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**, resource `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
* **Test endpoint** – `/pet/findByStatus` if you want **Test connection** to call the list endpoint

Choose **Save**, then choose **Test connection**. You can test only after the connection is stored.

For field discovery, leave **None — each stream samples its own endpoint**, then sample from the stream **HTTP endpoint**. If the API publishes a specification, choose that format instead, enter the spec location, and choose **Discover fields**.

## 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**, **Resource name** `findPetsByStatus`, **Method** **GET**, **Path** `/pet/findByStatus`, **Records path** **(response is the array)**, 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). **Map from source** matches source names to mixin **Key** values; unmatched fields need **+ Add row**. Publish the mapping before a real run.
{% 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](/api-documentation/api-guides/utilities/import-service/import-service.md).

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