# Intercom

Attify reads Intercom through its API, read-only, with OAuth or an API token, for customer support. It is the customer's own system, so what Attify reads there is connected data: the strongest provenance, and what a vendor verification rests on.

## As a help desk, for customer support

| Stored            | Intercom                                                                    |
|-------------------|-----------------------------------------------------------------------------|
| id                | conversation `id`                                                           |
| started_at        | `created_at` (unix seconds)                                                 |
| updated_at        | `updated_at`, the sync cursor                                               |
| customer          | `contacts.contacts[0].id`, else the opening message's author id             |
| channel           | `source.delivered_as`, else `source.type`                                   |
| claim             | `ai_agent.resolution_state`, read as Intercom sets it, only when            |
|                   | `ai_agent_participated` is true: assumed_resolution and                     |
|                   | confirmed_resolution claim a resolution; any other state claims none;       |
|                   | no AI agent means no vendor claim (the reconstructed claim applies)         |
| messages          | the opening (`source`) and every part with a body except notes, oldest first|
| messages[].role   | `author.type` user, lead or contact: the customer; admin, bot: support      |
| messages[].author | "ai" when the part's `author.from_ai_agent` or `author.is_ai_answer` is     |
|                   | true (Fin); "human" for an admin. Other bot parts (rule-based automations,  |
|                   | Operator) are left out: they are neither the AI agent nor a person          |
| reopens           | a customer message or an `open` part after a `close` part                   |
