Skip to main content

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

MethodPathHandlerDescription
POST/api/tickets.jsonTicketApiController::createCreate ticket (JSON format)
POST/api/tickets.xmlTicketApiController::createCreate ticket (XML format)
POST/api/tickets.emailTicketApiController::createCreate ticket (email format)
POST/api/tasks/cronCronApiController::executeTrigger 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

MethodEndpointDescription
GET/tickets/{tid}Get ticket details
POST/tickets/{tid}/statusChange ticket status
POST/tickets/{tid}/assignAssign ticket to staff/team
POST/tickets/{tid}/releaseRelease ticket assignment
POST/tickets/{tid}/transferTransfer to another department
POST/tickets/{tid}/mergeMerge tickets together
POST/tickets/{tid}/claimSelf-assign (claim) ticket
POST/tickets/{tid}/referRefer ticket to another agent
DELETE/tickets/{tid}Delete ticket
POST/tickets/mass/Bulk ticket actions
GET/tickets/exportExport tickets (CSV)

Escalation

MethodEndpointDescription
POST/tickets/escalate_ticketsSubmit escalation (emergency or normal)
GET/tickets/check_escalation/{tid}Check escalation status/cooldown

Documentation Required

MethodEndpointDescription
POST/tickets/{tid}/acknowledge-docsPM acknowledges documentation

AI Assistant

MethodEndpointDescription
POST/ai-assistant/chatSend message, receive SSE stream response
GET/ai-assistant/conversationsList all conversations for current staff
POST/ai-assistant/conversationsCreate new conversation
DELETE/ai-assistant/conversations/{id}Delete a conversation
GET/ai-assistant/statusCheck AI system availability
POST/ai-assistant/reembedForce re-embed a specific ticket

Browser Notifications

MethodEndpointDescription
GET/notifications/pollPoll for new notifications (long-polling)
POST/notifications/{id}/readMark notification as read
POST/notifications/read-allMark all notifications as read
POST/notifications/{id}/dismissDismiss a notification
GET/notifications/prefsGet notification preferences
POST/notifications/prefsUpdate notification preferences
POST/notifications/testSend test notification

Twilio SMS

MethodEndpointDescription
POST/twilio/status_callbackTwilio delivery status webhook

Users & Organizations

MethodEndpointDescription
GET/users/searchSearch users by name/email
POST/usersCreate new user
PUT/users/{id}Update user details
DELETE/users/{id}Delete user
GET/orgs/searchSearch organizations
POST/orgsCreate new organization
PUT/orgs/{id}Update organization
GET/orgs/{id}/usersList users in organization

Tasks

MethodEndpointDescription
POST/tasksCreate new task
PUT/tasks/{id}Update task
POST/tasks/{id}/assignAssign task
POST/tasks/{id}/transferTransfer task
POST/tasks/{id}/closeClose task
POST/tasks/{id}/reopenReopen task

Search & Queues

MethodEndpointDescription
GET/searchAdvanced ticket search
GET/queuesList queue definitions
POST/queuesCreate custom queue
PUT/queues/{id}Update queue
DELETE/queues/{id}Delete queue

Drafts

MethodEndpointDescription
POST/draftCreate/update draft
DELETE/draft/{id}Delete draft
POST/draft/{id}/attachmentsAdd attachment to draft

Cron Jobs

Automated tasks run via cron. Each can be triggered by the system cron or manually:

Cron FileFrequencyPurpose
cron-gemini.phpEvery minuteProcess Gemini AI queue (2 tickets/run)
cron-embeddings.phpEvery 10 minutesGenerate/update AI embeddings
cron-escalation-digest.php7:30 AM CST dailyEscalation summary email to PMs
cron-docs-digest.php7:30 AM CST dailyAuto-close skip report
cron-twilio-cleanup.phpMidnight dailySMS counter reset + failure report
cron-analytics-report.phpConfigurableScheduled analytics email reports
cron-algolia.phpPeriodicAlgolia search index maintenance
auto-close-tickets.phpPeriodicAuto-close stale tickets after inactivity
tools/harvest-times-used-import.phpPeriodicHarvest 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]