# Actualizar tarea

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

This reference is generated from the API’s code, so descriptions are in Spanish. Names, parameters and examples are the same in every language.

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

Permission required

`tasks:write`

Required header

`X-API-Key` · secret key

Access level

Level 3 · with support review

## Path parameters

1 · required

`id` string · **required**

ID de la tarea

## Headers

1 · all optional

`Idempotency-Key` string · optional

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

## Body (JSON)

17 · all optional

`title` string · optional

2–200 chars

`description` string · optional

≤ 2000 chars · nullable

`type` string · optional

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

`status` string · optional

PENDING · IN_PROGRESS · COMPLETED · CANCELLED · OVERDUE

`priority` string · optional

LOW · MEDIUM · HIGH · URGENT

`dueDate` string · optional

nullable

**See the other 11 parameters**

`dueAt` string · optional

nullable

`dueOn` string · optional

nullable

`hasDueTime` boolean · optional

`remindMinutesBefore` integer · optional

0–10080 · nullable

`assigneeId` string · optional

nullable

`dealId` string · optional

nullable

`contactId` string · optional

nullable

`propertyId` string · optional

nullable

`recurrence` string · optional

DAILY · WEEKLY · MONTHLY · WEEKDAYS · nullable

`recurrenceUntil` string · optional

nullable

`attachments` object[] · optional

## Response 200

`Task` · 18 fields

**`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

## Possible errors

shaped as `{ "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()
```

**Response · 200 · example**

```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"
    }
  }
}
```
