# Alteração de estado da rota

## Atualizar o status de uma rota

> Atualizar o status de uma rota, incluindo todas as suas entregas.

```json
{"openapi":"3.0.0","info":{"title":"API Shippify","version":"1.0.0"},"servers":[{"url":"https://api.shippify.co","description":"Servidor de desenvolvimento"}],"security":[{"Basic_Auth":[]}],"components":{"securitySchemes":{"Basic_Auth":{"type":"http","scheme":"basic"}},"schemas":{"changeStatus":{"successfulResponse":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}},"request":{"type":"object","required":["status","comment","author"],"properties":{"status":{"description":"Novo status da rota","type":"string","enum":["pending_to_review","processing","broadcasting","assigned","confirmed_to_pickup","going_to_pickup","at_pickup","on_delivery","going_to_dropoff","at_dropoff","dropped_off","completed","canceled","going_to_return","at_return_point","returned","not_picked_up","not_picked_up_payable","hold_by_courier"]},"comment":{"type":"string","description":"Comentário da mudança"},"reasonByCompany":{"type":"array","description":"Razões predefinidas para a mudança de status","items":{"type":"object","required":["reasonId","reason"],"properties":{"reasonId":{"type":"integer","description":"Identifier of the reason for changing the status"},"reason":{"type":"string","description":"Name of the reason for changing the status"}}}},"author":{"type":"object","required":["id","type","name","email"],"description":"Informações do usuário que faz a mudança de status","properties":{"type":{"type":"string","description":"Tipo de usuário","enum":["operator","admin"]},"id":{"type":"integer","description":"Identificador do usuário"},"name":{"type":"string","description":"Nome do usuário"},"email":{"type":"string","description":"Email do usuário"}}}}}},"Unauthenticated":{"properties":{"code":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"paths":{"/v1/routes/{id}/status":{"patch":{"tags":["Routes"],"summary":"Atualizar o status de uma rota","description":"Atualizar o status de uma rota, incluindo todas as suas entregas.","responses":{"200":{"description":"Operação bem-sucedida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/changeStatus/successfulResponse"}}}},"401":{"description":"Não autorizado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Unauthenticated"}}}}},"parameters":[{"name":"id","in":"path","description":"Identifier of the route to change its status.","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/changeStatus/request"}}}}}}}}
```

## Casos de uso

<details>

<summary>Cancelar rota</summary>

```json
{
    "status": "canceled",
    "comment": "",
    "author": {
        "type": "operator",
        "id": 1149,
        "name": "Developers",
        "email": "developers@shippify.co"
    }
}
```

</details>

<details>

<summary>Completar rota</summary>

```json
{
    "status": "completed",
    "comment": "",
    "author": {
        "type": "operator",
        "id": 1149,
        "name": "Developers",
        "email": "developers@shippify.co"
    }
}
```

</details>


---

# 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.shippify.co/developers/pt/shippify-api/rotas/alteracao-de-estado-da-rota.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.
