API Endpoints Reference
The ticket system exposes two distinct API surfaces: an External API for programmatic ticket creation and cron execution, and an Internal AJAX API for staff panel interactions.
External API
Base URL: https://tickets.rhinogroup.com/api/
Authentication
External API requests require an API key passed via the X-API-Key header:
POST /api/tickets.json HTTP/1.1
Host: tickets.rhinogroup.com
X-API-Key: YOUR_API_KEY_HERE
Content-Type: application/json
API keys are managed in Admin → Manage → API Keys.
Endpoints
| Method | Path | Handler | Description |
|---|---|---|---|
| POST | /api/tickets.json | TicketApiController::create | Create ticket (JSON format) |
| POST | /api/tickets.xml | TicketApiController::create | Create ticket (XML format) |
| POST | /api/tickets.email | TicketApiController::create | Create ticket (email format) |
| POST | /api/tasks/cron | CronApiController::execute | Trigger cron execution |
Ticket Creation (JSON)
{
"alert": true,
"autorespond": true,
"source": "API",
"name": "John Doe",
"email": "[email protected]",
"subject": "Issue with checkout page",
"message": "The checkout page shows a 500 error when...",
"topicId": 1,
"priorityId": 2,
"attachments": []
}
Email Piping
Inbound emails are processed via api/pipe.php, which parses the email and creates a ticket or adds a thread entry to an existing ticket based on email threading headers.
Staff AJAX API
Base URL: https://tickets.rhinogroup.com/scp/ajax.php
All staff AJAX endpoints require an active staff session (cookie-based authentication). Requests are typically made via jQuery/fetch from the staff panel UI.
Ticket Operations
| Method | Endpoint | Description |
|---|---|---|
| GET | /tickets/{tid} | Get ticket details |
| POST | /tickets/{tid}/status | Change ticket status |
| POST | /tickets/{tid}/assign | Assign ticket to staff/team |
| POST | /tickets/{tid}/release | Release ticket assignment |
| POST | /tickets/{tid}/transfer | Transfer to another department |
| POST | /tickets/{tid}/merge | Merge tickets together |
| POST | /tickets/{tid}/claim | Self-assign (claim) ticket |
| POST | /tickets/{tid}/refer | Refer ticket to another agent |
| DELETE | /tickets/{tid} | Delete ticket |
| POST | /tickets/mass/ | Bulk ticket actions |
| GET | /tickets/export | Export tickets (CSV) |
Escalation
| Method | Endpoint | Description |
|---|---|---|
| POST | /tickets/escalate_tickets | Submit escalation (emergency or normal) |
| GET | /tickets/check_escalation/{tid} | Check escalation status/cooldown |
Documentation Required
| Method | Endpoint | Description |
|---|---|---|
| POST | /tickets/{tid}/acknowledge-docs | PM acknowledges documentation |
AI Assistant
| Method | Endpoint | Description |
|---|---|---|
| POST | /ai-assistant/chat | Send message, receive SSE stream response |
| GET | /ai-assistant/conversations | List all conversations for current staff |
| POST | /ai-assistant/conversations | Create new conversation |
| DELETE | /ai-assistant/conversations/{id} | Delete a conversation |
| GET | /ai-assistant/status | Check AI system availability |
| POST | /ai-assistant/reembed | Force re-embed a specific ticket |
Browser Notifications
| Method | Endpoint | Description |
|---|---|---|
| GET | /notifications/poll | Poll for new notifications (long-polling) |
| POST | /notifications/{id}/read | Mark notification as read |
| POST | /notifications/read-all | Mark all notifications as read |
| POST | /notifications/{id}/dismiss | Dismiss a notification |
| GET | /notifications/prefs | Get notification preferences |
| POST | /notifications/prefs | Update notification preferences |
| POST | /notifications/test | Send test notification |
Twilio SMS
| Method | Endpoint | Description |
|---|---|---|
| POST | /twilio/status_callback | Twilio delivery status webhook |
Users & Organizations
| Method | Endpoint | Description |
|---|---|---|
| GET | /users/search | Search users by name/email |
| POST | /users | Create new user |
| PUT | /users/{id} | Update user details |
| DELETE | /users/{id} | Delete user |
| GET | /orgs/search | Search organizations |
| POST | /orgs | Create new organization |
| PUT | /orgs/{id} | Update organization |
| GET | /orgs/{id}/users | List users in organization |
Tasks
| Method | Endpoint | Description |
|---|---|---|
| POST | /tasks | Create new task |
| PUT | /tasks/{id} | Update task |
| POST | /tasks/{id}/assign | Assign task |
| POST | /tasks/{id}/transfer | Transfer task |
| POST | /tasks/{id}/close | Close task |
| POST | /tasks/{id}/reopen | Reopen task |
Search & Queues
| Method | Endpoint | Description |
|---|---|---|
| GET | /search | Advanced ticket search |
| GET | /queues | List queue definitions |
| POST | /queues | Create custom queue |
| PUT | /queues/{id} | Update queue |
| DELETE | /queues/{id} | Delete queue |
Drafts
| Method | Endpoint | Description |
|---|---|---|
| POST | /draft | Create/update draft |
| DELETE | /draft/{id} | Delete draft |
| POST | /draft/{id}/attachments | Add attachment to draft |
Cron Jobs
Automated tasks run via cron. Each can be triggered by the system cron or manually:
| Cron File | Frequency | Purpose |
|---|---|---|
cron-gemini.php | Every minute | Process Gemini AI queue (2 tickets/run) |
cron-embeddings.php | Every 10 minutes | Generate/update AI embeddings |
cron-escalation-digest.php | 7:30 AM CST daily | Escalation summary email to PMs |
cron-docs-digest.php | 7:30 AM CST daily | Auto-close skip report |
cron-twilio-cleanup.php | Midnight daily | SMS counter reset + failure report |
cron-analytics-report.php | Configurable | Scheduled analytics email reports |
cron-algolia.php | Periodic | Algolia search index maintenance |
auto-close-tickets.php | Periodic | Auto-close stale tickets after inactivity |
tools/harvest-times-used-import.php | Periodic | Harvest budget/time sync import |
Triggering via API
curl -X POST https://tickets.rhinogroup.com/api/tasks/cron \
-H "X-API-Key: YOUR_API_KEY"
Response Formats
Success Response
Staff AJAX endpoints typically return JSON:
{
"status": 200,
"message": "Successfully updated",
"data": { ... }
}
Error Response
{
"status": 400,
"message": "Validation error: subject is required"
}
SSE Stream (AI Assistant)
The AI chat endpoint uses Server-Sent Events for streaming:
data: {"token": "The "}
data: {"token": "ticket "}
data: {"token": "appears "}
data: {"token": "to be..."}
data: [DONE]