# POST /{environment}/searches/completions

> Current Froomle documentation · [View canonical page](https://docs.froomle.com/froomle-doc-main/v2/api_reference/search/operations/post_completion_with_env.html)

<a id="_description"></a>

## Description

Request completions with the advanced payload that supports multi-environment setups.

<a id="_parameters"></a>

## Parameters

| Type | Name | Description | Schema |
| --- | --- | --- | --- |
| **Path** | **environment**<br>_required_ | The environment for which the request is made. | string |
| **Body** | **body**<br>_required_ | Completion payload. | [CompletionRequest](https://docs.froomle.com/froomle-doc-main/v2/api_reference/search/operations/post_completion_with_env.html#_completionrequest) |

<a id="_responses"></a>

## Responses

| HTTP Code | Description | Schema |
| --- | --- | --- |
| **200** | OK | [Completion](https://docs.froomle.com/froomle-doc-main/v2/api_reference/search/operations/post_completion_with_env.html#_completion) |

<a id="_consumes"></a>

## Consumes

-   `application/json`
    

<a id="_produces"></a>

## Produces

-   `application/json`
    

* * *

<a id="_search_item"></a>

### Item

One content item returned by the Search API.

| Name | Description | Schema |
| --- | --- | --- |
| **information\_field**<br>_required_ | Optional metadata field configured per customer. | string |
| **item\_id**<br>_required_ | Identifier of the item in your catalog. | string |
| **type**<br>_required_ | Document type of the returned object. | string |

<a id="_search_list"></a>

### List

Represents a grouped subset of search results.

| Name | Description | Schema |
| --- | --- | --- |
| **grouped\_by**<br>_optional_ | Values of the `group_by` keys shared by every item in the list. | < string > array |
| **items**<br>_optional_ | Items contained in this list. | < [Item](https://docs.froomle.com/froomle-doc-main/v2/api_reference/search/operations/post_completion_with_env.html#_search_item) > array |
| **limit**<br>_optional_ | Number of items returned in this list. | integer |
| **list\_key**<br>_optional_ | Identifier that lets you re-fetch remaining items. | string |
| **list\_name**<br>_optional_ | Server-generated name of the list. | string |
| **list\_size**<br>_optional_ | Total number of cached items for this list. | integer |

<a id="_search_filter"></a>

### Filter

Key-value filters applied to search requests.

| Name | Description | Schema |
| --- | --- | --- |
| **<field>**<br>_optional_ | Field name/value pairs that determine which items are allowed. Configured per customer. | string |

<a id="_search_histories"></a>

### Histories

Map of custom histories that describe past user interactions.

| Name | Description | Schema |
| --- | --- | --- |
| **<history\_name>**<br>_optional_ | Array of recent events used for personalization. | < [HistoryItem](https://docs.froomle.com/froomle-doc-main/v2/api_reference/search/operations/post_completion_with_env.html#_search_historyitem) > array |

<a id="_search_historyitem"></a>

### HistoryItem

Single interaction tuple used inside histories.

| Name | Description | Schema |
| --- | --- | --- |
| **id**<br>_required_ | Identifier of the entity referenced by the event. | string |
| **timestamp**<br>_optional_ | Unix timestamp (seconds). | integer |
| **item\_type**<br>_optional_ | Type of the entity (e.g., item, article, category). | string |
| **reconsumable**<br>_optional_ | Whether the entity can be recommended again. | boolean |

<a id="_completionrequest"></a>

### CompletionRequest

Body accepted by the advanced completions endpoint.

| Name | Description | Schema |
| --- | --- | --- |
| **fuzziness**<br>_optional_ | Maximum edit distance when matching queries (default: `0`). | integer |
| **filter\_by**<br>_optional_ | Filters applied before generating completions. | [Filter](https://docs.froomle.com/froomle-doc-main/v2/api_reference/search/operations/post_completion_with_env.html#_search_filter) |
| **q**<br>_optional_ | Partial query string. | string |
| **user\_id**<br>_optional_ | User identifier. | string |
| **device\_id**<br>_optional_ | Device identifier. | string |
| **histories**<br>_optional_ | Interaction histories used to personalize results. | [Histories](https://docs.froomle.com/froomle-doc-main/v2/api_reference/search/operations/post_completion_with_env.html#_search_histories) |

<a id="_completion"></a>

### Completion

Payload returned by the completions endpoints.

| Name | Description | Schema |
| --- | --- | --- |
| **completions**<br>_required_ | List of suggested terms. | < [Item](https://docs.froomle.com/froomle-doc-main/v2/api_reference/search/operations/post_completion_with_env.html#_search_item) > array |
| **request\_id**<br>_required_ | Identifier of the completion request. | integer |
| **user\_group**<br>_optional_ | Experiment group the user belongs to. | string |
