# Crear tarea

POST `https://api.bydomu.com/v1/tasks`

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

Crea una tarea suelta o vinculada a un negocio o a un contacto. Respeta el tope de tareas del plan (`403 PLAN_LIMIT_REACHED`). Responde solo el `id`: pide `GET /tasks/{id}` para el detalle.

Permission required

`tasks:write`

Required header

`X-API-Key` · secret key

Access level

Level 3 · with support review

## 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)

16 · 1 required

`title` string · **required**

2–200 chars

`description` string · optional

≤ 2000 chars

`type` string · optional

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

`priority` string · optional

LOW · MEDIUM · HIGH · URGENT · default "MEDIUM"

`dueDate` string · optional

nullable

`dueAt` string · optional

nullable

**See the other 10 parameters**

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

`object` · 1 fields

**`data` id**

`id` 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 POST "https://api.bydomu.com/v1/tasks" \
  -H "X-API-Key: $BYDOMU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "title": "Llamar a María para confirmar la visita",
  "type": "CALL",
  "priority": "HIGH",
  "dueDate": "2026-10-01T15:00:00.000Z",
  "assigneeId": "clx1usr001",
  "contactId": "clx1con001"
}'
```

JavaScript:

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

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

const { data } = await bydomu.tasks.create({
  "title": "Llamar a María para confirmar la visita",
  "type": "CALL",
  "priority": "HIGH",
  "dueDate": "2026-10-01T15:00:00.000Z",
  "assigneeId": "clx1usr001",
  "contactId": "clx1con001"
});
```

Python:

```python
import os, requests

r = requests.post(
    "https://api.bydomu.com/v1/tasks",
    headers={"X-API-Key": os.environ["BYDOMU_API_KEY"]},
    json={
        "title": "Llamar a María para confirmar la visita",
        "type": "CALL",
        "priority": "HIGH",
        "dueDate": "2026-10-01T15:00:00.000Z",
        "assigneeId": "clx1usr001",
        "contactId": "clx1con001"
    }
)
data = r.json()
```

**Response · 201 · example**

```json
{
  "data": {
    "id": "clx1tsk001"
  }
}
```
