# Actualizar tarea

PATCH `https://api.bydomu.com/v1/tasks/{id}`

Esta referência é gerada a partir do código da API, por isso as descrições estão em espanhol. Nomes, parâmetros e exemplos são iguais em qualquer idioma.

Actualiza solo los campos enviados. Cerrar una tarea es enviar `status: "COMPLETED"`.

Permissão pedida

`tasks:write`

Cabeçalho obrigatório

`X-API-Key` · chave secreta

Nível de acesso

Nível 3 · com revisão do suporte

## Parâmetros de rota

1 · obrigatórios

`id` string · **obrigatório**

ID de la tarea

## Cabeçalhos

1 · todos opcionais

`Idempotency-Key` string · opcional

Clave única de la operación (8-128 caracteres de `[a-zA-Z0-9._:-]`). Un reintento con la misma clave y el mismo cuerpo devuelve la respuesta original sin repetir la operación. Vive 24 horas. 8–128 chars

## Corpo (JSON)

17 · todos opcionais

`title` string · opcional

2–200 chars

`description` string · opcional

≤ 2000 chars · nullable

`type` string · opcional

CALL · EMAIL · WHATSAPP · VISIT · MEETING · SEND_PROPOSAL · SEND_CONTRACT · FOLLOW_UP · SCHEDULE_SHOWING · COLLECT_DOCUMENTS · OTHER

`status` string · opcional

PENDING · IN_PROGRESS · COMPLETED · CANCELLED · OVERDUE

`priority` string · opcional

LOW · MEDIUM · HIGH · URGENT

`dueDate` string · opcional

nullable

**Ver os outros 11 parâmetros**

`dueAt` string · opcional

nullable

`dueOn` string · opcional

nullable

`hasDueTime` boolean · opcional

`remindMinutesBefore` integer · opcional

0–10080 · nullable

`assigneeId` string · opcional

nullable

`dealId` string · opcional

nullable

`contactId` string · opcional

nullable

`propertyId` string · opcional

nullable

`recurrence` string · opcional

DAILY · WEEKLY · MONTHLY · WEEKDAYS · nullable

`recurrenceUntil` string · opcional

nullable

`attachments` object[] · opcional

## Resposta 200

`Task` · 18 campos

**`data` id · title · description · type · status · priority · dueDate · completedAt · archivedAt · attachments · dealId · contactId · assigneeId · createdById · createdAt · updatedAt · assignee · createdBy**

`id` string

`title` string

`description` string

`type` string CALL, EMAIL, WHATSAPP, VISIT, MEETING, SEND_PROPOSAL

`status` string PENDING, IN_PROGRESS, COMPLETED, CANCELLED, OVERDUE

`priority` string LOW, MEDIUM, HIGH, URGENT

`dueDate` string

`completedAt` string

`archivedAt` string

`attachments` any Adjuntos: `[{ url, name, size? }]`

`dealId` string

`contactId` string

`assigneeId` string

`createdById` string

`createdAt` string

`updatedAt` string

**`assignee` id · firstName · lastName**

`id` string

`firstName` string

`lastName` string

**`createdBy` id · firstName · lastName**

`id` string

`firstName` string

`lastName` string

## Erros possíveis

com a forma `{ "error": { "code", "message" } }`

- **400** Datos inválidos: el cuerpo o la query no cumplen el esquema, o `Idempotency-Key` está mal formada.
- **401** UNAUTHORIZED
- **402** PAYMENT_REQUIRED
- **403** FORBIDDEN
- **404** NOT_FOUND
- **409** DUPLICATE
- **429** RATE_LIMITED
- **500** INTERNAL_ERROR

cURL:

```bash
curl -X PATCH "https://api.bydomu.com/v1/tasks/clx1tsk001" \
  -H "X-API-Key: $BYDOMU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "status": "COMPLETED"
}'
```

JavaScript:

```js
import { ByDomu } from "@bydomu/sdk";

const bydomu = new ByDomu({
  apiKey: process.env.BYDOMU_API_KEY,
});

const { data } = await bydomu.tasks.update("clx1tsk001", {
  "status": "COMPLETED"
});
```

Python:

```python
import os, requests

r = requests.patch(
    "https://api.bydomu.com/v1/tasks/clx1tsk001",
    headers={"X-API-Key": os.environ["BYDOMU_API_KEY"]},
    json={
        "status": "COMPLETED"
    }
)
data = r.json()
```

**Resposta · 200 · exemplo**

```json
{
  "data": {
    "id": "clx1tsk001",
    "title": "Llamar a María para confirmar la visita",
    "description": "Confirmar el jueves a las 10.",
    "type": "CALL",
    "status": "PENDING",
    "priority": "LOW",
    "dueDate": "2026-10-01T15:00:00.000Z",
    "completedAt": "2026-10-01T14:40:00.000Z",
    "archivedAt": "2026-10-15T00:00:00.000Z",
    "attachments": [],
    "dealId": "clx1deal001",
    "contactId": "clx1con001",
    "assigneeId": "clx1usr001",
    "createdById": "clx1usr002",
    "createdAt": "2026-09-25T10:00:00.000Z",
    "updatedAt": "2026-09-25T10:00:00.000Z",
    "assignee": {
      "id": "clx1usr001",
      "firstName": "Carlos",
      "lastName": "Rodríguez"
    },
    "createdBy": {
      "id": "clx1usr001",
      "firstName": "Carlos",
      "lastName": "Rodríguez"
    }
  }
}
```
