The four kinds of credential
| Credential | Who creates it | Protects | Sent as |
|---|---|---|---|
| Tenant API key | Silux Chat (Dashboard → API Settings) | Your calls to Silux Chat: /api/chatbot-api/*, /api/sandbox/* | X-API-Key |
| Account Connect key | You | Silux Chat’s calls to your own five endpoints | X-API-Key (header name configurable) |
| Connector credentials | Your vendor (Shopify, Xero …) | Silux Chat’s read-only calls to that vendor | Whatever the vendor requires |
| Per-connection access key | Silux Chat, automatically | The bot’s calls to /api/connect/{id}/… | X-API-Key |
Treat every key like a password
Never place any of these in browser JavaScript, a mobile app, a public repository or a support ticket. All of them are designed for server-to-server use only.Your tenant API key
Each Silux Chat account has one API key, shown in Dashboard → API Settings. It identifies your account on the platform API: creating tickets (/api/chatbot-api/create-ticket), managing your sandbox and webhooks (/api/sandbox/*) and the other endpoints in the platform API reference.
X-API-Key: <your tenant API key>- Pressing Regenerate in API Settings issues a new key and the old one stops working immediately.
- Your sandbox has its own separate key (beginning
sbx_) that can never touch live data. - A missing or unknown key returns
401with{"detail":"Invalid API key"}.
curl -s "https://www.siluxchat.com/api/sandbox/webhooks" \
-H "X-API-Key: invalid"{"detail": "Invalid API key"}Account Connect key
When you build the five Account Connect endpoints, you choose the key. Generate a long random value, store it in your server’s secret store, and enter the same value in Dashboard → Integrations → Account Connect. Silux Chat sends it on every request.
openssl rand -base64 36 | tr '+/' '-_' | tr -d '='Checking it on your side
Compare the incoming key in constant time so an attacker cannot learn it one character at a time from response timings, and reject the request before doing any work.
import hmac, os
from fastapi import Header, HTTPException
API_KEY = os.environ["ACCOUNT_CONNECT_API_KEY"]
def require_key(x_api_key: str = Header(None)):
if not x_api_key or not hmac.compare_digest(x_api_key, API_KEY):
raise HTTPException(401, {"success": False, "message": "Missing or wrong X-API-Key"})A different header name
If your gateway already uses another header (for exampleX-Silux-Key or Authorization), change the header name next to the key on the dashboard. The default is X-API-Key.Connector credentials
A ready-made connector uses whatever your vendor issues. Each connector page lists exactly which fields it asks for and where to find them. Always create the key with read-only permissions.
| Auth type | What you enter | How it is sent to the vendor |
|---|---|---|
| header | An API key | In a vendor-specific header, e.g. X-Shopify-Access-Token |
| bearer | An API token | Authorization: Bearer <token> |
| basic | A key and a secret (or user and password) | Authorization: Basic base64(key:secret) |
| query | An API key | As a query parameter the vendor names |
| oauth2 | Nothing — you sign in with the vendor | Authorization: Bearer <access token>, refreshed automatically |
| client_credentials | A client ID and client secret | Exchanged for a short-lived token, fetched automatically |
| none | A private webhook address | The unguessable URL is the credential |
- Credentials are encrypted before they are stored and are never shown again after saving — the dashboard shows only that a value is set.
- Every connection is tested with a real call before it is marked working, using a made-up customer so no real record is read.
- Disconnecting deletes the stored credentials outright, not merely hides them.
OAuth sign-in
For vendors that support it, the dashboard shows Sign in with <vendor> instead of key fields. You never handle a token.
- 1You press Sign in with <vendor>. Silux Chat creates a pending connection with a random
statevalue and sends you to the vendor’s consent screen, requesting only the read scopes listed on that connector’s page. - 2You approve access at the vendor.
- 3The vendor redirects to
https://www.siluxchat.com/api/connectors/oauth/callbackwith a one-time code and the samestate. A callback whose state does not match a pending connection is rejected. - 4Silux Chat exchanges the code for tokens, encrypts them, runs the connection test and returns you to Dashboard → Integrations with the result.
- 5Access tokens are refreshed automatically shortly (about 60 seconds) before they expire, so the bot never meets an expired token mid-conversation.
Where OAuth is not yet available
OAuth needs Silux Chat’s own app to be registered with each vendor. If it is not registered yet for your vendor, the dashboard tells you so and our team is notified. Where the vendor also offers API keys, you can connect with a key in the meantime.Client credentials
Connectors marked client_credentials (for example commercetools) take a client ID and secret. Silux Chat requests a short-lived access token from the vendor when needed and renews it before it expires; the secret itself is only ever sent to the vendor’s token endpoint.
Per-connection access keys
When you press Use to verify customers on a connector, Silux Chat exposes that connection through the standard Account Connect endpoints at:
https://www.siluxchat.com/api/connect/{connection_id}/verify-identity
https://www.siluxchat.com/api/connect/{connection_id}/verify-otp
https://www.siluxchat.com/api/connect/{connection_id}/account-summary
https://www.siluxchat.com/api/connect/{connection_id}/orders | invoices | bookings | subscriptions | tickets- These are called by your bot, not by you. They are protected by a per-connection access key beginning
scc_, generated automatically. - Only a SHA-256 hash of the key is kept for checking requests. The key is never displayed.
- Each press of Use to verify customers mints a new key and retires the previous one.
- Disconnecting the connector deletes the key and switches the bot’s account tools off.
curl -s -X POST "https://www.siluxchat.com/api/connect/1/verify-identity" \
-H "Content-Type: application/json" \
-d '{"full_name":"Jane Demo","email":"jane.demo@example.com"}'{
"detail": {
"success": false,
"message": "Missing or wrong X-API-Key"
}
}Key rotation
| Credential | How to rotate | Downtime |
|---|---|---|
| Tenant API key | Dashboard → API Settings → Regenerate, then update your servers. | Calls with the old key fail from the moment you regenerate — update your systems straight away. |
| Account Connect key | Accept both old and new keys on your side, enter the new key on the dashboard and press Connect & test, then remove the old key. | None if you accept both keys briefly. |
| Connector API key | Create a new read-only key at the vendor, reconnect the connector with it, then revoke the old key at the vendor. | None. |
| OAuth connection | Sign in again; revoke the old grant in the vendor’s connected-apps list. | None. |
| Per-connection access key | Press Use to verify customers again. | None — the bot is re-wired with the new key at once. |
import hmac, os
KEYS = [k for k in (os.environ.get("AC_KEY"), os.environ.get("AC_KEY_PREVIOUS")) if k]
def key_ok(given: str) -> bool:
return bool(given) and any(hmac.compare_digest(given, k) for k in KEYS)If a vendor key is revoked
A daily health check re-tests every connection. If one that was working starts being refused (a revoked key or expired sign-in), the account owner is emailed once and the bot tells customers it can’t check accounts right now until you reconnect.Authentication errors
FastAPI wraps error bodies in detail. Account Connect and connector endpoints put a structured object inside it; the platform API uses a string.
| Where | Status | Body | Cause |
|---|---|---|---|
| Demo and /api/connect/{id}/* | 401 | {"detail":{"success":false,"message":"Missing or wrong X-API-Key"}} | Missing or wrong key |
| Demo and /api/connect/{id}/* | 401 | {"detail":{"success":false,"message":"Session expired — please verify again."}} | Session token unknown or older than 30 minutes |
| /api/chatbot-api/*, /api/sandbox/* | 401 | {"detail":"Invalid API key"} | Unknown tenant key |
| Connector test | — | the vendor refused the credentials (401) | Vendor key revoked, wrong, or missing a read scope (403) |
curl -s -X POST "https://www.siluxchat.com/api/account-connect-demo/v1/verify-identity" \
-H "X-API-Key: wrong-key" \
-H "Content-Type: application/json" \
-d '{"full_name":"Test Customer","postcode":"TE5 7ST"}'{"detail": {"success": false, "message": "Missing or wrong X-API-Key"}}The correct key for the demo is demo-account-connect-key. See Troubleshooting for every other error.
Get help
Unsure which scopes to grant, or need a vendor’s OAuth sign-in prioritised? Email support@siluxcall.co.uk. Never include a live key in your email — we will never ask for one.
Need help with your integration?
Our integration team can review your endpoints, help you choose the right connector and check a test run with you. Tell us which system you use and what you would like the bot to answer.