Zendesk Integration

Zendesk Integration

Connect Zendesk to TR-AI via webhook and API token for automated ticket resolution.

Note:TR-AI supports two Zendesk auth methods: API Token (email + token) and OAuth (Client ID + Secret). API Token is simpler for most setups. OAuth is preferred when you want token rotation without storing a personal email.

Credentials required

FieldWhere to find itAuth method
SubdomainYour Zendesk URL prefix — e.g. acme from acme.zendesk.comBoth
EmailYour Zendesk admin email addressAPI Token only
API TokenAdmin Center → Apps & Integrations → APIs → Zendesk API → API Tokens → Add API TokenAPI Token only
Client IDAdmin Center → Apps & Integrations → APIs → OAuth Clients → Client IDOAuth only
Client SecretAdmin Center → Apps & Integrations → APIs → OAuth Clients → Client SecretOAuth only
Tip:For API Token auth, the email must belong to an agent or admin in your Zendesk account. Token access must be enabled: Admin Center → Apps & Integrations → APIs → Zendesk API → Settings → Token Access = ON.

Step 1 — Enter credentials in TR-AI

In your TR-AI Dashboard, open the Zendesk card. Enter your subdomain and either your Email + API Token, or your OAuth Client ID + Client Secret. Click Save. TR-AI will verify the credentials immediately.

Step 2 — Create a Zendesk webhook

  1. 1
    Open Webhook creation
    Go to Admin Center → Apps & Integrations → Webhooks → Create webhook. Select Trigger or automation as the connection type.
  2. 2
    Configure the endpoint

    Use your scoped webhook URL — this avoids routing ambiguity when multiple trials exist:

    Webhook endpoint URL
    https://ticketresolve.ai/api/integrations/zendesk/webhook/{your-trial-id}

    Set Method = POST, Request format = JSON.

  3. 3
    Save the webhook
    Click Create webhook. Copy the webhook ID — you will need it when creating triggers.

Step 3 — Create two Zendesk triggers

TR-AI requires two triggers: one for new tickets and one for customer follow-up replies. Both send to the same webhook URL.

Trigger 1 — New ticket

  1. 1
    Create the trigger
    Go to Admin Center → Objects and rules → Business rules → Triggers → Add trigger.
  2. 2
    Set conditions
    Under Meet ALL of the following conditions, add: Update type | Is | Created.
  3. 3
    Set action
    Under Actions, add Notify active webhook, select your TR-AI webhook, and paste this JSON body:
New ticket trigger body
{
  "ticket_id":      "{{ticket.id}}",
  "subject":        "{{ticket.title}}",
  "description":    "{{ticket.latest_comment.value}}",
  "latest_comment": "{{ticket.latest_comment.value}}",
  "requester_name": "{{ticket.requester.name}}"
}

Trigger 2 — Customer follow-up reply

When a customer replies to a solved ticket, Zendesk automatically reopens it (status → open). This trigger fires on that transition.

  1. 1
    Create the trigger
    Add a second trigger named TR-AI — process customer follow-up reply.
  2. 2
    Set conditions
    Add ALL three conditions:
    • Update type | Is | Changed
    • Status | Is | Open
    • Comment is public | Is | True
  3. 3
    Set action
    Notify active webhook with the same TR-AI webhook and this body:
Follow-up trigger body
{
  "ticket_id":      "{{ticket.id}}",
  "subject":        "{{ticket.title}}",
  "description":    "{{ticket.description}}",
  "latest_comment": "{{ticket.latest_comment.value}}",
  "requester_name": "{{ticket.requester.name}}"
}
Tip:TR-AI detects follow-ups by comparing latest_comment with description. When they differ, it answers only the new message — not the original ticket description.

How TR-AI routes webhook payloads

TR-AI resolves the correct trial account in this order:

  • URL param (preferred): :trialId in the webhook URL — always use the scoped URL.
  • Body field: account_id or subdomain matched against your configured subdomain.
  • Single-trial fallback: if only one active Zendesk trial exists, it is used automatically.

Triage behaviour

When TR-AI cannot auto-resolve a ticket (confidence below threshold), it:

  • Posts a public acknowledgement reply to the customer.
  • Moves the ticket to a group named Triage if one exists in your Zendesk account — otherwise adds a triage tag.
  • Leaves the ticket status as open so agents see it in their queue.
  • Sends a Slack notification if a Slack webhook URL is configured.

Supported body shapes

TR-AI accepts two Zendesk trigger body formats:

FormatFields
Flat (recommended)ticket_id, subject, description, latest_comment, requester_name, account_id
Nested{ ticket: { id, subject, description, requester: { name } } }, account_id