All external API requests to SalesPro Hub must be authenticated using an API key. This guide covers how to create, manage, and use API keys.
Creating an API Key
- Log in as an admin user.
- Navigate to Settings > API Keys.
- Click Create API Key.
- Fill in:
- Name — A descriptive label (e.g., "Sage Production", "Warehouse Sync").
- Permissions — Select one or more scopes (see below).
- Expiration — Optionally set an expiry date. Leave empty for no expiration.
- Click Create.
- Copy the key immediately. It starts with
sk_and is only shown once.
Permissions
Each API key has one or more permission scopes that control what it can access:
| Permission | Description |
|---|---|
inventory:read | Read product data and stock levels |
inventory:write | Update stock levels (single and bulk) |
orders:read | List and retrieve orders |
orders:write | Acknowledge orders and update their status |
customers:read | List customers and retrieve CRM sync identities |
customers:write | Upsert, reactivate, and deactivate CRM-managed customers |
zapier:read | List subscriptions and retrieve sample trigger payloads |
zapier:write | Create and remove Zapier REST-hook subscriptions |
You can create separate keys with different permissions. For example:
- A read-only key for your BI/reporting tool (
orders:read,inventory:read) - A full-access key for your ERP (
orders:read,orders:write,inventory:read,inventory:write) - A CRM sync key that cannot touch orders or stock (
customers:read,customers:write) - A Zapier key limited to subscription management (
zapier:read,zapier:write)
Using Your API Key
Include your key in every request using one of these methods:
Option 1: X-API-Key Header (Recommended)
curl -X GET "https://portal.salesrepsoftware.co.za/api/v1/orders" \
-H "X-API-Key: sk_your_api_key_here" \
-H "Accept: application/json"Option 2: Bearer Token
curl -X GET "https://portal.salesrepsoftware.co.za/api/v1/orders" \
-H "Authorization: Bearer sk_your_api_key_here" \
-H "Accept: application/json"Both methods are equivalent. Use whichever fits your system better.
Managing API Keys
Viewing Keys
The API Keys page shows all keys for your organisation:
- Name
- Permissions (as badges)
- Last used timestamp
- Expiration date
- Status (Active, Disabled, Expired)
Disabling a Key
Click the toggle button on any key to disable it. Disabled keys are immediately rejected. You can re-enable them at any time.
Deleting a Key
Click the delete button and confirm. Deletion is permanent. Any system using that key will lose access immediately.
Key Expiration
Keys with an expiration date automatically stop working after that date. The key remains visible in your list with an "Expired" badge but cannot be used.
Security Best Practices
- Use separate keys for each integration — If one system is compromised, revoke just that key.
- Use minimum required permissions — A reporting tool only needs read access.
- Set expiration dates — Rotate keys periodically, especially for third-party integrations.
- Never expose keys in client-side code — API keys should only be used in server-to-server calls.
- Store keys securely — Use environment variables or a secrets manager, not code repositories.
- Monitor usage — Check the "Last Used" column regularly to spot inactive or unexpected usage.
Rate Limits
External endpoints have a 60-request-per-minute route throttle in addition to the tenant's daily plan quota.
| Plan | Daily tenant quota |
|---|---|
| Professional | 5,000 requests/day |
| Enterprise | No practical daily plan quota |
Successful API responses include X-RateLimit-Limit and
X-RateLimit-Remaining. Exceeding the daily quota returns 429 with a
Retry-After header. The daily counter resets at midnight UTC.
Authentication Errors
| Status | Error | Meaning |
|---|---|---|
| 401 | API key required | No key was provided in the request |
| 401 | Invalid or expired API key | Key doesn't exist, was deleted, or has expired |
| 402 | Organization subscription is not active | The tenant's subscription cannot use the API |
| 403 | Organization account is inactive | Your SalesPro Hub account is suspended |
| 403 | API access is not available on the current plan | The tenant plan does not include external APIs |
| 403 | Insufficient permissions. Required: orders:write | Your key doesn't have the required permission |
| 429 | Daily API call limit exceeded | The tenant's daily quota is exhausted |
See Errors & Troubleshooting for more details.