Branches
List branches
GET /api/admin/branches?action=list
Returns all branches with their status, stats, and configuration.
Required permission: api.admin.branches.view
Import branches from CSV
POST /api/admin/branches?action=bulk_import
Bulk-imports branches from an uploaded CSV file. Use action=download_template first to get the correct column format.
Required permission: api.admin.branches.viewRequires CSRF token.
Must be
bulk_import.CSV file with branch data. Download the template for column format.
CSRF token from
GET /api/security/csrf-token.Download branch CSV template
GET /api/admin/branches?action=download_template
Returns a CSV file with headers for the bulk branch import.
Required permission: api.admin.branches.view
Enable a branch
POST /api/admin/enable-branch
Re-enables a disabled branch, allowing agents and jobs to be assigned to it.
Required permission: api.admin.enable_branch.manageRequires CSRF token.
ID of the branch to enable.
CSRF token.
Disable a branch
POST /api/admin/disable-branch
Disables a branch. Existing jobs are preserved; no new jobs can be raised against a disabled branch.
Required permission: api.admin.disable_branch.manageRequires CSRF token.
ID of the branch to disable.
CSRF token.
Roles & permissions
List roles
GET /api/admin/roles
Returns all defined roles with their associated permission sets. Pass ?id=<role_id> to retrieve a single role. Pass ?include_permissions=true to include full permission data for each role.
Required permission: api.admin.roles.manage
Create a role
POST /api/admin/roles
Creates a new role.
Required permission: api.admin.roles.manageRequires CSRF token.
Display name for the role.
Optional description of the role.
Hierarchy level (lower = more powerful). Must be strictly higher than the requesting user’s own role level.
Display order.
Whether the role is active (
1) or inactive (0).ID of a parent role to inherit permissions from (optional).
Set to
1 to copy the parent role’s permissions as the starting set.CSRF token.
List permissions
GET /api/admin/permissions/manage?action=list
Returns all available permission keys, grouped by category.
Required permission: api.admin.roles.manage
Get staff permissions
GET /api/admin/staff-permissions
Returns the resolved permission set for a specific staff user.
Required permission: api.admin.roles.manage
Staff user ID.
Activity log
Get activity log
GET /api/admin/activity-log
Returns a paginated audit trail of all user actions across the platform.
Required permission: api.admin.activity_log.view
Full-text search across name, email, IP address, and activity details (applied after decryption).
Filter by activity type string (e.g.
login, branch_disabled, staff_-prefixed for all staff actions).Relative time window:
24h, 7d, 30d, 90d, or all.Filter to activities related to a specific job UUID.
Page number.
Results per page (max 100).
Email logs
List email logs
GET /api/admin/email-logs
Returns a paginated log of all outbound emails sent by the platform. Supports action=details to fetch a single email by ID, and action=stats for aggregate delivery statistics.
Required permission: api.admin.email_logs.manage
list (default) — paginated email log.details — single email record (requires id).stats — aggregate delivery statistics.Email log ID. Required when
action=details.Filter by delivery status (e.g.
sent, failed, delivered, opened, bounced).Filter by date range:
today, a number of days (e.g. 7, 30, 90), or all.Search by recipient email, subject, or job reference.
Page number.
Results per page (max 100).
Resend an email
POST /api/admin/resend-email
Retries a failed email delivery.
Required permission: api.admin.email_logs.viewRequires CSRF token.
ID of the email log entry to resend.
CSRF token.
Rate limiting
Get / manage rate limit configuration
GET /api/admin/rate-limiting · POST /api/admin/rate-limiting · PUT /api/admin/rate-limiting
All operations on this endpoint are action-driven via the action parameter. Available actions: get_settings, update_settings, bulk_update, get_violations, clear_limits.
Required permission: api.admin.rate_limiting
Action to perform. For GET:
get_settings, get_violations. For POST/PUT: update_settings, bulk_update, clear_limits.Required for
get_settings and get_violations — ID of the endpoint to retrieve settings for.User management
Get user management policy
GET /api/admin/user-management-policy
Returns the current policy for user creation, password rules, and account lifecycle.
Required permission: api.admin.user_management_policy.view
API usage stats
Get API usage statistics
GET /api/admin/api-usage-stats
Returns daily API usage statistics for chart visualisation over the requested number of days.
Required permission: api.admin.api_usage_stats.manage
Number of days to retrieve (1–365).
Optional — filter statistics to a specific endpoint ID.
Document management
List job documents (admin)
GET /api/admin/job-documents
Returns all job documents grouped by job, or retrieves document statistics / document-type counts depending on the action parameter. Staff admin only.
Required permission: api.admin.job_documents.view
list — all active documents grouped by job.stats — aggregate counts and total file size.document-types — document-type names with per-type document counts.regenerate-thumbnails — regenerate thumbnail images for all stored documents (requires api.admin.job-documents.regenerate-thumbnails permission).Get orphaned files
GET /api/admin/orphaned-files
Lists uploaded files that are no longer attached to any job, document record, or certification. Used for storage cleanup.
Required permission: api.admin.documents.manage
Document Types
Document types define the categories used when uploading documents to a job (e.g. Gas Safety Certificate, Electrical Report, Invoice).List document types
GET /api/admin/document-types
Returns all configured document type categories.
Required permission: api.admin.document-types.manageAccount types: Staff only
Create a document type
POST /api/admin/document-types
Required permission: api.admin.document-types.manageRequires CSRF token.
Display name for the document type (e.g.
"EICR Report").Category heading used to group documents (e.g.
"Compliance").Permission key for this document type. Must start with
document. followed by lowercase letters, numbers, and underscores (e.g. document.eicr_report).Display order.
CSRF token from
GET /api/security/csrf-token.Update a document type
PUT /api/admin/document-types
Required permission: api.admin.document-types.manageRequires CSRF token.
ID of the document type to update.
Updated display name.
Updated category heading.
Updated permission key (must start with
document.).Updated display order.
1 to activate, 0 to deactivate.CSRF token.
Delete a document type
DELETE /api/admin/document-types
Deactivates a document type. Returns an error if documents of this type are currently attached to active jobs.
Required permission: api.admin.document-types.manage
ID of the document type to delete (passed as a query parameter).
Legal Documents
Legal documents are rich-text pages (privacy policy, terms of service, cookie notice) displayed to users on the login screen and in the account area. They can be targeted to specific account types.List legal documents
GET /api/admin/documents
Returns all legal documents.
Required permission: api.admin.documents.manageAccount types: Staff only
Create a legal document
POST /api/admin/documents
Required permission: api.admin.documents.manageRequires CSRF token.
Document title (e.g.
"Privacy Policy").URL-safe identifier (e.g.
"privacy-policy"). Must be unique.Rich-text HTML content of the document.
Version string (e.g.
"1.3"). Shown to users when they accept the document.Comma-separated account type IDs to show this document to (e.g.
"1,2,4"). Leave empty to show to all.Whether the document is currently shown to users.
CSRF token from
GET /api/security/csrf-token.Delete a legal document
DELETE /api/admin/documents
Required permission: api.admin.documents.manageRequires CSRF token.
ID of the document to delete.
CSRF token.
Job Tags & Reference Data
Job tags cover the configurable lookup tables for job types, statuses, priorities, and title templates.Get job reference data
GET /api/admin/job-tags
Returns configurable reference data used across jobs. The type parameter selects which table to retrieve.
Required permission: api.admin.job_tags.viewAccount types: Staff only
Data type to retrieve:
types, priorities, statuses, or titles.Create job reference data
POST /api/admin/job-tags
Adds a new entry to the selected reference table.
Required permission: api.admin.job_tags.viewRequires CSRF token.
Target table:
type, priority, status, or title.Display name of the new entry.
Hex color code used for status badges (e.g.
"#22c55e").Pattern value (for job types).
Effect value (for job types).
Whether the entry is active.
CSRF token from
GET /api/security/csrf-token.Settings Configuration
These endpoints manage the admin settings page structure — groups and individual setting fields. They are used internally by the PropOps settings UI.Save a settings group
POST /api/admin/settings/configuration/save-group
Creates or updates a settings group (a logical grouping of settings fields within the admin panel).
Required permission: api.admin.settings.configuration.save_group.manageAccount types: Staff only
Requires CSRF token.
Group ID to update. Omit to create a new group.
Display name for the group (e.g.
"Email Settings").URL-safe key (e.g.
"email-settings").Icon key to display alongside the group name.
Display order within the settings page.
CSRF token from
GET /api/security/csrf-token.Delete a settings group
POST /api/admin/settings/configuration/delete-group
Removes a settings group and all its associated fields.
Required permission: api.admin.settings.configuration.save_group.manageRequires CSRF token.
ID of the settings group to delete.
CSRF token.
Save a settings page
POST /api/admin/settings/configuration/save-page
Creates or updates individual setting field values within a group.
Required permission: api.admin.settings.configuration.save_group.manageRequires CSRF token.
Slug of the parent settings group.
Key-value map of setting keys and their new values (e.g.
{"smtp_host": "mail.yourcompany.com"}).CSRF token.
Permissions Dropdown
Load permission checkboxes
GET /api/admin/permissions-dropdown
Returns rendered HTML permission checkboxes for a specific role or account type and category, used to lazy-load sections of the permissions management UI. The response is always a JSON envelope containing the rendered HTML string.
Required permission: api.admin.permissions_dropdown.viewAccount types: Staff only
role or account_type.ID of the role or account type to load permissions for.
Permission category to filter by (e.g.
api.jobs, page.dashboard, document.gas).Type of permissions to return:
api, page, or document.Accepted values:
html or json. Both return the same JSON envelope; this parameter is validated but does not change the response structure.API Discovery
List discovered endpoints
GET /api/admin/api-discovery
Returns all discovered API endpoints registered in the system, including their health status, supported methods, and permission requirements. Optionally filter by health status.
Required permission: api.admin.api_discovery.manageAccount types: Staff only
get_endpoints — return all registered endpoints.get_statistics — aggregate endpoint counts and health summary.get_endpoint_history — health check history for a specific endpoint (requires endpoint_id).get_usage_logs — recent usage log entries (requires endpoint_id).Filter by health status:
healthy, warning, or error.Required when
action=get_endpoint_history or action=get_usage_logs — ID of the endpoint.Run API discovery
POST /api/admin/api-discovery
Scans the /api directory and registers all discovered endpoints and action types. Use discover_endpoints for a full scan or register_actions to synchronise action types only.
Required permission: api.admin.api_discovery.manageAccount types: Staff only
Requires CSRF token.
discover_endpoints — scan and register all API endpoints.register_actions — register action types from permission keys and annotations.CSRF token from
GET /api/security/csrf-token.API Permissions
List API permission configurations
GET /api/admin/api-permissions
Returns the full list of API permission configurations stored in the access registry. Optionally retrieve a single entry by ID or filter by category / search term.
Required permission: api.admin.api_permissions.manageAccount types: Staff only
If provided, returns the single API permission configuration with this ID.
Filter results to a specific
api_category value.Search across
api_path, api_name, and description.Create an API permission configuration
POST /api/admin/api-permissions
Creates a new API permission configuration entry in the access registry.
Required permission: api.admin.api_permissions.manageAccount types: Staff only
Requires CSRF token.
The API endpoint path (e.g.
/api/jobs/manage).Human-readable name for this endpoint.
One of:
public, authenticated, permission, account_type, custom.Category grouping (e.g.
jobs, admin).HTTP method this configuration applies to (e.g.
GET, POST, *).Dot-notation permission key required when
access_level=permission.Account type IDs that are permitted to access this endpoint.
Optional description.
1 to enable, 0 to disable.CSRF token from
GET /api/security/csrf-token.Update an API permission configuration
PUT /api/admin/api-permissions
Updates an existing API permission configuration entry.
Required permission: api.admin.api_permissions.manageAccount types: Staff only
Requires CSRF token.
ID of the configuration to update.
CSRF token.
POST fields except api_path are accepted as optional update fields. Provide id to identify the record and csrf_token for CSRF protection.
Delete an API permission configuration
DELETE /api/admin/api-permissions
Removes an API permission configuration entry from the access registry.
Required permission: api.admin.api_permissions.manageAccount types: Staff only
Requires CSRF token.
ID of the configuration to delete.
CSRF token.