# Tickets: webhook y Linear

Lleva los tickets a tu sistema con su webhook propio o conéctalos con Linear.

Guía Todos los planes Sin clave de API

## Dónde se configura

En ByDomu, Configuración › Canales e integraciones › Tickets: Linear y webhook. Funciona en todos los planes y no pide clave de API: lo configura alguien del equipo desde el panel. Es un webhook normal (misma firma, misma cola con reintentos, mismo registro de entregas) suscrito solo a ticket.*.

## Conecta tu sistema con el webhook

- Pega la dirección (https://…) de tu servidor, de Jira o Zendesk por medio de tu propio puente, o de Zapier, Make o n8n.
- Elige los eventos. Por defecto van ticket.created, ticket.status_changed y ticket.resolved; ticket.updated y ticket.note_added se marcan aparte.
- Copia el secreto y guárdalo en tu sistema para verificar X-Domu-Signature. Puedes volver a verlo o rotarlo; al rotarlo, el anterior deja de servir en el acto.
- «Enviar una prueba» manda una entrega con X-Webhook-Test: true y data.message; abajo ves las últimas entregas con su código de respuesta.

Cuándo sale Evento

Se creó un ticket. Trae el ticket (con el enlace al panel) y el contacto, si lo tiene. `ticket.created`

Cambió el título, el resumen, la prioridad, el responsable o las etiquetas. changedFields dice cuáles. `ticket.updated`

El ticket cambió de estado (PENDING, IN_PROGRESS o RESOLVED). previousStatus trae el anterior. `ticket.status_changed`

Se agregó una nota interna al ticket, en ByDomu o como comentario en Linear (note.source). `ticket.note_added`

El ticket quedó resuelto. Sale junto con ticket.status_changed. `ticket.resolved`

## Qué llega en cada entrega

data.ticket trae el número y el código (T-0012), estado, prioridad, canal, etiquetas, responsable, el issue de Linear si existe y url, el enlace al ticket en el panel; data.contact, el contacto si lo tiene. Un cambio a RESOLVED manda ticket.status_changed y ticket.resolved: descarta repetidos por id.

**Entrega · ejemplo**

ticket.created:

```
{
  "event": "ticket.created",
  "id": "5f3a0c1e-7d2b-4f7e-9a51-0b6c1d2e3f40",
  "type": "ticket.created",
  "timestamp": "2026-09-22T14:30:00.000Z",
  "organizationId": "clx1org001",
  "actor": {
    "kind": "USER",
    "userId": "clx1usr001"
  },
  "data": {
    "ticket": {
      "id": "clx1tkt001",
      "number": 12,
      "code": "T-0012",
      "title": "No llegan las fotos al portal",
      "summary": "La clienta dice que la ficha P-0042 se ve sin fotos desde ayer.",
      "status": "PENDING",
      "priority": "HIGH",
      "channel": "WHATSAPP",
      "labels": [
        "Portales"
      ],
      "assignedToId": "clx1usr001",
      "assignedToName": "Andrés Mejía",
      "contactId": "clx1con001",
      "conversationId": "clx1cnv001",
      "linearIssueKey": null,
      "url": "https://www.bydomu.com/inbox/tickets/clx1tkt001",
      "resolvedAt": null,
      "createdAt": "2026-09-22T14:30:00.000Z",
      "updatedAt": "2026-09-22T14:30:00.000Z"
    },
    "contact": {
      "id": "clx1con001",
      "code": "C-0042",
      "firstName": "Laura",
      "lastName": "Restrepo",
      "fullName": "Laura Restrepo",
      "email": "laura.restrepo@example.com",
      "phone": "+573000000001",
      "source": "WEBSITE",
      "status": "QUALIFIED",
      "type": "CLIENT",
      "score": 72,
      "ownerId": "clx1usr001",
      "preferredCity": "Bogotá",
      "preferredType": "APARTMENT",
      "budget": 450000000,
      "currency": "COP",
      "tags": [
        "Compra",
        "Chapinero"
      ],
      "createdAt": "2026-09-20T15:04:00.000Z"
    }
  }
}
```

ticket.status_changed:

```
{
  "event": "ticket.status_changed",
  "id": "5f3a0c1e-7d2b-4f7e-9a51-0b6c1d2e3f40",
  "type": "ticket.status_changed",
  "timestamp": "2026-09-22T14:30:00.000Z",
  "organizationId": "clx1org001",
  "actor": {
    "kind": "USER",
    "userId": "clx1usr001"
  },
  "data": {
    "ticket": {
      "id": "clx1tkt001",
      "number": 12,
      "code": "T-0012",
      "title": "No llegan las fotos al portal",
      "summary": "La clienta dice que la ficha P-0042 se ve sin fotos desde ayer.",
      "status": "IN_PROGRESS",
      "priority": "HIGH",
      "channel": "WHATSAPP",
      "labels": [
        "Portales"
      ],
      "assignedToId": "clx1usr001",
      "assignedToName": "Andrés Mejía",
      "contactId": "clx1con001",
      "conversationId": "clx1cnv001",
      "linearIssueKey": null,
      "url": "https://www.bydomu.com/inbox/tickets/clx1tkt001",
      "resolvedAt": null,
      "createdAt": "2026-09-22T14:30:00.000Z",
      "updatedAt": "2026-09-22T15:00:00.000Z"
    },
    "contact": {
      "id": "clx1con001",
      "code": "C-0042",
      "firstName": "Laura",
      "lastName": "Restrepo",
      "fullName": "Laura Restrepo",
      "email": "laura.restrepo@example.com",
      "phone": "+573000000001",
      "source": "WEBSITE",
      "status": "QUALIFIED",
      "type": "CLIENT",
      "score": 72,
      "ownerId": "clx1usr001",
      "preferredCity": "Bogotá",
      "preferredType": "APARTMENT",
      "budget": 450000000,
      "currency": "COP",
      "tags": [
        "Compra",
        "Chapinero"
      ],
      "createdAt": "2026-09-20T15:04:00.000Z"
    },
    "previousStatus": "PENDING"
  }
}
```

ticket.note_added:

```
{
  "event": "ticket.note_added",
  "id": "5f3a0c1e-7d2b-4f7e-9a51-0b6c1d2e3f40",
  "type": "ticket.note_added",
  "timestamp": "2026-09-22T14:30:00.000Z",
  "organizationId": "clx1org001",
  "actor": {
    "kind": "USER",
    "userId": "clx1usr001"
  },
  "data": {
    "ticket": {
      "id": "clx1tkt001",
      "number": 12,
      "code": "T-0012",
      "title": "No llegan las fotos al portal",
      "summary": "La clienta dice que la ficha P-0042 se ve sin fotos desde ayer.",
      "status": "PENDING",
      "priority": "HIGH",
      "channel": "WHATSAPP",
      "labels": [
        "Portales"
      ],
      "assignedToId": "clx1usr001",
      "assignedToName": "Andrés Mejía",
      "contactId": "clx1con001",
      "conversationId": "clx1cnv001",
      "linearIssueKey": "SOP-128",
      "url": "https://www.bydomu.com/inbox/tickets/clx1tkt001",
      "resolvedAt": null,
      "createdAt": "2026-09-22T14:30:00.000Z",
      "updatedAt": "2026-09-22T15:10:00.000Z"
    },
    "contact": {
      "id": "clx1con001",
      "code": "C-0042",
      "firstName": "Laura",
      "lastName": "Restrepo",
      "fullName": "Laura Restrepo",
      "email": "laura.restrepo@example.com",
      "phone": "+573000000001",
      "source": "WEBSITE",
      "status": "QUALIFIED",
      "type": "CLIENT",
      "score": 72,
      "ownerId": "clx1usr001",
      "preferredCity": "Bogotá",
      "preferredType": "APARTMENT",
      "budget": 450000000,
      "currency": "COP",
      "tags": [
        "Compra",
        "Chapinero"
      ],
      "createdAt": "2026-09-20T15:04:00.000Z"
    },
    "note": {
      "body": "Ya reprocesamos las fotos; pedirle que recargue la página.",
      "author": "Andrés Mejía",
      "source": "bydomu"
    }
  }
}
```

Con una clave secreta y webhooks:write también puedes suscribir ticket.* (y ticket.suggested, cuando Noa propone abrir un ticket) desde la API, como cualquier otro evento.

## Conecta Linear

En la misma pantalla, Conectar con Linear abre la autorización de Linear para toda la inmobiliaria. Luego eliges el equipo, cuándo se crea el issue y cómo se corresponden estados y prioridades. Los issues y comentarios salen a nombre de la app, con el nombre de quien escribió en ByDomu; si lo activas, llevan la etiqueta «Desde ByDomu».

Qué Dirección

Crear el issue (Solo si lo marco al crear · Siempre · Nunca) `ByDomu → Linear`

Estado, prioridad, responsable, etiquetas y notas `ByDomu → Linear`

Cambios de estado y prioridad, comentarios nuevos `Linear → ByDomu`

Lo que cambia en Linear vuelve como eventos: ticket.status_changed, ticket.updated (changedFields: priority) y ticket.note_added con note.source = "linear". El cliente nunca ve Linear: solo ve el estado de su solicitud.

## Si algo falla

- **401** Tu sistema rechaza la firma: revisa que uses el secreto actual (¿lo rotaste?) y el cuerpo crudo.
- **5xx** Se reintenta y queda en las entregas recientes: Hasta 5 intentos (0 s, 5 s, 30 s, 2 min y 10 min) ante error de red, 429 o 5xx. Responde 2xx en menos de 10 s.
- **LIN** Los cambios hechos en Linear no llegan: la pantalla avisa si falta el webhook de la app de Linear. Lo que se hace en ByDomu sí llega a Linear.
