> For the complete documentation index, see [llms.txt](https://navixy.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://navixy.com/docs/navixy-api/user-api/guides/field-service-management/change-task-statuses.md).

# Changing employee statuses

Employee statuses track the current activity of employees via their tracking devices. Examples include "busy" and "not busy." Each tracker can have a different status list assigned.

## Create

To manage employee activities effectively, create working status lists and assign them to devices. For instance, a status list for a delivery service allows drivers and supervisors to change their working status using the X-GPS app or the UI.

To create a working status list, use the `status/listing/create` method. You need to provide the `listing` parameter, which is a [status\_listing](/docs/navixy-api/user-api/resources/tracking/status/listing.md#status-listing-object-structure) object without the "id" and "entries" fields.

### Example request to create a working status list

{% code title="cURL" %}

```shell
curl --request POST \
  --url 'https://api.eu.navixy.com/v2/status/listing/create' \
  --header 'Content-Type: application/json' \
  --data '{
        "hash": "22eac1c27af4be7b9d04da2ce1af111b",
        "listing": {
            "label": "Delivery_service",
            "employee_controlled": true,
            "supervisor_controlled": true
        }
    }'
```

{% endcode %}

### Example response

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

Next, add individual working statuses to the list. For example, you might have the following statuses: "Free," "Break," "Pick up the goods from storage," and "Deliver goods."

### Example request to add a working status

{% code title="cURL" %}

```shell
curl --request POST \
  --url 'https://api.eu.navixy.com/v2/status/create' \
  --header 'Content-Type: application/json' \
  --data '{
        "hash": "22eac1c27af4be7b9d04da2ce1af111b",
        "listing_id": 1111,
        "status": {
            "label": "Free",
            "color": "E57373"
        }
    }'
```

{% endcode %}

### Example response

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

Repeat the above request for each working status you need to add to the list.

## Assign

To assign the working status list to devices, use the `tracker_id` and `listing_id`.

### Example request to assign a status list to a tracker

{% code title="cURL" %}

```shell
curl --request POST \
  --url 'https://api.eu.navixy.com/v2/status/listing/tracker/assign' \
  --header 'Content-Type: application/json' \
  --data '{
        "hash": "22eac1c27af4be7b9d04da2ce1af111b",
        "tracker_id": 615487,
        "listing_id": 111
    }'
```

{% endcode %}

### Example response

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

## Usage

Once assigned, drivers and supervisors can change working statuses. Here are some use cases:

1. **Automated Task Assignment:** Create a script to assign a new task to a driver with the working status "Free." After assigning the task, the script changes the working status to "Pick up the goods from storage."
2. **Task Completion:** When a task is completed, a script changes the working status to "Free" and retrieves fields from the ERP system to create a new task and assign it to the driver.

This flexible system allows for efficient management of employee activities and can be integrated with various business processes for automation.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://navixy.com/docs/navixy-api/user-api/guides/field-service-management/change-task-statuses.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
