How Ticket Creation Works
Halo creates tickets through the AI chat pipeline. When you send a message to the chat API with the right context, the AI agent evaluates the request and creates a ticket when it detects an issue that needs human follow-up. There are two approaches:
Both approaches use the same Chat API endpoint and benefit from the full AI pipeline — the ticket includes conversation context, user data, and company information automatically.
Prerequisites
- A HaloAgents widget key (
ab_live_...) — copy yours from Setup > Install in the dashboard - An agent with ticket escalation enabled (configure in AI Agents > [Your Agent] > Actions > Ticket Escalation)
- Optionally, an Identity Secret (
ha_secret_...) if you use identity verification
Approach 1: Chat API with Context
This is the recommended approach. Send the form/application data as structured context alongside a chat message describing the request. The AI agent triages the submission and creates a ticket with full context attached.Step 1: Identify the User
Before sending the submission, make sure the user exists in Halo. Call the identify endpoint so the ticket is linked to the right person:Step 2: Send the Submission as a Chat Message
Use the Chat API to send the submission data. Pass the form fields ascontext entries so the AI (and your team) can see exactly what was submitted:
What Happens Next
- The AI creates a ticket with the application details in the metadata
- Your team sees the ticket in the Halo dashboard with the full submission
- If Slack notifications are configured, your team gets notified immediately
- The AI responds with a confirmation (returned in the
textfield) - You can store the
session_idto send follow-up messages to the same conversation
Approach 2: Chat API with Forced Escalation
If you want a ticket created every time (no AI triage), phrase the message to explicitly request human follow-up. The AI recognizes escalation intent and creates a ticket immediately:Full Integration Example
Here’s a complete example of handling a form submission in a Next.js API route and automatically creating a ticket in Halo:Using Webhooks from Other Systems
If you receive webhooks from external systems (Stripe, HubSpot, your own app, etc.), you can forward them to Halo the same way:Configuring Ticket Behavior
Escalation Settings
The AI’s ticket creation behavior is controlled by your agent’s escalation settings. Configure these in the dashboard under AI Agents > [Your Agent] > Actions > Ticket Escalation:Ticket Consolidation
If a user already has an open ticket, new escalations are merged into the existing ticket instead of creating duplicates. This keeps your inbox clean when the same user submits multiple requests.Notifications
When a ticket is created, Halo can notify your team via:- Slack — instant notifications in your configured channel
- Email — notification emails to assigned team members
- Dashboard — real-time updates in the Halo inbox
Context Types for Submissions
Use context entries to structure submission data so it’s readable by both the AI and your team. Here are common patterns:Application / Form Submission
Support Request
Feature Request
Order / Transaction
Checking Ticket Status
After a ticket is created, you can view it in the Halo dashboard. The ticket includes:- The original submission message
- All structured context data from the request
- User and company information
- The AI’s triage notes and conversation history
- Priority status (based on your escalation filters)
Tickets created through the chat API appear in your Halo inbox just like any other ticket. Your team can respond, reassign, snooze, or resolve them using the standard workflow.
Next Steps
Chat API Reference
Full reference for the chat endpoint used to create tickets.
Context Entries
Learn about all context types for structuring submission data.
Identify Users
API reference for creating and updating user records.
Identify Companies
API reference for creating and updating company records.