# Eventos de webhook admitidos en Intertel Conversa

Intertel Conversa publica varios eventos en los puntos finales de webhook configurados. Cada evento tiene su estructura de payload según el tipo de modelo sobre el que actúan. La siguiente sección describe los principales objetos que usamos en Intertel Conversa y sus atributos.

## Objetos <a href="#objects" id="objects"></a>

Un evento puede contener cualquiera de los siguientes objetos como payload. Los diferentes tipos de objetos admitidos en Intertel Conversa son los siguientes:

### Cuenta <a href="#account" id="account"></a>

El siguiente payload se devolverá para una cuenta.

```
{
  "id": "integer",
  "name": "string"
}
```

### Bandeja de entrada <a href="#inbox" id="inbox"></a>

El siguiente payload se devolverá para una bandeja de entrada.

```
{
  "id": "integer",
  "name": "string"
}
```

### Contacto <a href="#contact" id="contact"></a>

Se devolverá el siguiente payload para un contacto.

```
{
  "id": "integer",
  "name": "string",
  "avatar": "string",
  "type": "contact",
  "account": {
    // <...Account Object>
  }
}
```

### Usuario <a href="#user" id="user"></a>

Se devolverá el siguiente payload para un agente/administrador.

```
{
  "id": "integer",
  "name": "string",
  "email": "string",
  "type": "user"
}
```

### Conversación <a href="#conversation" id="conversation"></a>

Se devolverá el siguiente payload para una conversación.

```
{
  "additional_attributes": {
    "browser": {
      "device_name": "string",
      "browser_name": "string",
      "platform_name": "string",
      "browser_version": "string",
      "platform_version": "string"
    },
    "referer": "string",
    "initiated_at": {
      "timestamp": "iso-datetime"
    }
  },
  "can_reply": "boolean",
  "channel": "string",
  "id": "integer",
  "inbox_id": "integer",
  "contact_inbox": {
    "id": "integer",
    "contact_id": "integer",
    "inbox_id": "integer",
    "source_id": "string",
    "created_at": "datetime",
    "updated_at": "datetime",
    "hmac_verified": "boolean"
  },
  "messages": ["Array of message objects"],
  "meta": {
    "sender": {
      // Contact Object
    },
    "assignee": {
      // User Object
    }
  },
  "status": "string",
  "unread_count": "integer",
  "agent_last_seen_at": "unix-timestamp",
  "contact_last_seen_at": "unix-timestamp",
  "timestamp": "unix-timestamp",
  "account_id": "integer"
}
```

### Mensaje <a href="#message" id="message"></a>

```
{
  "id": "integer",
  "content": "string",
  "message_type": "integer",
  "created_at": "unix-timestamp",
  "private": "boolean",
  "source_id": "string / null",
  "content_type": "string",
  "content_attributes": "object",
  "sender": {
    "type": "string - contact/user"
    // User or Contact Object
  },
  "account": {
    // Account Object
  },
  "conversation": {
    // Conversation Object
  },
  "inbox": {
    // Inbox Object
  }
}
```

### Webhook payload <a href="#a-sample-webhook-payload" id="a-sample-webhook-payload"></a>

```
{
  "event": "event_name"
  // Attributes related to the event
}
```

## Eventos de webhook <a href="#webhook-events" id="webhook-events"></a>

Intertel Conversa admite los siguientes eventos de webhook. Puede suscribirse a ellos mientras configura un webhook en el tablero o usa la API.

### conversation\_created <a href="#conversation_created" id="conversation_created"></a>

Este evento se activará cuando se cree una nueva conversación en la cuenta. El payload para el evento es el siguiente:

```
{
  "event": "conversation_created"
  // <...Conversation Attributes>
}
```

### conversation\_updated <a href="#conversation_updated" id="conversation_updated"></a>

Este evento se activará cuando haya un cambio en cualquiera de los atributos de la conversación.

```
{
  "event": "conversation_updated",
  "changed_attributes": [
    {
      "<attribute_name>": {
        "current_value": "",
        "previous_value": ""
      }
    }
  ]
  // <...Conversation Attributes>
}
```

### conversation\_status\_changed <a href="#conversation_status_changed" id="conversation_status_changed"></a>

Este evento se activará cuando se cambie el estado de la conversación.

{% hint style="info" %}
Si usa API de bot de agente en lugar de webhooks, este evento aún **NO** es compatible.
{% endhint %}

```
{
  "event": "conversation_status_changed"
  // <...Conversation Attributes>
}
```

### message\_created <a href="#message_created" id="message_created"></a>

Este evento se activará cuando se cree un mensaje en una conversación. El payload para el evento es el siguiente:

```
{
  "event": "message_created"
  // <...Message Attributes>
}
```

### message\_updated <a href="#message_updated" id="message_updated"></a>

Este evento se activará cuando se actualice un mensaje en una conversación. El payload para el evento es el siguiente:

```
{
  "event": "message_updated"
  // <...Message Attributes>
}
```

### webwidget\_triggered <a href="#webwidget_triggered" id="webwidget_triggered"></a>

Este evento se activará cuando el usuario final abra el widget de Live Chat.

```
{
  "id": ,
  "contact": {
    // <...Contact Object>
  },
  "inbox": {
    // <...Inbox Object>
  },
  "account": {
    // <...Account Object>
  },
  "current_conversation": {
    // <...Conversation Object>
  },
  "source_id": "string",
  "event": "webwidget_triggered",
  "event_info": {
    "initiated_at": {
      "timestamp": "date-string"
    },
    "referer": "string",
    "widget_language": "string",
    "browser_language": "string",
    "browser": {
      "browser_name": "string",
      "browser_version": "string",
      "device_name": "string",
      "platform_name": "string",
      "platform_version": "string"
    }
  }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.intertelconversa.com/recursos/webhooks/eventos-admitidos-webhook.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
