Total Access Docs
API Reference

Authentication

API keys, JWT tokens, and authentication flows.

Authentication

Total Access uses two authentication methods depending on your integration type.

API Keys

API keys are long-lived tokens ideal for server-to-server integrations. They can optionally be set to expire on a specific date; if no expiry is set, they remain valid until revoked.

Generating an API key

  1. Log in to your Total Access account
  2. Navigate to Total IntegrationAPI Keys
  3. Click Create API Key
  4. Name your key (e.g., "Production Sync")
  5. Select the scopes/permissions
  6. Copy the key immediately — it's shown only once

Using an API key

Pass your API key in the X-API-Key header:

curl -X GET https://totalaccess.co.za/api/v1/me \
  -H "X-API-Key: ta_sk_your_api_key_here" \
  -H "Content-Type: application/json"

For the Public Data API and MCP Bridge, the X-API-Key header is the only accepted authentication method.

API keys grant the same permissions as the user who created them. Use scoped keys with minimal permissions for production integrations.

Revoking a key

To revoke an API key:

  1. Go to Total IntegrationAPI Keys
  2. Find the key and click Revoke
  3. All requests using that key will immediately return 401 Unauthorized

JWT Tokens

JWT tokens are used for user-facing applications where users log in with their Total Access credentials.

Token lifecycle

TokenTTLPurpose
Access token15 minutesAuthenticate API requests
Refresh token7 daysObtain new access tokens

Login flow

curl -X POST https://totalaccess.co.za/api/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "password": "your_password"
  }'

Response:

{
  "success": true,
  "data": {
    "accessToken": "eyJhbGciOiJIUzI1NiIs...",
    "refreshToken": "eyJhbGciOiJIUzI1NiIs...",
    "expiresIn": 900
  }
}

Refreshing tokens

curl -X POST https://totalaccess.co.za/api/v1/auth/refresh \
  -H "Content-Type: application/json" \
  -d '{
    "refreshToken": "your_refresh_token"
  }'

Refresh tokens are single-use. Each refresh returns a new refresh token. Reusing an old refresh token will invalidate the entire token chain (reuse detection).

Scopes

API keys are scoped to specific permissions. Scopes are grouped by category:

Users & Employees

ScopeDescription
users:readRead user information
employees:readRead employee records and details
employees:writeCreate and update employee records

Operations

ScopeDescription
work_items:readRead work items (jobs, tasks, projects)
work_items:writeCreate and update work items
work_items:deleteDelete work items
appointments:writeCreate and update appointments
comments:writeAdd comments to work items
recurring:writeCreate and manage recurring job schedules

Threads & Messaging

ScopeDescription
threads:readRead job threads and messages
threads:writeCreate and manage threads
threads:send_messageSend messages to threads

Time & Attendance

ScopeDescription
attendance:readRead clock in/out records and attendance logs
attendance:writeCreate clock in/out records (proxy clocking)
shifts:readRead shift templates and assignments
shifts:writeCreate and update shift templates and assignments
roster:readRead shift roster and schedules
roster:writeCreate and update shift roster entries
locations:readRead locations and geofence identifiers
locations:writeCreate and update locations and geofences
timesheets:readRead timesheet records
timesheets:writeCreate and update timesheets
timesheets:approveApprove or reject timesheets
overtime:readRead overtime records
overtime:writeCreate and approve overtime requests

Finance

ScopeDescription
invoices:readRead invoices
invoices:writeCreate and update invoices
quotes:readRead quotes
quotes:writeCreate and update quotes
bills:readRead bills (supplier invoices)
bills:writeCreate and update bills
payments:readRead payment records
payments:writeCreate and update payments
chart_of_accounts:readRead chart of accounts
chart_of_accounts:writeCreate and update accounts
journal_entries:readRead journal entries
journal_entries:writeCreate and post journal entries

Contacts & Inventory

ScopeDescription
contacts:readRead customer and supplier contacts
contacts:writeCreate and update contacts
inventory:readRead stock levels and movements
inventory:writeUpdate stock and create movements
products:readRead products and services
products:writeCreate and update products

Fleet

ScopeDescription
vehicles:readRead vehicle information and fleet data
vehicles:writeCreate and update vehicle records
tracking:readRead GPS tracking and location data
tracking:writeUpdate tracking settings and geofences

Forms

ScopeDescription
forms:readRead form definitions, stats, analytics, and submissions
forms:writeCreate and update form definitions and sharing settings
forms:submitCreate form submissions via authenticated APIs
forms:submissions:readRead and export form submissions

WhatsApp & Support

ScopeDescription
whatsapp:connectConnect and manage WhatsApp instances
whatsapp:sendSend WhatsApp messages
whatsapp:receiveReceive WhatsApp messages and webhooks
whatsapp:statusCheck WhatsApp connection status
support:readRead support tickets and conversations
support:writeCreate and update support tickets

System

ScopeDescription
webhooks:manageManage webhooks
webhooks:receiveReceive inbound webhook data
settings:readRead client settings
settings:writeUpdate client settings
reports:readAccess reports and analytics
reports:exportExport reports to PDF/Excel

API key permissions are stored as { "scopes": ["scope1", "scope2", ...] }. Scope validation supports wildcard matching (e.g. finance:* matches all finance scopes).

API key environments

API keys have an environment setting:

EnvironmentKey PrefixPlaygroundFull Key Visible
testingta_sk_Yes — usable in test playgroundYes (returned on list)
productionta_sk_No — protected from test useNo (masked, requires reveal)

IP allowlisting

API keys can be restricted to specific IP addresses. When set, requests from other IPs return 403 Forbidden:

{
  "allowed_ips": ["192.168.1.100", "10.0.0.0/24", "41.123.45.67"]
}

Supports both individual IPs and CIDR notation. Leave empty to allow all IPs.

API key reveal

Production API keys are masked in list views (ta_sk_abc...wxyz). To reveal the full key:

curl -X POST https://totalaccess.co.za/api/v1/integrations/api-keys/42/reveal \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "password": "your_account_password" }'

The reveal requires the user's account password and is logged to an audit trail with IP address and user agent.

API key audit trail

All sensitive API key actions are logged:

  • Reveal — When a production key is revealed (IP, user agent, timestamp)
  • Usagelast_used_at updated on each authenticated request
  • Usage stats — Total requests, 24h count, 7d count per key

Error responses

{
  "success": false,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Invalid or expired API key"
  }
}
StatusCodeMeaning
401UNAUTHORIZEDMissing or invalid credentials
401TOKEN_EXPIREDJWT access token has expired
403FORBIDDENValid auth but insufficient permissions
429RATE_LIMITEDToo many requests

On this page