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

# Handoff & Sync

> How conversations move from AI to your HubSpot reps: ticket creation, contact sync, CRM context, and OAuth workflow actions.

After you [connect HubSpot](/integrations/hubspot/connect), this is what happens day-to-day when the AI escalates a conversation.

## How handoff lands in HubSpot

```mermaid theme={"dark"}
flowchart LR
  A[Customer message] --> B[AI replies]
  B --> C{AI can resolve?}
  C -- Yes --> D[Session closes]
  C -- No --> E[Handoff]
  E --> F[HubSpot ticket created]
  F --> G[Rep works the ticket]
```

When the AI decides to escalate:

1. **Contact lookup** — OpenCX searches HubSpot for a contact matching the customer's email. Creates one if none exists.
2. **Ticket created** — A HubSpot ticket is opened with the conversation summary and full transcript. The ticket is associated with the contact.
3. **Handoff comment** — An internal comment is posted on the HubSpot conversation with the AI's reason for escalating, detected sentiment, language, and a link back to the OpenCX session.
4. **Assignment** — The ticket is assigned to the default user configured during [setup](/integrations/hubspot/connect), or to a specific rep if your routing rules specify one.
5. **Custom data pushed** — Any custom data on the OpenCX session syncs to the ticket as HubSpot properties.

<Note>
  Ticket creation can be disabled per organization. When disabled, conversations still hand off but no HubSpot ticket is created. Contact your OpenCX admin to toggle this.
</Note>

## Rep replies sync back

For **web chat** and **email** channels, rep replies flow through HubSpot's conversations inbox and reach the customer on the same channel they wrote in. Internal comments stay private — only public replies are delivered.

For **WhatsApp**, **SMS**, and **phone** channels, HubSpot receives the ticket for visibility. Reps follow up through the [OpenCX inbox](https://platform.open.cx/inbox) or contact the customer directly.

## OAuth event behavior

OAuth installs register the HubSpot app webhook automatically. OpenCX acts on customer messages, ticket property changes, HubSpot agent replies, ownership changes, and help-desk notes. Unrecognized events are ignored.

**Conversation ownership matters.** If a HubSpot conversation is owned by a user other than your configured AI user, OpenCX stops replying. Reassign to the AI user to resume, or enable [Assist Mode](#assist-mode).

**Email has a 5-second delay** so other OpenCX workflows (drafting, signatures) finish first. Other channels process immediately.

<Card title="Webhook Reference" icon="webhook" href="/integrations/hubspot/webhooks">
  Full inbound envelope shape, per-event skip rules, and the HubSpot API calls OpenCX makes on handoff, reply, and close.
</Card>

## CRM context panel

When HubSpot is connected as a CRM, the OpenCX inbox shows the customer's HubSpot record on handoff:

* **Contact details** — name, email, phone number, contact owner
* **Company** — associated company name, domain, industry, size
* **Deals** — active and past deals with stage, amount, and close date
* **Previous tickets** — support history with subjects and status

<Note>
  The CRM context panel requires a separate connection at [**Settings → CRMs**](https://platform.open.cx/settings/crms). This is read-only access to HubSpot data — distinct from the ticketing integration at Settings → Integrations.
</Note>

## Contact sync

OpenCX keeps contacts in sync with HubSpot:

* **On first contact** — When a customer first writes in, OpenCX searches HubSpot by email. If found, the contact is linked. If not, a new HubSpot contact is created.
* **Custom data** — Ticket properties sync bidirectionally. Changes your reps make on the HubSpot ticket flow back to the OpenCX session, and custom data on the session pushes to the ticket.

OpenCX only syncs properties that exist in your HubSpot schema — invalid or missing fields are skipped silently.

## Assist mode

<Warning>
  **Assist Mode is a discouraged fallback.** We recommend [autopilot](/handoff/introduction) for every new deployment — Assist exists only for teams that aren't yet ready to hand customer replies to the AI.
</Warning>

When Assist Mode is enabled in [Autopilot](https://platform.open.cx/settings/autopilot) settings, the AI posts drafts as internal comments instead of replying publicly, leaves the conversation unassigned, and keeps tickets open for the rep to resolve.

## Good to know

<AccordionGroup>
  <Accordion title="Disabling ticket creation" icon="toggle-off">
    Ticket creation is on by default. Contact support if you need it disabled for your organization — conversations still hand off to reps in the OpenCX inbox, HubSpot just won't receive a ticket.
  </Accordion>

  <Accordion title="Tickets close on resolution" icon="circle-check">
    When an OpenCX session resolves, the associated HubSpot ticket is moved to the closed pipeline stage. The ticket summary and detected sentiment are added to the ticket content. Closing is delayed by \~15 seconds to stay within HubSpot API limits.
  </Accordion>
</AccordionGroup>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Connect HubSpot" icon="plug" href="/integrations/hubspot/connect">
    OAuth setup, AI sender, workflow actions.
  </Card>

  <Card title="Troubleshooting" icon="wrench" href="/integrations/hubspot/troubleshooting">
    Connection failures, missing tickets, reply sync issues.
  </Card>

  <Card title="Autopilot" icon="sliders" href="/handoff/topics">
    Control which topics the AI resolves vs escalates.
  </Card>

  <Card title="Human Handoff" icon="user-group" href="/handoff/introduction">
    Global handoff settings and escalation rules.
  </Card>
</CardGroup>
