Total Access Docs
Guides

Module Context

Scope webhooks and API keys to specific modules for granular access control.

Module Context

Total Access supports module-scoped webhooks and API keys. This allows you to restrict integrations to specific modules (e.g. Fleet, Finance, HR) for better security and organization.

Why module context?

  • Security — Limit API keys to only the scopes needed for a specific module
  • Organization — Group webhooks by module for easier management
  • Filtering — Inbound webhooks scoped to a module only accept relevant data types
  • Permissions — Module-level permission checks ensure users can only manage integrations for modules they have access to

Available modules

Module KeyNameTypical Scopes
financeTotal Financeinvoices:read, invoices:write, bills:read, payments:read
operationsTotal Operationswork_items:read, work_items:write
connectTotal CRMcontacts:read, contacts:write
hrTotal Workforceemployees:read, employees:write
time_attendanceTime & Attendanceattendance:read, attendance:write, shifts:read, timesheets:read
fleetTotal Fleetvehicles:read, tracking:read
inventoryTotal Inventoryinventory:read, inventory:write, products:read
formsTotal Formsforms:read, forms:write, forms:submit
allAll ModulesAny scope

API keys with module context

When creating an API key, the scopes you select implicitly define the module context. For example, a key with only invoices:read and invoices:write scopes is effectively a Finance module key.

curl -X POST https://totalaccess.co.za/api/v1/integrations/api-keys \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Fleet Integration Key",
    "permissions": {
      "scopes": ["vehicles:read", "tracking:read", "tracking:write"]
    }
  }'

Inbound webhooks with module context

Inbound webhooks can be scoped to a specific module, which restricts the available webhook types:

curl -X POST https://totalaccess.co.za/api/v1/integrations/inbound-webhooks \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Fleet GPS Tracker",
    "webhook_type": "vehicle_location",
    "auth_method": "api_key",
    "module_context": "fleet"
  }'

Module-restricted webhook types

ModuleAllowed Webhook Types
fleetfleet_webview, vehicle_location, custom
financepayment_notification, data_sync, custom
allAll types

Outbound webhooks with module context

Outbound webhooks are naturally scoped by the events you subscribe to. Subscribing to job.created and job.completed effectively creates an Operations module webhook.

You can further restrict with filters:

{
  "events": ["work_item.created", "work_item.updated"],
  "filters": {
    "work_item_types": ["job", "task", "project"]
  }
}

Module context is advisory for outbound webhooks — it helps with organization but doesn't enforce restrictions. The event subscription and filters are the actual enforcement mechanism.

On this page