-
Notifications
You must be signed in to change notification settings - Fork 15
API Reference
All endpoints live under api/ and return JSON. Every endpoint requires an active session ($_SESSION['analyst_id']), except api/external/* and api/watchtower/* which use API-key authentication for external integrations and the browser extension.
session_start();
require_once '../../config.php';
require_once '../../includes/functions.php';
header('Content-Type: application/json');
if (!isset($_SESSION['analyst_id'])) {
echo json_encode(['success' => false, 'error' => 'Not authenticated']);
exit;
}All endpoints return either { "success": true, ... } or { "success": false, "error": "..." }.
| Folder | Count | Purpose |
|---|---|---|
api/tickets/ |
~59 | Tickets, mailboxes, email templates, analysts, teams, rota, dashboard widgets, trash (soft-delete/restore/purge) |
api/assets/ |
8 | Assets, user assignments, vCenter sync, server inventory |
api/knowledge/ |
16 | Articles, AI chat, OpenAI embeddings, email settings, review workflow |
api/change-management/ |
15 | Changes, attachments, calendar, approvals, CAB workflow, settings |
api/calendar/ |
7 | Events and categories |
api/morning-checks/ |
8 | Check definitions, daily results, trend charts, reorder |
api/reporting/ |
2 | System logs |
api/software/ |
5 | Software inventory and licence management |
api/forms/ |
10 | Forms CRUD, submissions, settings, AI-generate (streaming SSE) |
api/contracts/ |
~28 | Contracts, suppliers, contacts, RFP Builder, terms, payment schedules |
api/service-status/ |
7 | Services CRUD, incident management, dashboard aggregation |
api/self-service/ |
~12 | End-user portal: register, login, MFA, new ticket, ticket detail |
api/lms/ |
9 | Courses, learning groups, assignments, progress, SCORM data |
api/process-mapper/ |
4 | List/get/save/delete process maps |
api/cmdb/ |
~20 | Classes, properties, objects, relationships, AI suggest, AI summary, impact, search |
api/tasks/ |
~12 | Tasks, subtasks, comments, ticket/change linking |
api/watchtower/ |
1 | Cross-module attention aggregation (also used by browser extension) |
api/system/ |
~10 | Encryption status, module access, SSO providers, multi-tenant topology, orphaned-ticket reassignment |
api/system/debug-tools/ |
4 | Self-contained diagnostics (demo import, ticket delete, self-service SSO, local login forensics) |
api/settings/ |
2 | Global system settings (auto-encrypts sensitive keys) |
api/myaccount/ |
6 | Password change, MFA setup/verify/disable |
api/auth/ |
5 | Password reset request/confirm, login resolution + OIDC SSO login/callback (portal-aware) (public) |
api/external/system-info/submit/ |
1 | External β full asset inventory ingestion (hardware, disks, network, software) |
api/external/software-inventory/submit/ |
1 | External β software inventory only |
api/external/device-manager/submit/ |
1 | External β Windows Device Manager device enumeration |
| Method | Path | Description |
|---|---|---|
| GET | get_sendable_mailboxes.php |
Mailboxes the active company can send replies from (pinned + shared, active + signed-in). Powers the New Ticket mailbox picker. |
| POST | delete_ticket.php |
Moves a ticket to the trash (soft-delete) β no longer a hard delete. |
| POST | restore_ticket.php |
Restores a ticket from the trash. |
| POST | permanently_delete_ticket.php |
Permanently deletes a trashed ticket and all its data (irreversible). |
| POST | empty_trash.php |
Permanently purges all trashed tickets in the active company. |
| Method | Path | Description |
|---|---|---|
| GET | get_topology.php |
Aggregated company-rooted topology (companies, mailboxes, domains, providers, analyst access, ticket/requester counts) for System β Topology. |
| GET | get_orphaned_tickets.php |
Tickets whose department no longer exists, plus the valid departments available for reassignment. |
| POST | assign_ticket_department.php |
Reassigns one or many tickets to a department (or none); used by Orphaned tickets. |
| GET | get_sso_providers.php |
Lists SSO providers; each row now includes its owning company (tenant_name). |
Self-contained diagnostics with their own authentication. Read-only unless stated; never print secrets.
| Method | Path | Description |
|---|---|---|
| GET | D003_selfservice_sso.php |
Self-service SSO check by email β reports end-to-end whether self-service sign-in is correctly wired for a requester. |
| POST | D004_local_login.php |
Local login / password-hash forensics. |
resolve_login.php, oidc_login.php and oidc_callback.php now accept a portal=self-service flag so SSO login can be driven from the end-user portal as well as the analyst login.
Every internal endpoint checks $_SESSION['analyst_id'] after session_start(). Sessions are established by login.php after username/password + (optional) TOTP verification.
The self-service portal uses a separate session key β $_SESSION['ss_user_id'] β so analyst sessions and end-user portal sessions don't collide on the same browser.
For external integrations and the browser extension. Generated at Software β Settings β API Keys, sent as a bearer token in the Authorization header. Rate limited (60 requests/min per key by default).
{ "success": true, "data": { ... } }
{ "success": false, "error": "Human-readable error" }After insert, PHP-side returns the new id via lastInsertId():
{ "success": true, "id": 1234 }User-facing records use is_active flags rather than physical deletion. APIs typically filter by is_active = 1 unless an include_inactive=1 query param is provided.
-
api/settings/get_system_settings.phpreturns masked values (****<last4>) for keys inMASKED_SETTING_KEYS -
api/settings/save_system_settings.phptreats blank or asterisk-prefixed submissions as "leave unchanged" β re-saving the form doesn't wipe the secret
Each module's page lists its key endpoints inline β see for example:
- Tickets β ticket lifecycle, email integration, dashboard widgets, rota
- CMDB β class/property CRUD, object relationships, AI suggest, impact
- Contracts β supplier register, contract terms, payment schedules, RFP Builder
- Forms β form definition, AI-generate streaming, submissions
- LMS β SCORM data API, assignments, progress
For the comprehensive endpoint list see the API Reference section of README.md in the main repo.
FreeITSM β an open-source IT Service Management platform Β· github.com/edmozley/freeitsm Β· MIT licence
- Installation
- β° Scheduled tasks (cron jobs)
- Architecture
- AI Providers
- Internationalisation (i18n)
- Timezones & Time Handling
- Theming & Dark Mode
- β¨οΈ Command palette (βK)
- π Searching inside tickets
- π Attached documents
- MobileβFriendly
-
Security
- Layer 1 β which modules you can enter
- β³ π§© Module Access Control
- β³ π οΈ Module Access β Developer Guide
- Layer 2 β what you can administer
- β³ π Roles & Permissions
- β³ π οΈ Roles β Developer Guide
- β³ π€ Why capabilities are constants
- Layer 3 β the System module
- β³ π Admin Access Control
- Hardening
- β³ π Security review response 2026-08
- β³ π‘οΈ Security hardening 2026-08
- β³ π οΈ Security hardening 2026-08 β Developer Guide
- β³ π‘οΈ Round three β plain English
- β³ π οΈ Round three β Developer Guide
- Single Sign-On (SSO)
- ποΈ LDAP & Active Directory
- Browser Extension
- API Reference
-
π REST API β how it works
- β³ π« REST API: Tickets
- β³ π» REST API: Assets
- β³ π΄ REST API: Problems
- β³ π REST API: Changes
- β³ π REST API: Knowledge
- β³ β REST API: Tasks
- β³ ποΈ REST API: CMDB
- β³ π REST API: Contracts
- β³ ποΈ REST API: Calendar
- β³ πΏ REST API: Software
- β³ π¦ REST API: Service Status
- β³ βοΈ REST API: Morning Checks
- β³ π REST API: Forms
- β³ βοΈ REST API: Workflow
- β³ πΊοΈ REST API: Network Mapper
- β³ π§ Using the API docs page
- β³ π OpenAPI specification
- β³ β OpenAPI: kept correct
- β³ π οΈ Maintaining the catalogue
- Watchtower
-
Tickets
- β³ Mailbox Authentication
- β³ π€ Email send log
- β³ Basic IMAP mailboxes
- β³ Email rendering & images
- β³ SLA Management
- β³ WhatsApp channel
- β³ π¬ Web chat channel
- β³ π£ Slack channel
- β³ π Linking tickets
- β³ ποΈ Canned responses
- β³ βοΈ Limiting replies to particular senders
- β³ βοΈ Email signatures
- β³ π The public web address
- β³ π Raising a ticket for someone else
- β³ π Merging tickets
- β³ β Splitting tickets
- β³ β Selecting several tickets
- β³ π οΈ Snoozing tickets β Developer Guide
- β³ π₯ Collision detection
- β³ β±οΈ Time tracking
- Problem Management
- Tasks
- Assets
- Knowledge
- Change Management
- Calendar
- Morning Checks
- Reporting
- Software
- Forms
- Contracts
- Service Status
- π Notifications
- π¨ War Room
- Self-Service Portal
- LMS
- Process Mapper
- CMDB
- Network Mapper
- Workflows
- Issue trackers (Jira, Azure DevOps)
- System
-
Overview
- β³ π Progress tracker
- β³ Concepts & vocabulary
- β³ Email routing & mailboxes
- β³ Settings: global vs per-company
- β³ Users & self-service
- β³ Staff cross-company access
- β³ Worked examples
- β³ Pitfalls & gotchas
- β³ Scope: what it's for
- β³ π οΈ Developer Guide (make a module multi-company)
- β³ ποΈ Case study: CMDB (a linked graph)
- β³ π§ͺ Test harness (prove it's isolated)