Fuente: https://crm.begraffic.com/docs/api
Índice para agentes: [llms.txt](https://crm.begraffic.com/llms.txt)

# GET /api/v1/tasks

URL base: https://crm.begraffic.com. Autenticación: Authorization: Bearer <CLAVE_V1_bcrm_...>.

Definición OpenAPI de la operación (los bloques schema son esquemas, no cuerpos de ejemplo):

```json
{
  "operationId": "tasks.list",
  "summary": "Listar tareas",
  "description": "De un contacto (`leadId`) o del workspace: abiertas por vencimiento (`status=open`, con `assignedToEmail` opcional), hechas (`status=done`) o todas.",
  "tags": [
    "Actividades y tareas"
  ],
  "x-scope": "activities:read",
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "parameters": [
    {
      "name": "leadId",
      "in": "query",
      "required": false,
      "description": "Tareas de un contacto.",
      "schema": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200,
        "pattern": "^[^/]+$"
      }
    },
    {
      "name": "assignedToEmail",
      "in": "query",
      "required": false,
      "schema": {
        "type": "string",
        "format": "email"
      }
    },
    {
      "name": "status",
      "in": "query",
      "required": false,
      "description": "Sin él, todas por fecha de vencimiento.",
      "schema": {
        "type": "string",
        "enum": [
          "open",
          "done"
        ]
      }
    },
    {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "Elementos por página (1–100, por defecto 50).",
      "schema": {
        "type": "string",
        "pattern": "^\\d+$"
      }
    },
    {
      "name": "cursor",
      "in": "query",
      "required": false,
      "description": "`nextCursor` de la página anterior (opaco).",
      "schema": {
        "type": "string",
        "maxLength": 2048
      }
    }
  ],
  "responses": {
    "200": {
      "description": "Página de resultados.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "data",
              "nextCursor"
            ],
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "leadId": {
                      "type": "string"
                    },
                    "leadName": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "title": {
                      "type": "string"
                    },
                    "content": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "type": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "priority": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "dueAt": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "doneAt": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "assignedToEmail": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "assignedToName": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "dealId": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "leadId",
                    "leadName",
                    "title",
                    "content",
                    "type",
                    "priority",
                    "dueAt",
                    "doneAt",
                    "assignedToEmail",
                    "assignedToName",
                    "dealId",
                    "createdAt"
                  ]
                }
              },
              "nextCursor": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          }
        }
      }
    },
    "400": {
      "description": "`invalid_request`: Petición inválida (cuerpo, parámetros o consulta).",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "401": {
      "description": "`unauthorized`: Falta la clave, no existe, está revocada o caducó.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "403": {
      "description": "`insufficient_scope`: La clave no tiene el alcance que exige la ruta.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "404": {
      "description": "`not_found`: No existe (o no es de este workspace).",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "429": {
      "description": "`rate_limited`: Demasiadas llamadas (límite por clave y minuto). Ver `Retry-After`.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "500": {
      "description": "`internal`: Error interno.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    }
  }
}
```
