# Using the Batch Items API

{% hint style="warning" %}
[<mark style="color:orange;">This API requires Authentication.</mark>](https://github.com/Attraqt/product-discovery-documentation/blob/main/new-docs/sending-and-managing-data/sending-product-data/items-api/authorization-to-apis.md)
{% endhint %}

{% hint style="info" %}
Required fields are marked with a red asterisk (<mark style="color:red;">\*</mark>) in the **Name** column.
{% endhint %}

Use the batch Items API to replace a whole or parts of a catalog.

## Migrating from streaming Items API to batch Items API <a href="#migrating-from-streaming-api" id="migrating-from-streaming-api"></a>

If you have been using the streaming Items API to send your entire catalog, we recommend migrating to the batch Items API, which has been designed for this purpose specifically.

{% tabs %}
{% tab title="Batches into non-active catalogs (FHR/XO)" %}
Fredhopper currently does not support loading batches into active catalogs. **Clients integrated with Fredhopper must use this method.**

Before you enforce the following changes reach out to Crownpeak to enable the feature.

Implementation changes:

1. Add a `createBatchImport=true` query parameter to the [catalog creation call](/product-discovery/sending-and-managing-product-data/what-is-the-items-api/working-with-items/item-catalog/using-the-catalog-api.md).
2. When sending items:
   1. Change URL from `https://items.attraqt.io/items` to `https://items.attraqt.io/batch-imports/items`.
   2. Add a `batch_id` query parameter with a value set to the catalog version.
   3. Remove `catalogVersion` from request body attributes.
3. Once all items are sent, replace the catalog promotion call with a batch ingestion creation similar to the following:

```
curl --request POST
 --url 'https://items.attraqt.io/batch-imports/ingestions?tenant=$TENANT&environment=$ENVIRONMENT'
 --header 'Authorization: Bearer $ACCESS_TOKEN'
 --header 'Content-Type: application/json'
  --data '{
  "catalogVersion": $CATALOG_VERSION,
  "promoteCatalogOnCompletion": true
}'
```

{% hint style="info" %}
Optionally specify `minItemCount` and `minSuccessRatePercent.`
{% endhint %}
{% endtab %}

{% tab title="Batches into active catalogs (XO only)" %}
**Clients integrated with XO only can use this method.**

Implementation changes:

1. Create a batch before sending items, and keep its ID.

```
curl --request POST 
 --url 'https://items.attraqt.io/batch-imports?tenant=$TENANT&environment=$ENVIRONMENT' 
 --header 'Authorization: Bearer $ACCESS_TOKEN'
```

2. When sending items:
   1. Change URL from `https://items.attraqt.io/items` to `https://items.attraqt.io/batch-imports/items`.
   2. Add a `batch_id` query parameter with a value set to the batch ID created earlier.
   3. Remove `catalogVersion` from request body attributes.
3. Once all items are sent, launch a batch ingestion.

```
curl --request POST 
 --url 'https://items.attraqt.io/batch-imports/ingestions?tenant=$TENANT&environment=$ENVIRONMENT' 
 --header 'Authorization: Bearer $ACCESS_TOKEN' 
 --header 'Content-Type: application/json' 
  --data '{
  "batchImportId": $BATCH_ID,
  "catalogVersion": $CATALOG_VERSION,
}'
```

{% endtab %}
{% endtabs %}

## Create a batch

<mark style="color:blue;">`POST`</mark> `https://items.attraqt.io/batch-imports`

This endpoint allows you to import a batch.

**Query Parameters**

| **Name**                                      | **Type** | **Description**         |
| --------------------------------------------- | -------- | ----------------------- |
| tenant<mark style="color:red;">\*</mark>      | string   | Your tenant[^1] ID      |
| environment<mark style="color:red;">\*</mark> | string   | Your environment[^2] ID |

**Headers**

| **Name**                                        | **Description**                                                                                                     |
| ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | [Bearer token](/product-discovery/sending-and-managing-product-data/what-is-the-items-api/authorization-to-apis.md) |

**Response Body**

| **Name** | **Type** | **Description** |
| -------- | -------- | --------------- |
| id       | string   | batch ID        |

{% hint style="info" %}
Batches automatically expire after 7 days and can therefore not be ingested after this period.
{% endhint %}

## Create a default catalog batch <a href="#default-catalog-batch" id="default-catalog-batch"></a>

You can also create batches automatically along with catalogs:

* Add a `createBatchImport=true` query parameter to the [catalog creation call](/product-discovery/sending-and-managing-product-data/what-is-the-items-api/working-with-items/item-catalog/using-the-catalog-api.md).\
  -> The ID of this default catalog batch is identical to the catalog version.

## List batches <a href="#list-batches" id="list-batches"></a>

<mark style="color:green;">`GET`</mark> `https://items.attraqt.io/batch-imports`

This allows you to retrieve a list of batches.

**Query Parameters**

| **Name**                                      | **Type** | **Description**     |
| --------------------------------------------- | -------- | ------------------- |
| tenant<mark style="color:red;">\*</mark>      | string   | Your tenant ID      |
| environment<mark style="color:red;">\*</mark> | string   | Your environment ID |

**Headers**

| **Name**                                        | **Description**                                                                                                     |
| ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | [Bearer token](/product-discovery/sending-and-managing-product-data/what-is-the-items-api/authorization-to-apis.md) |

**Response body**

The response body consists of an array of objects containing the following fields:

| **Name**                                    | **Type**                                                                                 | **Description**     |
| ------------------------------------------- | ---------------------------------------------------------------------------------------- | ------------------- |
| id<mark style="color:red;">\*</mark>        | object                                                                                   | batch ID            |
| createdAt<mark style="color:red;">\*</mark> | [RFC 3339 Internet date/time format](https://www.rfc-editor.org/rfc/rfc3339#section-5.6) | batch creation date |

## Add items to batch <a href="#adding-items-in-batch" id="adding-items-in-batch"></a>

<mark style="color:blue;">`POST`</mark> `https://items.attraqt.io/batch-imports/items`

This allows you to add items to an existing batch.

**Query Parameters**

| **Name**                                      | **Type** | **Description**                                                                                                                                                                                             |
| --------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| tenant<mark style="color:red;">\*</mark>      | string   | Your tenant ID                                                                                                                                                                                              |
| environment<mark style="color:red;">\*</mark> | string   | Your environment ID                                                                                                                                                                                         |
| batch\_id<mark style="color:red;">\*</mark>   |          | <p>batch ID</p><ul><li>returned by the <a href="#create-a-batch">batch creation call</a> OR</li><li>identical to catalog version for<a href="#default-catalog-batch"> default catalog batches</a></li></ul> |

**Headers**

| **Name**                                        | **Description**                                                                                    |
| ----------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | [Bearer token](https://attraqt.gitbook.io/developer-documentation/items-api/authorization-to-apis) |
| Content-Type<mark style="color:red;">\*</mark>  | `application/json`                                                                                 |

**Request body**

The request body consists of an array of JSON items with the following fields:

| **Name**                                     | **Type**                                                                                                                 | **Description**                                                                                                                  |
| -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- |
| id<mark style="color:red;">\*</mark>         | string                                                                                                                   | Item ID; can not be empty and can only include alphanumeric characters, underscores, and hyphens                                 |
| type<mark style="color:red;">\*</mark>       | string                                                                                                                   | [Item schema](/product-discovery/sending-and-managing-product-data/what-is-the-items-api/working-with-items/item-schema.md) name |
| context                                      | string                                                                                                                   | Context (store ID, private sales...); can only include alphanumeric characters, underscores, and hyphens                         |
| timestamp                                    | [RFC 3339 Internet date/time format](https://www.rfc-editor.org/rfc/rfc3339#section-5.6), e.g. `1985-04-12T23:20:50.52Z` | defaults to current time stamp; allows for ordering insertion, modification, and deletion operations on the same item            |
| parentId                                     | string                                                                                                                   | Parent item, if item is a variant                                                                                                |
| attributes<mark style="color:red;">\*</mark> | object                                                                                                                   | c.f. [item attributes](/product-discovery/sending-and-managing-product-data/what-is-the-items-api/working-with-items/items.md)   |

{% code title="Sample request body:" %}

```json
[
   {
        "id": "id1",
        "type": "product",
        "timestamp": "2024-09-05T10:50:42Z",
        "attributes": {
            "title": "Item 1",
            "url": "https://example.com/item1"
        }
   },
   {
        "id": "id2",
        "type": "variant",
        "parentId": "id1",
        "attributes": {
            "size": 2
        }
    }
]
```

{% endcode %}

**Response body**

Results are returned in the form of an array. Each array element corresponds to an item in the request body.\
The results have the following fields:

| **Name**                               | **Type** | **Description**                                              |
| -------------------------------------- | -------- | ------------------------------------------------------------ |
| id<mark style="color:red;">\*</mark>   | object   | ID, type, and context of the item                            |
| code<mark style="color:red;">\*</mark> | integer  | `0` means success, any other value is an internal error code |
| message                                | string   | Error message if `code` is different from `0`                |

A success code (`0`) means that the item has been added into the batch, but not necessarily that the item is valid.

{% hint style="info" %}
Items can only be validated against a specific schema during batch ingestions once the target catalog is defined.
{% endhint %}

## Modify items in batch <a href="#modifying-items-in-the-batch" id="modifying-items-in-the-batch"></a>

<mark style="color:purple;">`PATCH`</mark> `https://items.attraqt.io/batch-imports/items`

This allows you to modify the items included in an existing batch.

**Query Parameters**

| **Name**                                      | **Type** | **Description**                                                                                                                                                                                             |
| --------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| tenant<mark style="color:red;">\*</mark>      | string   | Your tenant ID                                                                                                                                                                                              |
| environment<mark style="color:red;">\*</mark> | string   | Your environment ID                                                                                                                                                                                         |
| batch\_id<mark style="color:red;">\*</mark>   |          | <p>batch ID</p><ul><li>returned by the <a href="#create-a-batch">batch creation call</a> OR</li><li>identical to catalog version for<a href="#default-catalog-batch"> default catalog batches</a></li></ul> |

**Headers**

| **Name**                                        | **Description**                                                                                                     |
| ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | [Bearer token](/product-discovery/sending-and-managing-product-data/what-is-the-items-api/authorization-to-apis.md) |
| Content-Type<mark style="color:red;">\*</mark>  | `application/json`                                                                                                  |

**Request body**

The request body consists of an array of JSON items with the following fields:

| **Name**                               | **Type**                                                                                                                 | **Description**                                                                                                                  |
| -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- |
| id<mark style="color:red;">\*</mark>   | string                                                                                                                   | Item ID; can not be empty and can only include alphanumeric characters, underscores and hyphens                                  |
| type<mark style="color:red;">\*</mark> | string                                                                                                                   | [Item schema](/product-discovery/sending-and-managing-product-data/what-is-the-items-api/working-with-items/item-schema.md) name |
| context                                | string                                                                                                                   | Context (store ID, private sales...); can only include alphanumeric characters, underscores and hyphens                          |
| timestamp                              | [RFC 3339 Internet date/time format](https://www.rfc-editor.org/rfc/rfc3339#section-5.6), e.g. `1985-04-12T23:20:50.52Z` | Defaults to current time stamp; allows ordering insertion, modification, and deletion operations on the same item                |
| parentId                               | string                                                                                                                   | Parent item, if item is a variant                                                                                                |
| attributes                             | object                                                                                                                   | Item attributes that need to be modified; unchanged attributes don’t have to be included                                         |

sample request body:

{% code title="Sample request body:" %}

```json
[{
        "id": "id1",
        "type": "product",
        "attributes": {
		    "url": "https://example.com/item1_patch"
        }
}]
```

{% endcode %}

**Response body**

The structure of the response body when modifying items is identical to the structure of the [response body when adding items](#adding-items-in-batch).

## Delete items from batch <a href="#deleting-items-from-the-batch" id="deleting-items-from-the-batch"></a>

<mark style="color:blue;">`POST`</mark> `https://items.attraqt.io/batch-imports/items/delete`

This allows you to delete items from an existing batch.

**Query Parameters**

| **Name**                                      | **Type** | **Description**                                                                                                                                                                                             |
| --------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| tenant<mark style="color:red;">\*</mark>      | string   | Your tenant ID                                                                                                                                                                                              |
| environment<mark style="color:red;">\*</mark> | string   | Your environment ID                                                                                                                                                                                         |
| batch\_id<mark style="color:red;">\*</mark>   |          | <p>batch ID</p><ul><li>returned by the <a href="#create-a-batch">batch creation call</a> OR</li><li>identical to catalog version for<a href="#default-catalog-batch"> default catalog batches</a></li></ul> |

**Headers**

| **Name**                                        | **Description**                                                                                                     |
| ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | [Bearer token](/product-discovery/sending-and-managing-product-data/what-is-the-items-api/authorization-to-apis.md) |
| Content-Type<mark style="color:red;">\*</mark>  | `application/json`                                                                                                  |

**Request body**

The request body consists of an array of JSON items with the following fields:

| **Name**                               | **Type**                                                                                                                 | **Description**                                                                                                                  |
| -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- |
| id<mark style="color:red;">\*</mark>   | string                                                                                                                   | Item ID; can not be empty and can only include alphanumeric characters, underscores and hyphens                                  |
| type<mark style="color:red;">\*</mark> | string                                                                                                                   | [Item schema](/product-discovery/sending-and-managing-product-data/what-is-the-items-api/working-with-items/item-schema.md) name |
| context                                | string                                                                                                                   | Context (store ID, private sales...); can only include alphanumeric characters, underscores and hyphens                          |
| timestamp                              | [RFC 3339 Internet date/time format](https://www.rfc-editor.org/rfc/rfc3339#section-5.6), e.g. `1985-04-12T23:20:50.52Z` | Defaults to current time stamp; allows ordering insertion, modification, and deletion operations on the same item                |

{% code title="Sample request body:" %}

```json
[{
  "id": "id1",
  "type": "product"
}]
```

{% endcode %}

## Batch ingestion <a href="#batch-ingestion" id="batch-ingestion"></a>

Ingesting a batch in a catalog will:

* Validate all items in the batch against catalog item schema
* Check that the absolute and relative number of items that pass validation is above the optionally provided threshold
* Insert all items that passed validation in the provided catalog
* Optionally promote the catalog

<mark style="color:blue;">`POST`</mark> `https://items.attraqt.io/batch-imports/ingestions`

This allows you to ingest a batch.

**Query Parameters**

| **Name**                                      | **Type** | **Description**     |
| --------------------------------------------- | -------- | ------------------- |
| tenant<mark style="color:red;">\*</mark>      | string   | Your tenant ID      |
| environment<mark style="color:red;">\*</mark> | string   | Your environment ID |

**Headers**

| **Name**                                        | **Description**                                                                                                     |
| ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | [Bearer token](/product-discovery/sending-and-managing-product-data/what-is-the-items-api/authorization-to-apis.md) |
| Content-Type<mark style="color:red;">\*</mark>  | `application/json`                                                                                                  |

**Request body**

| **Name**                                         | **Type** | **Default value**     | **Description**                                                                                                                   |
| ------------------------------------------------ | -------- | --------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| batchImportId                                    | string   | default catalog batch | batch ID returned by the batch creation call; leave empty when ingesting the default catalog batch                                |
| catalogVersion<mark style="color:red;">\*</mark> | string   |                       | version of the catalog in which the batch must be ingested                                                                        |
| minItemCount                                     | number   | 0                     | Minimum number of items in the batch that should pass schema validation; ingestion will fail if this threshold is not reached     |
| minSuccessRatePercent                            | number   | 0                     | Minimum percentage of items in the batch that should pass schema validation; ingestion will fail if this threshold is not reached |
| source                                           | string   | empty string          | Source of items in the batch, can be any string; this field is only meaningful when used in conjunction with `deleteMissingItems` |
| deleteMissingItems                               | boolean  | `false`               | whether items with same `source` present in the catalog but not present in the batch must be deleted                              |
| promoteCatalogOnCompletion                       | boolean  | `false`               | whether the catalog must be promoted after having been loaded                                                                     |

**Response body**

| **Name** | **Type** | **Description**                                                 |
| -------- | -------- | --------------------------------------------------------------- |
| id       | string   | batch ingestion ID; can be used to query batch ingestion status |

## Get batch import ingestion <a href="#get-batch-import-ingestion" id="get-batch-import-ingestion"></a>

<mark style="color:green;">`GET`</mark> `https://items.attraqt.io/batch-imports/ingestions/{id}`

This allows you to retrieve the status of a batch ingestion.

**Path Parameters**

| **Name**                             | **Type** | **Description**                     |
| ------------------------------------ | -------- | ----------------------------------- |
| id<mark style="color:red;">\*</mark> | string   | ID of batch import ingestion to get |

**Query Parameters**

| **Name**                                      | **Type** | **Description**     |
| --------------------------------------------- | -------- | ------------------- |
| tenant<mark style="color:red;">\*</mark>      | string   | Your tenant ID      |
| environment<mark style="color:red;">\*</mark> | string   | Your environment ID |

**Headers**

| **Name**                                        | **Description**                                                                                                     |
| ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | [Bearer token](/product-discovery/sending-and-managing-product-data/what-is-the-items-api/authorization-to-apis.md) |

**Response body**

| **Name**                                        | **Type**                                                                                 | **Required**                                                                                      | **Description**                                                                                                                                                                                                                          |
| ----------------------------------------------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id<mark style="color:red;">\*</mark>            | string                                                                                   | yes                                                                                               | Batch ingestion ID                                                                                                                                                                                                                       |
| status<mark style="color:red;">\*</mark>        | string                                                                                   | yes                                                                                               | <p>Results in one of the following:</p><ul><li><code>RUNNING</code></li><li><code>SUCCESS</code></li><li><code>FAILURE</code> (invalid batch, e.g. quality threshold was not met)</li><li><code>ERROR</code>(unexpected error)</li></ul> |
| statusReason                                    | string                                                                                   | if `status` is `FAILURE` or `ERROR`                                                               | Reason why the ingestion failed or errored                                                                                                                                                                                               |
| itemErrorCount                                  | number                                                                                   | if `status` is `SUCCESS` or `FAILURE`                                                             | Number of items that didn’t pass validation                                                                                                                                                                                              |
| itemErrorsSummary                               | object                                                                                   | if `status` is `SUCCESS` or `FAILURE`                                                             | Number of errors by error type, with some Sample error IDs                                                                                                                                                                               |
| upsertedItemCount                               | number                                                                                   | if `status` is `SUCCESS`                                                                          | Number of items that were either inserted or updated in the catalog                                                                                                                                                                      |
| deletedItemCount                                | number                                                                                   | if `status` is `SUCCESS` and batch ingestion was launched with `deleteMissingItems` set to `true` | Number of items that were deleted from the catalog                                                                                                                                                                                       |
| duration                                        | string                                                                                   | if `status` is `SUCCESS` or `FAILURE`                                                             | Duration of batch ingestion in seconds                                                                                                                                                                                                   |
| createdAt<mark style="color:red;">\*</mark>     | [RFC 3339 Internet date/time format](https://www.rfc-editor.org/rfc/rfc3339#section-5.6) | yes                                                                                               | Creation timestamp                                                                                                                                                                                                                       |
| updatedAt<mark style="color:red;">\*</mark>     | [RFC 3339 Internet date/time format](https://www.rfc-editor.org/rfc/rfc3339#section-5.6) | yes                                                                                               | Last time batch ingestion status was updated                                                                                                                                                                                             |
| configuration<mark style="color:red;">\*</mark> | object                                                                                   | yes                                                                                               | Batch ingestion configuration; format is the same as batch ingestion creation request body                                                                                                                                               |

{% hint style="warning" %}
Fredhopper currently does not support loading batches into active catalogs. If you try to ingest a batch into the active catalog of a Fredhopper client, it will result in an HTTP 400 error.
{% endhint %}

{% hint style="warning" %}
You can only ingest one batch into a given catalog at any given time. If you try to load a batch into a catalog which already has a running batch ingestion, it will result in an HTTP 409 error. Once the first ingestion is complete, you can launch another into the same catalog.
{% endhint %}

{% hint style="warning" %}
Catalogs cannot be promoted during an active batch ingestion. If you try to do so, it will result in an HTTP 409 error.
{% endhint %}

## List batch import ingestions <a href="#list-batch-import-ingestions" id="list-batch-import-ingestions"></a>

<mark style="color:green;">`GET`</mark> `https://items.attraqt.io/batch-imports/ingestions`

This allows you to get the status for all ingestions.

**Query Parameters**

| **Name**                                 | **Type** | **Description**                                                                                                                                   |
| ---------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| tenant<mark style="color:red;">\*</mark> | string   | Your tenant ID                                                                                                                                    |
| environment                              | string   | The environment for which you want to list ingestions. This parameter can be set multiple times, or none to fetch ingestions for all environments |
| lookback\_duration                       | number   | Time window in milliseconds, going back from now                                                                                                  |
| status                                   | string   | Filters ingestions by their status. Possible values: `RUNNING`, `SUCCESS`, `ERROR`, `FAILURE`                                                     |

**Headers**

| **Name**        | **Description**                                                                                                     |
| --------------- | ------------------------------------------------------------------------------------------------------------------- |
| Authorization\* | [Bearer token](/product-discovery/sending-and-managing-product-data/what-is-the-items-api/authorization-to-apis.md) |

**Response body**

The response body lists all batch ingestions for the active tenant and environment and has the same format as the [Get batch import ingestion ](#get-batch-import-ingestion)response body.

## Delete a batch ingestion <a href="#batch-deletion" id="batch-deletion"></a>

Batches will be automatically deleted seven days after their creation date, but they can be deleted earlier if they are not longer needed.

<mark style="color:red;">`DELETE`</mark> `https://items.attraqt.io/batch-imports/ingestions/{id}`

This allows you to delete a certain batch.

**Path Parameters**

| **Name**                             | **Type** | **Description**                        |
| ------------------------------------ | -------- | -------------------------------------- |
| id<mark style="color:red;">\*</mark> | string   | ID of batch import ingestion to delete |

**Query Parameters**

| **Name**                                      | **Type** | **Description**     |
| --------------------------------------------- | -------- | ------------------- |
| tenant<mark style="color:red;">\*</mark>      | string   | Your tenant ID      |
| environment<mark style="color:red;">\*</mark> | string   | Your environment ID |

**Headers**

| **Name**                                        | **Description**                                                                                                     |
| ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | [Bearer token](/product-discovery/sending-and-managing-product-data/what-is-the-items-api/authorization-to-apis.md) |

[^1]: A tenant represents a customer or group of customers using Product Discovery features. It is a distinct entity with its own users, service accounts, environments and specific configurations. This allows for the segmentation and management of resources and permissions in an isolated and secure way for each customer or group of customers.

[^2]: An environment is a distinct entity within a tenant, representing a specific configuration for the deployment and use of the Product Discovery features on customer side. It is used to separate different instances or versions of the application according to the customer’s needs, whether these relate to the development, test or production phase. Some customers may have a specific environment for each country in which they operate.


---

# Agent Instructions: 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:

```
GET https://crownpeak.gitbook.io/product-discovery/sending-and-managing-product-data/what-is-the-items-api/working-with-items/items/using-the-batch-items-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
