Skip to content

Internal API

The internal API provides full admin-level CRUD operations. All endpoints require an internal API key via the X-API-KEY header.

Base URL: /api/v1/internal

Connection Check

GET /api/v1/internal/connection-check

Scope: connection:check

Response:

json
{
  "status": true,
  "message": "Connection check successful"
}

Tickets

List Tickets

GET /internal/tickets

Scope: tickets:list

ParameterTypeDefaultDescription
per_pageinteger15Items per page
statusstringFilter: open, in_progress, on_hold, closed
prioritystringFilter: low, medium, high, critical
department_idintegerFilter by department
customer_idintegerFilter by customer
assigned_tointegerFilter by assigned agent (user ID)

Create Ticket

POST /internal/tickets

Scope: tickets:create

FieldRules
customer_idrequired, must exist
titlerequired, string, max 500
contentrequired, string
department_idoptional, must exist
category_idoptional, must exist
product_idoptional, must exist
priorityoptional: low, medium, high, critical

Get Ticket

GET /internal/tickets/{id}

Scope: tickets:read

Update Ticket

PUT /internal/tickets/{id}

Scope: tickets:update

FieldRules
statusoptional: open, in_progress, on_hold, closed
priorityoptional: low, medium, high, critical
assigned_tooptional, nullable, must exist as user
department_idoptional, must exist
category_idoptional, nullable, must exist
product_idoptional, nullable, must exist
is_resolvedoptional, boolean
is_lockedoptional, boolean
labelsoptional, array of label IDs

Delete Ticket

DELETE /internal/tickets/{id}

Scope: tickets:delete

Ticket Messages

List Messages

GET /internal/tickets/{ticketId}/messages

Scope: messages:list

ParameterTypeDefaultDescription
per_pageinteger15Items per page

Create Message

POST /internal/tickets/{ticketId}/messages

Scope: messages:create

FieldRules
contentrequired, string
is_internaloptional, boolean

The message is created with sender_type = User and sender_id from the API key. The ticket's last_reply_at is updated and last_reply_by set to staff.

Departments

List Departments

GET /internal/departments

Scope: departments:list | Sorted by sort_order

ParameterTypeDefault
per_pageinteger15

Create Department

POST /internal/departments

Scope: departments:create

FieldRules
namerequired, string, max 250
descriptionoptional, string, max 1000
emailoptional, email, max 250
is_defaultoptional, boolean
statusoptional: published, draft
sort_orderoptional, integer, min 0

Get / Update / Delete Department

GET    /internal/departments/{id}    → departments:read
PUT    /internal/departments/{id}    → departments:update
DELETE /internal/departments/{id}    → departments:delete

Update uses the same fields as create.

Categories

Endpoints

GET    /internal/categories           → categories:list
POST   /internal/categories           → categories:create
GET    /internal/categories/{id}      → categories:read
PUT    /internal/categories/{id}      → categories:update
DELETE /internal/categories/{id}      → categories:delete

Sorted by sort_order.

Fields

FieldRules
namerequired, string, max 250
descriptionoptional, string, max 1000
parent_idoptional, must exist as category
statusoptional: published, draft
sort_orderoptional, integer, min 0

Labels

Endpoints

GET    /internal/labels           → labels:list
POST   /internal/labels           → labels:create
GET    /internal/labels/{id}      → labels:read
PUT    /internal/labels/{id}      → labels:update
DELETE /internal/labels/{id}      → labels:delete

Sorted by sort_order.

Fields

FieldRules
namerequired, string, max 250
colorrequired, valid hex color
statusoptional: published, draft
sort_orderoptional, integer, min 0

Products

Endpoints

GET    /internal/products           → products:list
POST   /internal/products           → products:create
GET    /internal/products/{id}      → products:read
PUT    /internal/products/{id}      → products:update
DELETE /internal/products/{id}      → products:delete

Sorted by name.

Fields

FieldRules
namerequired, string, max 250
envato_idoptional, string, max 100, unique
descriptionoptional, string
priceoptional, numeric, min 0
statusoptional: published, draft

Customers

Endpoints

GET  /internal/customers           → customers:list
POST /internal/customers           → customers:create
GET  /internal/customers/{id}      → customers:read
PUT  /internal/customers/{id}      → customers:update

INFO

Customers cannot be deleted via the API.

Sorted by name.

Fields

FieldRules
namerequired, string, max 250
emailrequired, email, max 250, unique
phoneoptional, string, max 50
envato_usernameoptional, string, max 250

Agents

Endpoints

GET    /internal/agents           → agents:list
POST   /internal/agents           → agents:create
GET    /internal/agents/{id}      → agents:read
PUT    /internal/agents/{id}      → agents:update
DELETE /internal/agents/{id}      → agents:delete

Query Parameters (List)

ParameterTypeDescription
per_pageintegerDefault 15
department_idintegerFilter by department
is_activebooleanFilter by active status

Fields

