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

# Zendesk integration

> Open a Zendesk ticket after every completed call: TL;DR subject, summary and next steps in the first comment, tagged for your views and triggers.

The Zendesk integration opens a ticket for every completed call: the TL;DR
is the subject, the summary and next steps are the first comment, and tags
mark it as a PyAI recap or AMD outcome so your existing views and triggers
route it like any human-written ticket.

## What you need

* A **Zendesk API token**: **Admin Center → Apps and integrations → APIs →
  Zendesk API** → **Add API token** → copy it.
* The **agent email** the token belongs to (tickets are created as that
  agent).
* Your **account host** (`yourcompany.zendesk.com`; entering just
  `yourcompany` works too).

## Connect

1. In PyAI Console, open **Integrations** and find **Zendesk** under Support.
2. Click **Connect**, enter the account host, agent email, and API token, and
   pick your events.
3. Press **Test**. A sample ticket opens so you can check it against your
   views.
4. Done. Tickets open after every completed call.

## What lands

```
Ticket
Subject: Customer asked to reschedule Friday's installation
Tags:    pyai, recap
First comment:
The customer called to move their appointment. The agent offered
Tuesday or Wednesday morning; the customer chose Wednesday 9-11am.

Next steps: Confirm the new slot by SMS and update the calendar invite.
```

AMD tickets carry the verdict and confidence in the subject (useful for
reviewing how outbound campaigns are answered).

## Troubleshooting

* **Error: 401.** Wrong email/token pair, or the token was deleted. Create a
  fresh API token for the same agent and update the connection.
* **Error: 403.** The agent lacks ticket-create permission in Zendesk.
* **Tickets missing from a view.** They are tagged `pyai` + `recap` or `amd`;
  add the tag filter to the view, or add a trigger that routes them.
* **Wrong requester.** Tickets default to the token's agent as requester. If
  you need a different model (end-user requester), route calls through the
  Zapier integration and shape tickets in the Zap.
