# Working status list

Contains status listing object and API calls to interact with status listings. Status listings are lists of possible\
statuses that can be assigned to trackers.

## Status listing object structure

```json
{
  "id": 1,
  "label": "Taxi driver statuses",
  "employee_controlled": true,
  "supervisor_controlled": false,
  "entries": [5, 2, 1, 4, 6]
}
```

* `id` - int. A unique identifier of this working status list. Read-only.
* `label` - string. Human-readable label for the working status list.
* `employee_controlled` - boolean. If `true` employees can change their own working status, e.g. using mobile tracking app.
* `supervisor_controlled` - boolean. If `true` supervisors can change working status, e.g. using mobile monitoring app.
* `entries` - int array. List of IDs of working statuses which belong to this list. Order matters, and is preserved.

## API actions

API base path: `/status/listing/`.

### create

Creates new empty working status list.

**required sub-user rights:** `tracker_update`.

#### Parameters

| name    | description                                                                                   | type        |
| ------- | --------------------------------------------------------------------------------------------- | ----------- |
| listing | [status\_listing](#status-listing-object-structure) object without "id" and "entries" fields. | JSON object |

#### Examples

cURL

{% code overflow="wrap" %}

```sh
curl -X POST 'https://api.eu.navixy.com/v2/status/listing/create' \
    -H 'Content-Type: application/json' \
    -d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b", "listing": {"label": "Taxi driver statuses", "employee_controlled": false, "supervisor_controlled": true}'
```

{% endcode %}

#### Response

```json
{
  "success": true,
  "id": 111
}
```

* `id` - int. ID of the created working status list.

#### Errors

* 236 - Feature unavailable due to tariff restrictions – if there are no trackers with "statuses" tariff feature\
  available.
* 268 - Over quota – if the user's quota for working status lists exceeded.

### delete

Deletes working status list.

**required sub-user rights:** `tracker_update`.

#### Parameters

| name        | description                                                 | type |
| ----------- | ----------------------------------------------------------- | ---- |
| listing\_id | ID of the working status list for this status to attach to. | int  |

#### Examples

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

```sh
curl -X POST 'https://api.eu.navixy.com/v2/status/listing/delete' \
    -H 'Content-Type: application/json' \
    -d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b", "listing_id": 12345}'
```

{% endtab %}

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

```http
https://api.eu.navixy.com/v2/status/listing/delete?hash=a6aa75587e5c59c32d347da438505fc3&listing_id=12345
```

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

#### Response

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

#### Errors

* 201 - Not found in the database – if working status list with the specified ID does not exist.
* 236 - Feature unavailable due to tariff restrictions – if there are no trackers with "statuses" tariff feature\
  available.

### list

Gets working status lists belonging to authorized user.

#### Parameters

Only API key `hash`.

#### Examples

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

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

{% endtab %}

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

```http
https://api.eu.navixy.com/v2/status/listing/list?hash=a6aa75587e5c59c32d347da438505fc3
```

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

#### Response

```json
{
  "success": true,
  "list": [
    {
      "id": 1,
      "label": "Taxi driver statuses",
      "employee_controlled": true,
      "supervisor_controlled": false,
      "entries": [5, 2, 1, 4, 6]
    }
  ]
}
```

* `list` - ordered array of [status\_listing](#status-listing-object-structure) objects.

#### Errors

* 236 - Feature unavailable due to tariff restrictions – if there are no trackers with "statuses" tariff feature\
  available.

### update

Updates working status list properties.

**required sub-user rights:** `tracker_update`.

`entries` field allows changing order of statuses attached to this working status list.

#### Parameters

| name    | description                                                                                | type        |
| ------- | ------------------------------------------------------------------------------------------ | ----------- |
| listing | [status\_listing](#status-listing-object-structure) object with "id" and "entries" fields. | JSON object |

#### Examples

cURL

{% code overflow="wrap" %}

```sh
curl -X POST 'https://api.eu.navixy.com/v2/status/listing/update' \
    -H 'Content-Type: application/json' \
    -d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b", "listing": {"id": 12345, "label": "Taxi driver statuses", "employee_controlled": false, "supervisor_controlled": true, "entries": [ 5, 2, 1, 4, 6]}'
```

{% endcode %}

#### Response

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

#### Errors

* 201 - Not found in the database – if working status list with the specified ID does not exist.
* 236 - Feature unavailable due to tariff restrictions – if there are no trackers with "statuses" tariff feature\
  available.
* 262 - Entries list is missing some entries or contains nonexistent entries – if entries does not contain full set of\
  status IDs associated with this working status list, or if it contains nonexistent status IDs.


---

# 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/tracking/status/listing/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.
