# Desasignar zonas a dispositivo

Este endpoint permite desasignar zonas a un dispositivo. <br>

<mark style="color:red;">`DELETE`</mark> `https://api.persat.com.ar/v1/devices/`<mark style="color:purple;">`:device_id`</mark>`/zones`

#### Headers

| Name          | Type   | Description      |
| ------------- | ------ | ---------------- |
| Content-Type  | string | application/json |
| Authorization | string | Bearer API\_KEY  |

#### Path parameters

| Name                                          | Type   | Description                                                       |
| --------------------------------------------- | ------ | ----------------------------------------------------------------- |
| :device\_id<mark style="color:red;">\*</mark> | number | Identificador del dispositivo al cual le quiero asignar las zonas |

#### Request Body

| Name                                        | Type      | Description                                                                        |
| ------------------------------------------- | --------- | ---------------------------------------------------------------------------------- |
| zone\_ids<mark style="color:red;">\*</mark> | number\[] | Array con enteros. Cada uno de los enteros es el id de la zona que quiero asignar. |

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

```javascript
{
    "success": true,
    "data": {}
}
```

{% endtab %}

{% tab title="404: Dispositivo no encontrado" %}

```javascript
{
    "success": false,
    "error": {
        "status": 404,
        "type": "NOT_FOUND",
        "userMessage": "No existe un device con este id: 14213123"
    }
}
```

{% endtab %}
{% endtabs %}

### Ejemplo de Request

Ejemplo de body, en donde desasignamos las zonas 1,2 y 3 del dispositvo

```json
{
        "zone_ids": [1,2,3]
}
```

### Analizando la Respuesta

La respuesta, en caso que la consulta sea exitosa es la siguiente

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

**data.** Es un Json vacio

{% hint style="info" %}
Si alguna de las zonas ya estaba desasignada, se continúa con la siguiente, sin que este hecho se registre como un error.

Si ocurre un error en alguna de las zonas, se cancela toda la operación quedando sin efecto la request.
{% endhint %}


---

# 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://docs.api.persat.com.ar/entidades-basicas/zonas-de-trabajo/asignar-zonas/desasignar-zonas-a-dispositivo.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.
