# User settings

## settings object

```json
{
  "time_zone": "Europe/Amsterdam",
  "locale": "nl_NL",
  "measurement_system": "metric",
  "date_format": "ddMMyyyy_dots",
  "hour_mode": "TWENTY_FOUR_HOURS",
  "geocoder": "osm",
  "route_provider": "google",
  "translit": false
}
```

* `time_zone` - [enum](/docs/navixy-api/user-api/backend-api.md#data-types). ISO timezone ID.
* `locale` - [enum](/docs/navixy-api/user-api/backend-api.md#data-types). Locale code.
* `measurement_system` - [enum](/docs/navixy-api/user-api/backend-api.md#data-types). Measurement system. Can be "metric", "imperial", "us", "metric\_gal\_us" or "nautical".
* `date_format` - Optional [enum](/docs/navixy-api/user-api/backend-api.md#data-types). Date representation. Can be "ddMMyyyy\_dots"("dd.MM.yyyy", "01.12.2021"), "ddMMyyyy\_slashes"("dd/MM/yyyy", "01/12/2021"), "MMddyyyy\_hyphens"("MM-dd-yyyy", "12-01-2021"), "yyyyMMdd\_hyphens"("yyyy-MM-dd", "2021-12-01"), "dMMMy"("d MMM y", "1 Dec 2021") or "dMMMMy"("d MMMM y", "1 December 2021")
* `hour_mode` - Optional [enum](/docs/navixy-api/user-api/backend-api.md#data-types). Time representation. Can be "TWENTY\_FOUR\_HOURS" (24-hour clock, "HH:mm" or "HH:mm:ss", "17:45"/"17:45:46") or "TWELVE\_HOURS" (12-hour clock, "h:mm a" or "h:mm:ss a", "5:45 PM"/"5:45:46 PM")
* `geocoder` - [enum](/docs/navixy-api/user-api/backend-api.md#data-types). Preferred geocoder type. Can be "google", "yandex", "progorod", "osm" or "locationiq".
* `route_provider` - [enum](/docs/navixy-api/user-api/backend-api.md#data-types). Preferred route finding provider. Can be "google", "progorod" or "osrm".
* `translit` - boolean. `true` if sms notification should be transliterated, `false` otherwise.

`balance_alert_settings` type is JSON object:

```json
{
  "emails": ["email1@example.com", "email2@example.com"]
}
```

* `emails` - string array. List of emails to send alert message about balance. Empty array means disclaimer of notifications.

`file_storage_settings` type is JSON object:

```json
{
  "auto_overwrite": true
}
```

* `auto_overwrite` - boolean. If `true` new files will replace old ones when file storage is full. Default is `false`.

## API actions

API path: `/user/settings`.

### read

Reads current user's settings.

#### Parameters

Only API key `hash`.

#### Examples

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

```sh
curl -X POST 'https://api.eu.navixy.com/v2/user/settings/read' \
    -H 'Content-Type: application/json' \
    -d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b"}'
```

{% endtab %}

{% tab title="HTTP GET" %}
{% code overflow="wrap" %}

```http
https://api.eu.navixy.com/v2/user/settings/read?hash=a6aa75587e5c59c32d347da438505fc3
```

{% endcode %}
{% endtab %}
{% endtabs %}

#### Response

```json
{
  "success": true,
  "settings": {
    "time_zone": "Europe/Amsterdam",
    "locale": "nl_NL",
    "measurement_system": "metric",
    "geocoder": "osm",
    "route_provider": "google",
    "translit": false
  },
  "file_storage_settings": {
    "auto_overwrite": true
  },
  "balance_alert_settings": {
    "emails": ["email1@example.com", "email2@example.com"]
  },
  "first_user_balance_warning_period": "7d",
  "second_user_balance_warning_period": "2d"
}
```

* `first_user_balance_warning_period` - string. The first interval to send alert. "7d" means send the first alert warning 7 days before.
* `second_user_balance_warning_period` - string. The second interval to send alert. Send the second alert warning n days before.
* Where `settings`, `balance_alert_settings` and `file_storage_settings` described above.

**required sub-user rights** for `balance_alert_settings` and `file_storage_settings` fields: `admin` (available only to master users).

### update

Update current user's settings.

**required sub-user rights** for `balance_alert_settings` and `file_storage_settings`: `admin` (available only to master users).

#### Parameters

| name                     | description                                                                             | type                                                        |
| ------------------------ | --------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
| time\_zone               | ISO timezone ID.                                                                        | [enum](/docs/navixy-api/user-api/backend-api.md#data-types) |
| locale                   | Locale code.                                                                            | [enum](/docs/navixy-api/user-api/backend-api.md#data-types) |
| measurement\_system      | Measurement system. Can be "metric", "imperial", "us", "metric\_gal\_us" or "nautical". | [enum](/docs/navixy-api/user-api/backend-api.md#data-types) |
| geocoder                 | Preferred geocoder type. Can be "google", "yandex", "progorod", "osm" or "locationiq".  | [enum](/docs/navixy-api/user-api/backend-api.md#data-types) |
| route\_provider          | Preferred route finding provider. Can be "google", "progorod" or "osrm".                | [enum](/docs/navixy-api/user-api/backend-api.md#data-types) |
| translit                 | `true` if sms notification should be transliterated, `false` otherwise.                 | boolean                                                     |
| balance\_alert\_settings | Object containing array of emails.                                                      | JSON object                                                 |
| file\_storage\_settings  | Object containing file storage settings.                                                | JSON object                                                 |

#### Example

cURL

{% code overflow="wrap" %}

```sh
curl -X POST 'https://api.eu.navixy.com/v2/user/settings/update' \
    -H 'Content-Type: application/json' \
    -d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b", "time_zone": "Europe/Amsterdam", "locale": "nl_NL", "measurement_system": "metric", "geocoder": "osm", "route_provider": "google", "translit": false, "balance_alert_settings": {"emails": ["email1@example.com", "email2@example.com"]}, "file_storage_settings": {"auto_overwrite": true}}'
```

{% endcode %}

#### Response

```json
{
  "success": true
}
```

#### Errors

* [General](/docs/navixy-api/user-api/backend-api/errors.md#error-codes) types only.

### file\_storage/update

Updates current user's file storage settings.

**required sub-user rights:** `admin` (available only to master users).

#### Parameters

| name                    | description                              | type        |
| ----------------------- | ---------------------------------------- | ----------- |
| file\_storage\_settings | Object containing file storage settings. | JSON object |

#### Example

cURL

{% code overflow="wrap" %}

```sh
curl -X POST 'https://api.eu.navixy.com/v2/user/settings/file_storage/update' \
    -H 'Content-Type: application/json' \
    -d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b", "file_storage_settings": {"auto_overwrite": true}}'
```

{% endcode %}

#### Errors

* 13 – Operation not permitted – if user has insufficient rights.


---

# 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://navixy.com/docs/navixy-api/user-api/backend-api/resources/commons/user/settings/index.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.
