> For the complete documentation index, see [llms.txt](https://fredhopper.gitbook.io/product-discovery/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fredhopper.gitbook.io/product-discovery/sending-and-managing-product-data/what-is-the-items-api/working-with-items/item-schema/defaultlocale-api.md).

# DefaultLocale API

XO features (recommendation, product tagging) need a default locale to work. This default locale is set by tenant/environment.

{% hint style="info" %}
[This API requires Authentication.](/product-discovery/sending-and-managing-product-data/what-is-the-items-api/authorization-to-apis.md)
{% endhint %}

## Set the default locale

<mark style="color:green;">`POST`</mark> `https://items.attraqt.io/locale/{locale}`

#### Query Parameters

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

#### Headers

| Name                                             | Type   | Description                  |
| ------------------------------------------------ | ------ | ---------------------------- |
| Authentication<mark style="color:red;">\*</mark> | string | Authentication bearer token. |

{% tabs %}
{% tab title="200 " %}

```
{}
```

{% endtab %}

{% tab title="400: Bad Request Query parameter missing, or Locale not valid" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Locale format is based on the Java locale format: \<language\_code>\_\<country\_code> The language code is based on the [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) and the country code is defined by [ISO 3166](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes)
{% endhint %}

## Get the default locale

<mark style="color:blue;">`GET`</mark> `https://items.attraqt.io/locale`

This endpoint allows you to get the default locale.

#### Query Parameters

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

#### Headers

| Name                                             | Type   | Description           |
| ------------------------------------------------ | ------ | --------------------- |
| Authentication<mark style="color:red;">\*</mark> | string | Authentication token. |

{% tabs %}
{% tab title="200 " %}

```
{
    "tenant": {tenant},
    "environment": {environment}
    "locale": {locale}
}
```

{% endtab %}

{% tab title="400: Bad Request Query parameter missing" %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## Delete the default locale

<mark style="color:red;">`DELETE`</mark> `https://items.attraqt.io/locale`

#### Query Parameters

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

#### Headers

| Name                                             | Type   | Description          |
| ------------------------------------------------ | ------ | -------------------- |
| Authentication<mark style="color:red;">\*</mark> | string | Authentication token |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}

{% tab title="400: Bad Request Query parameter missing" %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}
