# Tarefas

Tarefas atribuídas aos usuários em campo, incluindo anexos, produtos, serviços e custos adicionais associados. É o recurso central para orquestrar o trabalho operacional na plataforma.

## Consultar tarefa

 - [GET /tasks/{id}](https://developer.auvo.com.br/openapi/api-reference/tarefas/retrieve-a-task.md): The "taskStatus" task return attribute has the following return values:

* Opened = 1

* InDisplacement = 2

* CheckedIn = 3

* CheckedOut = 4

* Finished = 5

* Paused = 6

## Editar tarefa

 - [PATCH /tasks/{id}](https://developer.auvo.com.br/openapi/api-reference/tarefas/edit-a-task.md): To update a Task, send a JSONPatchDocument with updated value for one or more of the TaskPatch attributes.
JsonPatch example: { "op": "replace", "path": "orientation", "value": "New orientation" }

## Excluir tarefa

 - [DELETE /tasks/{id}](https://developer.auvo.com.br/openapi/api-reference/tarefas/delete-a-task.md): Removes a Task from your account by its unique identifier. This operation cannot be undone.

## Adicionar nova tarefa

 - [POST /tasks](https://developer.auvo.com.br/openapi/api-reference/tarefas/add-a-new-task.md): The body example describes the minimum required attributes to successfully add a task. See the Attributes or Json Schema in the Example section for all allowed attributes.

The task address will preferably be obtained through the client's address.
If the customer ID was not informed, the data will be captured by the parameters of the register itself.
When the latitude and longitude are not informed, the Auvo API will attempt to obtain this information through the address you provided.

## Criar ou atualizar tarefa

 - [PUT /tasks](https://developer.auvo.com.br/openapi/api-reference/tarefas/upsert-add-a-new-task-or-update-an-existing-one.md): Update or register a new task according to one of its identifier, id OR externalId. If there is no task with the provided identifier, create a new task, if it exists, update it. Returns HTTP status code 200 if the task was updated and 201 if it was created.

## Listar tarefas

 - [GET /tasks](https://developer.auvo.com.br/openapi/api-reference/tarefas/retrieve-a-list-of-tasks.md): Maximum page size is 100.

## Criar ou atualizar anexos da tarefa

 - [PUT /tasks/{id}/attachments](https://developer.auvo.com.br/openapi/api-reference/tarefas/upsert-task-attachments.md): Add or replace attachments on a task.

## Criar ou atualizar produtos da tarefa

 - [PUT /tasks/{id}/products](https://developer.auvo.com.br/openapi/api-reference/tarefas/upsert-task-products.md): Add or update products on a task.

## Excluir produtos da tarefa

 - [DELETE /tasks/{id}/products](https://developer.auvo.com.br/openapi/api-reference/tarefas/delete-task-products.md): Remove products from a task by providing a list of product GUIDs.

## Criar ou atualizar serviços da tarefa

 - [PUT /tasks/{id}/services](https://developer.auvo.com.br/openapi/api-reference/tarefas/upsert-task-services.md): Add or update services on a task.

## Excluir serviços da tarefa

 - [DELETE /tasks/{id}/services](https://developer.auvo.com.br/openapi/api-reference/tarefas/delete-task-services.md): Remove services from a task by providing a list of service GUIDs.

## Criar ou atualizar custos adicionais da tarefa

 - [PUT /tasks/{id}/additional-costs](https://developer.auvo.com.br/openapi/api-reference/tarefas/upsert-task-additional-costs.md): Add or update additional costs on a task.

## Excluir custos adicionais da tarefa

 - [DELETE /tasks/{id}/additional-costs](https://developer.auvo.com.br/openapi/api-reference/tarefas/delete-task-additional-costs.md): Remove additional costs from a task by providing a list of additional cost GUIDs.

## Criar ou atualizar resposta de questionário da tarefa

 - [PUT /tasks/{id}/questionnaire-response](https://developer.auvo.com.br/openapi/api-reference/tarefas/upsert-task-questionnaire-responses.md): Cria ou atualiza uma resposta de questionário vinculada a uma tarefa.

O processamento é assíncrono. Uma resposta 202 Accepted significa que a resposta foi validada, enfileirada e deve estar disponível na tarefa em até 5 minutos. Isso não garante que o registro final da tarefa já tenha sido atualizado no momento do retorno.

Envie uma resposta por requisição. A resposta é criada ou atualizada para a instância de questionário identificada por itemID, codigoChecklist e codigoPergunta; quando o mesmo checklist estiver vinculado à tarefa mais de uma vez, use um itemID diferente para cada instância. Use codigoEquipamento quando a resposta pertencer a um equipamento específico da tarefa.

## Listar tarefas excluídas

 - [GET /tasks/GetDeletedTasks](https://developer.auvo.com.br/openapi/api-reference/tarefas/retrieve-a-list-of-deleted-tasks.md): Returns deleted tasks. Maximum page size is 100. Same parameters and response format as the task listing endpoint above.

