The Help Center API is a versioned internal REST API used by the OnCodes support platform. It allows you to programmatically manage articles, categories, and sections. All endpoints are prefixed with /api/v1/hc/ and require an active authenticated session.
https://support.oncodes.com/api/v1/hc/
All requests require a valid browser session cookie and the CSRF token passed as a request header. The token is stored in the XSRF-TOKEN cookie and must be decoded before use.
X-XSRF-TOKEN: <decoded value of XSRF-TOKEN cookie>
Content-Type: application/json
Accept: application/json
To extract the token in the browser console:
decodeURIComponent(document.cookie.match(/XSRF-TOKEN=([^;]+)/)[1])
Endpoint: GET /api/v1/hc/articles
Returns a paginated list of articles. Supports filtering, searching, and sorting.
| 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 | Sort direction: asc or desc |
query | string | Search term to filter articles by title |
filters | string | Additional filters (JSON-encoded) |
with | string | Comma-separated relationships to eager load |
withCount | string | Comma-separated relationships to count |
paginate | string | Pagination mode — use preferLengthAware for full pagination metadata |
aiAgentId | int | Filter by AI agent association |
{
"pagination": {
"current_page": 1,
"per_page": 15,
"total": 76,
"last_page": 6,
"from": 1,
"to": 15,
"next_page": 2,
"prev_page": null,
"data": [
{
"id": 101,
"title": "Article Title",
"slug": "article-title",
"draft": false,
"updated_at": "2026-02-26T08:00:00.000000Z",
"used_by_ai_agent": false,
"author": { "id": 1, "name": "..." },
"tags": [],
"path": [
{ "id": 1, "name": "ChatNet", "model_type": "category", "is_section": false },
{ "id": 2, "name": "Getting Started", "model_type": "category", "is_section": true }
]
}
]
},
"status": "success"
}
Endpoint: GET /api/v1/hc/articles/{id}
Returns a single article including full body content, navigation context, and category path.
{
"article": {
"id": 101,
"title": "Article Title",
"body": "<p>HTML content...</p>",
"slug": "article-title",
"draft": false,
"visibility": "public",
"views": 0,
"position": 0,
"description": null,
"extra_data": null,
"managed_by_role": null,
"visible_to_role": null,
"author_id": 1,
"scan_pending": false,
"used_by_ai_agent": 0,
"created_at": "2026-02-26T08:00:00.000000Z",
"updated_at": "2026-02-26T08:00:00.000000Z",
"model_type": "article",
"categories": [...],
"tags": [],
"attachments": []
},
"categoryNav": {...},
"pageNav": {...},
"status": "success"
}
Endpoint: POST /api/v1/hc/articles
Creates a new article. Returns 201 Created on success.
| Field | Type | Required | Description |
|---|---|---|---|
title | string | No | Article title |
body | string | Yes | Article HTML content |
author_id | int | Yes | ID of the article author (agent) |
sections | int[] | Yes | Array of section IDs to attach the article to (at least one required) |
draft | boolean | No | true = draft, false = published (default: false) |
tags | array | No | Array of tag strings |
description | string | No | Short meta description |
slug | string | No | URL slug (auto-generated from title if omitted) |
| Field | Rule |
|---|---|
body | Required |
author_id | Required |
sections | Must contain at least one section ID |
fetch('https://support.oncodes.com/api/v1/hc/articles', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'X-XSRF-TOKEN': decodeURIComponent(document.cookie.match(/XSRF-TOKEN=([^;]+)/)[1])
},
body: JSON.stringify({
title: 'My New Article',
body: '<p>Content here</p>',
author_id: 1,
sections: [2],
draft: false,
tags: []
})
});
HTTP 201 Created
{
"article": {
"id": 102,
"title": "My New Article",
"body": "<p>Content here</p>",
"draft": false,
...
},
"status": "success"
}
Endpoint: PUT /api/v1/hc/articles/{id}
Updates an existing article. Accepts the same fields as Create Article. Note: PATCH is not supported — use PUT.
Only GET, PUT, and DELETE are supported on /api/v1/hc/articles/{id}. Using PATCH returns 405 Method Not Allowed.
Endpoint: DELETE /api/v1/hc/articles/{id}
Permanently deletes an article. Returns 200 with {"status":"success"} even if the article does not exist.
In this platform, categories and sections share the same data model. A category is a top-level grouping (e.g. a product). A section is a child of a category (is_section: true, parent_id set). Articles are attached to sections, not directly to categories.
Endpoint: GET /api/v1/hc/manager/categories
Returns all top-level categories used in the admin arrange view. Does not include children — fetch sections separately per category.
{
"categories": [
{
"id": 1,
"name": "ChatNet - PHP Chat Room",
"is_section": false,
"parent_id": null,
"description": "...",
"image": "storage/category/image.png",
"visible_to_role": null,
"managed_by_role": null,
"articles_count": 45,
"sections_count": 11,
"tags": []
}
],
"status": "success"
}
Endpoint: GET /api/v1/hc/manager/categories/{categoryId}/sections
Returns all sections (child categories) belonging to a given top-level category.
{
"categories": [
{
"id": 2,
"name": "Getting Started",
"is_section": true,
"parent_id": 1,
"articles_count": 6
}
],
"category": { ... },
"status": "success"
}
Endpoint: POST /api/v1/hc/categories
Creates a new category (top-level) or section (child). To create a section, set parent_id to the parent category ID and is_section to true.
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Category or section name |
description | string | No | Description text |
parent_id | int | No | Parent category ID (set this to create a section) |
is_section | boolean | No | true if this is a section under a category |
visible_to_role | string | No | Restrict visibility to a specific role |
managed_by_role | string | No | Restrict management to a specific role |
HTTP 200 OK
{
"category": {
"id": 32,
"name": "My Section",
"parent_id": 1,
"is_section": true,
"position": 12,
"created_at": "...",
"updated_at": "...",
"model_type": "category"
},
"status": "success"
}
Endpoint: PUT /api/v1/hc/categories/{id}
Updates an existing category or section. Accepts the same fields as Create. Returns the full updated category object.
The response includes: id, name, description, position, default, parent_id, managed_by_role, visible_to_role, hide_from_structure, is_section, image, created_at, updated_at, model_type.
Endpoint: DELETE /api/v1/hc/categories/{id}
Permanently deletes a category or section. Returns 404 if the ID does not exist.
Note: POST and DELETE are not available on /api/v1/hc/manager/categories — use /api/v1/hc/categories instead.
These endpoints return lightweight lists used to populate dropdowns and filters in the UI.
| Endpoint | Description |
|---|---|
GET /api/v1/helpdesk/normalized-models/hc-categories | All categories as flat list for selects |
GET /api/v1/helpdesk/normalized-models/article-authors | All agents who can author articles |
GET /api/v1/helpdesk/normalized-models/article-authors/{id} | Single author by ID |
GET /api/v1/helpdesk/normalized-models/tags?query=&paginate=simple&perPage=25 | Tag list with search support |
GET /api/v1/helpdesk/normalized-models/roles?type=all | All roles for visibility/management restrictions |
GET /api/v1/helpdesk/compact-agents | Compact agent list for assignments |
Endpoint: GET /api/v1/hc/manager/categories/arrange
Returns the category tree used to render the drag-and-drop arrange page at /dashboard/hc/arrange.
| ID | Name | Type | Parent | Articles |
|---|---|---|---|---|
| 1 | ChatNet - PHP Chat Room & Private Chat Script | Category | — | 45 |
| 2 | Getting Started | Section | ChatNet | 6 |
| 31 | ChatNet 2.0 | Section | ChatNet | 2 |
| 3 | How To | Section | ChatNet | 20 |
| 5 | Change Log | Section | ChatNet | 1 |
| 14 | Cloud Storage | Section | ChatNet | 3 |
| 6 | Frequently Asked Questions | Section | ChatNet | 1 |
| 4 | Translate | Section | ChatNet | 2 |
| 7 | Chat Rooms | Section | ChatNet | 3 |
| 30 | Video Chat | Section | ChatNet | 1 |
| 13 | Third Party Integration | Section | ChatNet | 3 |
| 8 | Advanced | Section | ChatNet | 4 |
| 9 | ChatBubble - WordPress All in One Social Support Floating Button | Category | — | 20 |
| 10 | Getting Started | Section | ChatBubble | 3 |
| 11 | Configuration | Section | ChatBubble | 3 |
| 12 | Integration | Section | ChatBubble | 14 |
| 15 | ChatNetWP - WordPress Plugin for ChatNet | Category | — | 5 |
| 16 | Getting Started | Section | ChatNetWP | 2 |
| 17 | Configuration | Section | ChatNetWP | 2 |
| 18 | Usage / Short Codes | Section | ChatNetWP | 1 |
| 20 | HotelPrice - WordPress Price Comparison Plugin for Hotel Websites | Category | — | 6 |
| 21 | Getting Started | Section | HotelPrice | 4 |
| 22 | Configuration | Section | HotelPrice | 1 |
| 23 | OTA Channels | Section | HotelPrice | 1 |