> ## Documentation Index
> Fetch the complete documentation index at: https://api.contractia.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuración

El webhook se configura exclusivamente en el momento de [creación de la tarea](/platform/api-tareas) mediante la API REST de Contractia.

<Note>
  No es posible agregar, editar ni eliminar el webhook de una tarea ya existente.
</Note>

Cada tarea admite una URL de webhook independiente, lo que permite enrutar notificaciones a distintos endpoints según el flujo de negocio.

***

## Campo webhook en la creación de tarea

### 💻 Ejemplo de implementación

<CodeGroup>
  ```json true theme={null}
  "webhook": {
    "enabled": true,
    "url": "https://tu-dominio.com/webhook-handler"
  }
  ```

  ```json false theme={null}
  "webhook": null
  ```

  ```json Ejemplo completo de creación de tarea theme={null}
  {
    "referencia": "string",
    "secuencial": true,
    "submission_id": "string",
    "notificacion_tarea": {
      "asunto": "string",
      "body": "string"
    },
    "remitente": {
      "remitente_nombre": "string",
      "remitente_email": "string"
    },
    "expiration_date": "2025-01-01T00:00:00.000Z",
    "webhook": {
      "enabled": true,
      "url": "https://tu-dominio.com/webhook-handler"
    },
    "reminder": {
      "frequency": 0,
      "unit": "string"
    },
    "merge_documents": true
  }
  ```
</CodeGroup>

***

## Tipos de Eventos

Contractia emite dos tipos de eventos a través del webhook:

| `event_type`                   | Descripción                                                                                                                      |
| :----------------------------- | :------------------------------------------------------------------------------------------------------------------------------- |
| `TASK_STATUS_CHANGED`          | El estado general de la tarea cambió (ej.: pasó a "Concluída" o "En progreso").                                                  |
| `PARTICIPATION_STATUS_CHANGED` | El estado de un participante cambió. Actualmente solo se emite cuando una participación requiere validación manual en el portal. |