FieldRules
namerequired, string, max 250
emailrequired, email, max 250, unique
passwordrequired on create, string, min 8
phoneoptional, string, max 50
localeoptional, string, max 10
is_activeoptional, boolean
departmentsoptional, array of department IDs

Password is hashed automatically. On update, password is optional.

Knowledge Categories

Endpoints

GET    /internal/knowledge-categories           → knowledge-categories:list
POST   /internal/knowledge-categories           → knowledge-categories:create
GET    /internal/knowledge-categories/{id}      → knowledge-categories:read
PUT    /internal/knowledge-categories/{id}      → knowledge-categories:update
DELETE /internal/knowledge-categories/{id}      → knowledge-categories:delete

List includes article count, sorted by sort_order.

Fields

FieldRules
namerequired, string, max 250
descriptionoptional, string, max 1000
iconoptional, string, max 100
statusoptional: published, draft
sort_orderoptional, integer, min 0

Knowledge Articles

Endpoints

GET    /internal/knowledge-articles           → knowledge-articles:list
POST   /internal/knowledge-articles           → knowledge-articles:create
GET    /internal/knowledge-articles/{id}      → knowledge-articles:read
PUT    /internal/knowledge-articles/{id}      → knowledge-articles:update
DELETE /internal/knowledge-articles/{id}      → knowledge-articles:delete

List includes category, sorted by latest.

Fields

FieldRules
titlerequired, string, max 250
slugoptional, string, max 250
contentoptional, string
excerptoptional, string, max 500
category_idoptional, must exist
statusoptional: published, draft

Canned Responses

Endpoints

GET    /internal/canned-responses           → canned-responses:list
POST   /internal/canned-responses           → canned-responses:create
GET    /internal/canned-responses/{id}      → canned-responses:read
PUT    /internal/canned-responses/{id}      → canned-responses:update
DELETE /internal/canned-responses/{id}      → canned-responses:delete

Sorted by sort_order.

Fields

FieldRules
titlerequired, string, max 250
contentoptional, string
categoryoptional, string, max 100
shortcutoptional, string, max 100
is_activeoptional, boolean
sort_orderoptional, integer, min 0

Custom Fields

Endpoints

GET    /internal/custom-fields           → custom-fields:list
POST   /internal/custom-fields           → custom-fields:create
GET    /internal/custom-fields/{id}      → custom-fields:read
PUT    /internal/custom-fields/{id}      → custom-fields:update
DELETE /internal/custom-fields/{id}      → custom-fields:delete

Sorted by sort_order.

Fields

FieldRules
labelrequired, string, max 250
descriptionoptional, string, max 1000
typerequired: date, datetime_local, email, number, tel, text, textarea, time, url
is_requiredoptional, boolean
sort_orderoptional, integer, min 0
statusoptional: published, draft

Activity Logs

GET /internal/activity-logs

Scope: activity-logs:list

ParameterTypeDefault
per_pageinteger15

Response:

json
{
  "data": [
    {
      "id": 1,
      "description": "Ticket #1001 status changed to closed",
      "user": { "id": 1, "name": "Admin" },
      "ip_address": "127.0.0.1",
      "created_at": "2026-03-15T10:30:00Z"
    }
  ],
  "meta": { "current_page": 1, "last_page": 1, "per_page": 15, "total": 1 }
}

Reports

Overview Report

GET /internal/reports/overview

Scope: reports:overview

ParameterTypeDefaultDescription
start_datedate (ISO 8601)30 days agoPeriod start
end_datedate (ISO 8601)todayPeriod end

Agents Report

GET /internal/reports/agents

Scope: reports:agents | Same parameters as overview.

Departments Report

GET /internal/reports/departments

Scope: reports:departments | Same parameters as overview.

Settings

Get Settings

GET /internal/settings

Scope: settings:read

Update Settings

PUT /internal/settings

Scope: settings:update

FieldRules
sd_default_department_idoptional, nullable, must exist
sd_default_priorityoptional, nullable, string
sd_auto_close_daysoptional, integer, min 0
sd_tickets_per_pageoptional, integer, 1–200
sd_notification_emailoptional, nullable, email, max 250
sd_customer_registration_enabledoptional, boolean
sd_customer_max_tickets_per_dayoptional, integer, min 0
sd_enable_auto_assignoptional, boolean
sd_enable_envato_integrationoptional, boolean

API Keys

Endpoints

GET    /internal/api-keys           → api-keys:list
POST   /internal/api-keys           → api-keys:create
GET    /internal/api-keys/{id}      → api-keys:read
PUT    /internal/api-keys/{id}      → api-keys:update
DELETE /internal/api-keys/{id}      → api-keys:delete

Fields

FieldRules
namerequired, string, max 250
typerequired: internal, external
scopesoptional, array of scope strings
agent_idoptional, nullable, must exist (for external keys)
expires_atoptional, nullable, date, must be in the future

WARNING

The raw API key is only returned once on creation. Store it securely.

INFO

Deleting an API key sets revoked = true (soft revoke). The record is not hard-deleted.