The Conversations API is the core of the OnCodes support helpdesk. It handles ticket creation, retrieval, replies, status changes, and more. All endpoints are under /api/v1/helpdesk/ and require an active authenticated session.
https://support.oncodes.com/api/v1/helpdesk/
Extract the CSRF token from the browser cookie and include it as a header on all mutating requests:
X-XSRF-TOKEN: <decoded value of XSRF-TOKEN cookie>
Content-Type: application/json
Accept: application/json
// Get token in browser console:
decodeURIComponent(document.cookie.match(/XSRF-TOKEN=([^;]+)/)[1])
Endpoint: GET /api/v1/helpdesk/agent/conversations
Returns a paginated list of conversations. Supports filtering by status, assignee, and other attributes.
| Parameter | Type | Description |
|---|---|---|
page | int | Page number (default: 1) |
perPage | int | Results per page (default: 15) |
orderBy | string | Field to sort by (e.g. updated_at) |
orderDir | string | asc or desc |
query | string | Search term (subject, message content) |
viewId | string/int | Built-in view key: all, mine, unassigned, closed, or a numeric view ID |
filters | JSON string | Array of filter objects: [{"key":"status","value":"pending"}] |
| Key | Example Value | Description |
|---|---|---|
status | "pending", "open", "resolved" | Filter by status label |
status_category | 5 (pending), 6 (open), 4 (resolved), 3 (locked) | Filter by status category ID |
// Get all pending conversations
GET /api/v1/helpdesk/agent/conversations?page=1&perPage=15&viewId=all&filters=[{"key":"status","value":"pending"}]
{
"pagination": {
"data": [
{
"id": 1274,
"type": "ticket",
"subject": "Test Ticket - API Documentation Sample",
"status_category": 5,
"status_label": "Pending",
"customer_status_label": "Waiting on you",
"channel": "website",
"priority": 0,
"updated_at": "2026-02-26T08:32:00.000000Z",
"created_at": "2026-02-26T08:31:02.000000Z",
"closed_at": null,
"assigned_at": "...",
"closed_by": null,
"latest_message": { ... },
"group": null,
"assignee": { "id": 1, "name": "OnCodes" },
"user": { "id": 3, "name": "underwoo_d" },
"tags": [],
"attributes": { ... }
}
],
"next_cursor": null,
"prev_cursor": null,
"per_page": 15
},
"status": "success"
}
Endpoint: GET /api/v1/helpdesk/agent/conversations/{id}
Returns full details of a single conversation including customer, assignee, group, tags, status, and recent messages.
| Field | Type | Description |
|---|---|---|
id | int | Conversation ID |
subject | string | Ticket subject/title |
status_id | int | Current status ID (1=Open, 2=Pending, 3=Resolved, 4=Locked) |
status_category | int | Status category (6=Open, 5=Pending, 4=Resolved, 3=Locked) |
priority | int | Priority level (0 = none) |
type | string | Conversation type (e.g. ticket) |
channel | string | Origin channel (e.g. website, email) |
user_id | int | Customer (user) ID |
assignee_id | int | Assigned agent ID |
assigned_to | string | "agent" or "group" |
group_id | int | Assigned group ID |
rating | int/null | Customer satisfaction rating |
mode | string | Conversation mode |
ai_agent_involved | bool | Whether AI agent participated |
created_at | datetime | When ticket was created |
closed_at | datetime/null | When ticket was closed |
Endpoint: POST /api/v1/helpdesk/agent/conversations
Creates a new conversation/ticket. Returns 200 OK on success.
| Field | Type | Required | Description |
|---|---|---|---|
subject | string | Yes | Ticket subject/title |
message | string | Yes | Initial message body (plain text or HTML) |
userId | int | Yes | Customer ID (use normalized-models/customer to look up) |
status | string | No | Initial status: "open" (default), "pending", "resolved" |
assigneeId | int | No | Agent ID to assign |
groupId | int | No | Group ID to assign |
categoryId | int | Yes | Category ID (required by validation) |
priority | int | No | Priority level (0 = none) |
tags | array | No | Array of tag strings |
fetch('https://support.oncodes.com/api/v1/helpdesk/agent/conversations', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'X-XSRF-TOKEN': decodeURIComponent(document.cookie.match(/XSRF-TOKEN=([^;]+)/)[1])
},
body: JSON.stringify({
subject: 'My Support Ticket',
message: 'I need help with...',
userId: 3,
status: 'open',
categoryId: 1
})
});
HTTP 200 OK
{
"conversation": {
"id": 1274,
"subject": "My Support Ticket",
"status_id": 1,
...
},
"status": "success"
}
Endpoint: PUT /api/v1/helpdesk/agent/conversations/{id}
Updates conversation properties such as subject, assignee, group, or priority. Note: to change status, use the dedicated Change Status endpoint instead.
| Field | Type | Description |
|---|---|---|
subject | string | Ticket subject |
assignee_id | int | Assign to agent by ID |
group_id | int | Assign to group by ID |
priority | int | Priority level |
Note: Only GET, PUT, and DELETE are supported. PATCH returns 405 Method Not Allowed.
Endpoint: DELETE /api/v1/helpdesk/agent/conversations/{id}
Permanently deletes a conversation. Returns 204 No Content on success (even if ID does not exist).
Endpoint: POST /api/v1/helpdesk/agent/conversations/status/change
Changes the status of one or more conversations. Supports bulk status updates.
| Field | Type | Required | Description |
|---|---|---|---|
conversationIds | int[] | Yes | Array of conversation IDs to update |
statusId | int | Yes | New status ID: 1=Open, 2=Pending, 3=Resolved, 4=Locked |
fetch('/api/v1/helpdesk/agent/conversations/status/change', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-XSRF-TOKEN': token },
body: JSON.stringify({
conversationIds: [1274],
statusId: 3
})
});
HTTP 200 OK
{ "status": "success" }
| ID | Label | Category | Customer Label |
|---|---|---|---|
| 1 | Open | 6 | — |
| 2 | Pending | 5 | Waiting on you |
| 3 | Resolved | 4 | — |
| 4 | Locked | 3 | — |
Endpoint: GET /api/v1/helpdesk/agent/conversations/{id}/messages
Returns all messages for a conversation using cursor-based pagination.
{
"pagination": {
"data": [
{
"id": 5104,
"uuid": "66b26668-...",
"type": "message",
"author": "agent",
"body": "<p>Message content</p>",
"created_at": "2026-02-26T08:31:02.000000Z",
"user": { "id": 1, "name": "OnCodes" },
"conversation_id": 1274,
"source": null,
"data": null,
"attachments": []
}
],
"next_cursor": null,
"prev_cursor": null,
"per_page": 20
}
}
| Type | Description |
|---|---|
message | A reply visible to the customer |
note | An internal note visible only to agents |
Endpoint: POST /api/v1/helpdesk/agent/conversations/{id}/messages
Sends a reply to the customer or adds an internal note. Returns 201 Created.
| Field | Type | Required | Description |
|---|---|---|---|
body | string | Yes | Message content (HTML supported) |
type | string | Yes | "message" to reply to customer, "note" for internal note |
status_id | int | No | Optionally change conversation status when sending (e.g. send reply and close) |
fetch('/api/v1/helpdesk/agent/conversations/1274/messages', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-XSRF-TOKEN': token },
body: JSON.stringify({
body: '<p>Thank you for reaching out! We will address your issue shortly.</p>',
type: 'message'
})
});
fetch('/api/v1/helpdesk/agent/conversations/1274/messages', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-XSRF-TOKEN': token },
body: JSON.stringify({
body: '<p>Customer contacted support about billing issue.</p>',
type: 'note'
})
});
HTTP 201 Created
{
"message": {
"id": 5105,
"uuid": "abc-...",
"type": "message",
"author": "agent",
"body": "<p>Thank you for reaching out!</p>",
"created_at": "2026-02-26T08:32:00.000000Z",
"conversation_id": 1274,
"user_id": 1,
"attachments": [],
"model_type": "conversationItem"
},
"status": "success"
}
Endpoint: GET /api/v1/helpdesk/inbox/views
Returns all inbox views including built-in views (Your inbox, Unassigned, All) and custom views, each with conversation counts.
{
"views": [
{ "id": 2, "key": "mine", "name": "Your inbox", "pinned": true, "icon": "inbox", "count": 1 },
{ "id": 3, "key": "unassigned", "name": "Unassigned", "pinned": true, "icon": "unassigned", "count": 0 },
{ "id": 4, "key": "closed", "name": "Closed", "pinned": true, "icon": "archive", "count": 0 },
{ "id": 5, "key": "all", "name": "All", "pinned": true, "icon": "team", "count": 0 },
{ "id": 1, "key": null, "name": "ChatNet", "pinned": false, "count": 1, "isGroupView": false },
{ "id": "group:1", "key": "group:1", "name": "General", "count": 1, "isGroupView": true }
]
}
Use the key value as the viewId query parameter when listing conversations (e.g. viewId=mine, viewId=all).
Endpoint: GET /api/v1/helpdesk/statuses/list?label=agent
Returns available conversation statuses.
{
"statuses": [
{ "id": 1, "label": "Open", "category": 6 },
{ "id": 2, "label": "Pending", "category": 5 },
{ "id": 3, "label": "Resolved", "category": 4 },
{ "id": 4, "label": "Locked", "category": 3 }
]
}
Endpoint: GET /api/v1/helpdesk/normalized-models/customer
Returns a list of customers for use in dropdowns. Supports search.
Endpoint: GET /api/v1/helpdesk/normalized-models/customer/{id}
Returns a single customer. Example: customer underwoo_d has ID 3.
Endpoint: GET /api/v1/helpdesk/attributes/list?type=conversation&for=agent&attributeIds=
Returns all configurable conversation attributes, including built-in fields and any custom ones.
| ID | Key | Name | Format | Required |
|---|---|---|---|---|
| 9 | subject | Subject | text | Yes |
| 10 | description | Description | multiLineText | Yes |
| 1 | category | Category | dropdown | Yes |
| 7 | group_id | Department | dropdown | No |
| 11 | priority | Priority | number | No |
| 8 | rating | Rating | rating | No |
| Endpoint | Method | Description |
|---|---|---|
/api/v1/helpdesk/agent/conversations/{id}/messages | GET | Get all messages for a conversation |
/api/v1/helpdesk/agent/conversations/recent/{userId}?excludeId={convId} | GET | Get recent conversations for a customer (exclude current) |
/api/v1/helpdesk/conversations/{id}/summary | GET | Get AI-generated summary of a conversation |
/api/v1/helpdesk/compact-agents | GET | Get compact list of agents for assignment dropdowns |
/api/v1/helpdesk/normalized-models/groups | GET | Get available groups/departments |
/api/v1/helpdesk/normalized-models/tags?query=&paginate=simple&perPage=25 | GET | Get tags with optional search |