Freshdesk Integration
Connect Freshdesk to TR-AI via automation rules and API key.
X as password). No OAuth setup is required.Credentials required
| Field | Where to find it |
|---|---|
| Domain | Your Freshdesk subdomain — e.g. acme from acme.freshdesk.com. Enter only the subdomain, not the full URL. |
| API Key | Freshdesk → Profile Settings (top-right avatar) → Your API Key |
Step 1 — Enter credentials in TR-AI
In your TR-AI Dashboard, open the Freshdesk card. Enter your subdomain (e.g. acme) and your API key. Click Save. TR-AI will verify by calling GET /api/v2/agents/me.
Step 2 — Create a Freshdesk webhook
- 1Open WebhooksGo to Admin → Settings → Integrations → Webhooks → New Webhook.
- 2Configure the webhook
Set the following values:
Webhook settingsURL: https://ticketresolve.ai/api/integrations/freshdesk/webhook/{your-trial-id} Method: POST Content-Type: application/json - 3Set the JSON payloadPaste this body template:
{
"ticket_id": "{{ticket.id}}",
"subject": "{{ticket.subject}}",
"description": "{{ticket.description}}",
"latest_reply": "{{conversation.body}}",
"requester_name": "{{ticket.requester.name}}",
"requester_email":"{{ticket.requester.email}}",
"type": "{{action.type}}"
}type field tells TR-AI whether this is a new ticket (ticket_created) or a customer reply (reply_created). TR-AI uses this to answer only the new message on follow-ups, not the original description.Step 3 — Create automation rules
You need two automation rules: one for new tickets and one for customer replies.
Rule 1 — New ticket
- 1Create the ruleGo to Admin → Helpdesk Productivity → Automation → Ticket Creation. Click New Rule.
- 2Set conditions
Ticket → Source → Is → Email(or leave blank to match all channels). - 3Set actionAdd action: Trigger Webhook. Select your TR-AI webhook. Set Request type =
POST.
Rule 2 — Customer reply (follow-up)
- 1Create the ruleGo to Admin → Helpdesk Productivity → Automation → Ticket Updates. Click New Rule.
- 2Set conditions
Action performed by → RequesterandReply sent → Is → True. - 3Set actionAdd action: Trigger Webhook. Select your TR-AI webhook.
How TR-AI handles Freshdesk payloads
TR-AI accepts three Freshdesk body formats automatically:
- JSON — standard
application/jsonbody. - URL-encoded —
application/x-www-form-urlencodedform data. - Simple text — Freshdesk "Simple" format with
key — valuelines.
Follow-up reply handling
Freshdesk's {{conversation.body}} placeholder only populates in Reply automations, not Ticket Creation rules. When a follow-up arrives without a latest_reply field, TR-AI waits 1.5 seconds (for Freshdesk write propagation) then fetches the latest conversation directly via GET /api/v2/tickets/{id}/conversations.
TR-AI uses two strategies to find the customer reply:
- Strategy 1: conversations with
incoming=trueandprivate=false. - Strategy 2 (fallback): most recent non-private entry (handles Freshdesk delay in setting
incoming=true).
Reply formatting
Freshdesk requires HTML in the reply body field. TR-AI converts plain-text resolutions to HTML automatically:
- Numbered lines (
1./Step N:) →<ol><li>list. - Bullet lines (
•/-/*) →<ul><li>list. - Paragraphs separated by blank lines →
<p>blocks.
Triage behaviour
When TR-AI cannot auto-resolve a ticket, it:
- Posts a public acknowledgement reply to the customer.
- Assigns the ticket to a group named Triage if one exists — otherwise leaves it open and unassigned.
- Sets ticket status to
Open(status code 2) so agents see it. - Sends a Slack notification if configured.
Ticket status codes
| Code | Status | When TR-AI sets it |
|---|---|---|
| 2 | Open | Triage path — ticket needs human attention |
| 4 | Resolved | Auto-resolved — reply posted successfully |
| 5 | Closed | Not used by TR-AI (Resolved is preferred so customers can reopen) |