/api/v1/operator/businesses
auth: jwt (operator)List every business (cross-tenant) with its licence-key id, licensed connectors and connector limits, plus platform-wide stats (total businesses, businesses created this calendar month, total licence keys, total users). Operator-only; no Administrator bypass.
handlers: requireOperator → OperatorController.listBusinesses
No parameters.
APIResponse<OperatorBusinessesResponse>APIError/api/v1/operator/businesses/:businessId/users
auth: jwt (operator)List all users belonging to the given business (cross-tenant read for operators).
handlers: requireOperator → validate(OperatorBusinessIdParamsSchema, params) → OperatorController.listBusinessUsers
| name | required | default | description |
|---|---|---|---|
businessId pathuuid | yes | — | Target business UUID. Operators have no businessId of their own; there is no `requireBusinessAccess` check, so any tenant can be addressed. |
APIResponseDataList<UserAdminDTO>APIErrorAPIError/api/v1/operator/licence-keys
auth: jwt (operator)List all business licence keys. Each entry is `unused` or `used` (by `UsedAt`) with creation and use timestamps and the business that used it; the key hash or plaintext is never returned.
handlers: requireOperator → OperatorController.listLicenceKeys
No parameters.
APIResponseDataList<OperatorLicenceKeyDTO>APIError/api/v1/operator/licence-keys
auth: jwt (operator)Generate a single-use business licence key. Only its argon2id hash is persisted; the plaintext is returned once and is required to register a business via `POST /api/v1/businesses/register`. Fires `LICENCE_KEY_GENERATED` audit (resource type `CONFIG`, actor = the operator).
handlers: requireOperator → validate(CreateLicenceKeyBodySchema, body) → OperatorController.createLicenceKey
| name | required | default | description |
|---|---|---|---|
connectors bodyConnectorType[] | null | yes | — | Connectors the licensed business may use. A non-empty array, or an explicit `null` for no restriction; an empty array or omitting the field is rejected. |
connectorLimits bodyRecord<ConnectorType, { maxApiKeys?: number | null; maxConnections?: number | null }> | null | no | — | Optional per-connector resource limits. Each value is a positive integer, or null/omitted for unlimited. Omitted/null means every connector is unlimited. Not cross-validated against `connectors`. |
APIResponseDataObject<{ id: string; licenceKey: string }>APIErrorAPIError/api/v1/operator/licence-keys/:id
auth: jwt (operator)Revoke a licence key that has not been used. Fires `LICENCE_KEY_REVOKED` audit (resource type `CONFIG`).
handlers: requireOperator → validate(OperatorLicenceKeyIdParamsSchema, params) → OperatorController.revokeLicenceKey
| name | required | default | description |
|---|---|---|---|
id pathuuid | yes | — | Licence key UUID. |
voidAPIErrorAPIErrorAPIError/api/v1/operator/businesses/:businessId/licensed-connectors
auth: jwt (operator)Full-replace of a business's licensed-connector allow-list. Operator-only; the business's own Administrator has no equivalent write path. Fires `LICENSED_CONNECTORS_UPDATED` audit with before and after values.
handlers: requireOperator → validate(OperatorBusinessIdParamsSchema, params) → validate(UpdateLicensedConnectorsBodySchema, body) → OperatorController.updateLicensedConnectors
| name | required | default | description |
|---|---|---|---|
businessId pathuuid | yes | — | Target business UUID. Operators have no businessId of their own; there is no `requireBusinessAccess` check, so any tenant can be addressed. |
connectors bodyConnectorType[] | null | yes | — | New allow-list: a non-empty array of `ConnectorType`, or `null` for unrestricted. Empty array is rejected. |
APIResponseDataObject<{ businessId: string; licensedConnectors: string[] | null }>APIErrorAPIErrorAPIError/api/v1/operator/businesses/:businessId/connector-limits
auth: jwt (operator)Upsert one connector's resource limits (max API keys, max connections) for a business. A null or omitted field means unlimited. Fires `CONNECTOR_LIMITS_UPDATED` audit with before and after values.
handlers: requireOperator → validate(OperatorBusinessIdParamsSchema, params) → validate(UpdateConnectorLimitsBodySchema, body) → OperatorController.updateConnectorLimits
| name | required | default | description |
|---|---|---|---|
businessId pathuuid | yes | — | Target business UUID. Operators have no businessId of their own; there is no `requireBusinessAccess` check, so any tenant can be addressed. |
connector bodyConnectorType | yes | — | The connector whose limits are being set. |
maxApiKeys bodynumber | null | no | — | Positive integer, or null/omitted for unlimited. |
maxConnections bodynumber | null | no | — | Positive integer, or null/omitted for unlimited. |
APIResponseDataObject<{ businessId: string; connectorLimits: Record<string, ConnectorLimitConfig> }>APIErrorAPIErrorAPIError/api/v1/operator/businesses/:businessId/connectors
auth: jwt (operator)Per-connector health rollup for a business: last activity, last error, total and error counts, and per-document-type counts (sales, refunds, copies, quotes, training). Connectors that are configured but have no activity yet are included with zeroed counts, appended after the activity-bearing ones.
handlers: requireOperator → validate(OperatorBusinessIdParamsSchema, params) → OperatorController.listConnectors
| name | required | default | description |
|---|---|---|---|
businessId pathuuid | yes | — | Target business UUID. Operators have no businessId of their own; there is no `requireBusinessAccess` check, so any tenant can be addressed. |
APIResponse<ConnectorHealthResponse>APIErrorAPIError/api/v1/operator/businesses/:businessId/connectors/:connector/activity
auth: jwt (operator)Paginated, newest-first invoice activity feed for one connector of a business, with a status summary. Supports status, invoice-number search and document-type filters.
handlers: requireOperator → validate(OperatorConnectorActivityParamsSchema, params) → validate(OperatorConnectorActivityQuerySchema, query) → OperatorController.listConnectorActivity
| name | required | default | description |
|---|---|---|---|
businessId pathuuid | yes | — | Target business UUID. Operators have no businessId of their own; there is no `requireBusinessAccess` check, so any tenant can be addressed. |
connector pathConnectorType | yes | — | Connector to list activity for; must be a `ConnectorType` value. |
page querynumber | no | 1 | 1-based page number (integer, min 1). |
pageSize querynumber | no | 25 | Page size (integer, 1–100). |
status querystring | no | — | Aggregate-status filter; `all` or omitted means no filter. Unknown values yield an empty list. |
search querystring | no | — | Invoice-number search (LIKE %term%); blank is ignored. |
type query'sale' | 'refund' | 'copy' | 'quote' | 'training' | 'normal' | 'advance' | no | — | Document-type filter. `all` or any unrecognised value means no filter. |
APIResponse<ConnectorActivityResponse>APIErrorAPIError/api/v1/operator/businesses/:businessId/connector-invoice-buckets
auth: jwt (operator)Invoice counts bucketed by day, month or year and by status over a lookback window, for the operator invoices-over-time chart. Optionally narrowed to one connector. Buckets are zero-filled and ordered oldest to newest.
handlers: requireOperator → validate(OperatorBusinessIdParamsSchema, params) → validate(OperatorConnectorBucketsQuerySchema, query) → OperatorController.listConnectorInvoiceBuckets
| name | required | default | description |
|---|---|---|---|
businessId pathuuid | yes | — | Target business UUID. Operators have no businessId of their own; there is no `requireBusinessAccess` check, so any tenant can be addressed. |
days querynumber | no | 30 | Lookback window in days (integer, min 1). Capped per granularity: day 90, month 730, year 3650; a larger value is rejected. |
granularity query'day' | 'month' | 'year' | no | day | Bucket size. `week` is not supported and is rejected. |
connector queryConnectorType | no | — | Single-connector filter; omitted means all connectors for the business. |
APIResponse<ConnectorInvoiceBucketsResponse>APIErrorAPIError