Skip to main content

API Keys

Every authenticated Streaming API call must identify the Company with three headers: X-Api-Key, X-Api-Secret, and X-Api-Version. This page explains how those credentials are provisioned, how the integration should use them, and how to keep them safe once the project has more than one environment and more than one consuming system.

Low-level HTTP rules (case-sensitive header names, errors, rate limits): HTTP API.

What the credentials are​

HeaderRole
X-Api-KeyPublic identifier of the API key for the Company.
X-Api-SecretSecret paired with the key. Treat it like a password.
X-Api-VersionAPI version. Current public integrations use 1.
X-Api-Key: <api-key>
X-Api-Secret: <api-secret>
X-Api-Version: 1

Header names are case-sensitive. A wrong or missing credential typically returns 403 with a Forbidden-style body.

Environments​

Sandbox and production are separate Companies, each with its own set of keys. The base URL does not change between them β€” https://streaming.loyal.guru serves both. What determines which environment you are calling is the credential pair, and nothing else.

That has one practical consequence worth stating early: a copy-paste of the wrong secret does not fail loudly, it succeeds against the wrong Company. Use separate keys per environment and never reuse a production secret in a test environment.

The Loyal Guru team confirms which sandbox and production Companies exist for the project during onboarding.

Where to manage keys (Owner App)​

In the Owner App, Streaming API keys live under Data Collection β†’ API Keys (Customer Data Platform / data collection area).

Operators can:

ActionNotes
Create new API KeyProvide a Description and set Enabled. The platform generates the key value and secret.
ViewInspect the key (X-api-key) and secret (X-api-secret) values for the selected record.
EditUpdate description or enabled status. System keys cannot be edited.
Enable / disableDisable a key to revoke access without deleting the record.
caution

Copy the secret when it is available and store it in your secret manager. Do not commit keys to git, Postman shared workspaces without access control, or ticket comments.

Who creates the first key​

Projects usually follow one of these paths:

PathWhen
Loyal Guru provisions keysCommon during onboarding / sandbox setup. The LG team shares key and secret out of band.
Retailer creates keys in Owner AppWhen the Company already has Owner App access and Data Collection permissions.

Verify the credentials work​

GET /check is the lightest confirmation available: it takes no parameters, changes no data, and answers whether the credentials reach the platform at all.

curl --request GET 'https://streaming.loyal.guru/check' \
--header 'X-Api-Key: YOUR_API_KEY' \
--header 'X-Api-Secret: YOUR_API_SECRET' \
--header 'X-Api-Version: 1'
{ "status": "ok" }

A 403 here isolates the problem to the credentials themselves β€” before any payload, endpoint or Company data is involved. The Quickstart uses this same call as the first step of an integration and routes you to the guide for the connection you are building.

Integration checklist for credentials​

  • One key per environment (sandbox vs production) and preferably per consuming system (POS middleware vs e-commerce vs batch jobs).
  • Rotate keys when an integrator leaves the project or a secret may have leaked.
  • Disable unused keys instead of leaving them enabled indefinitely.
  • Confirm X-Api-Version: 1 on every authenticated request.
TopicGuide
Product and store master syncCompany Data
Customer identityCustomer Data
First call and next stepsQuickstart
Full project sequenceIntegration checklist
Product configuration contextData Collection

Troubleshooting​

SymptomWhat to check
403 ForbiddenKey/secret/version headers; enabled flag; correct Company credentials for the environment you intend to call.
Works in sandbox, fails in productionDifferent Company credentials; secret not updated after cutover.
Key visible but secret unknownCreate a new key, update the integration, then disable the old key.
System key cannot be editedExpected for platform-managed keys β€” create a project-specific key instead.