Authentication and headers¶
Direct REST integrations use API key authentication. Owners and Admins create keys in the Back Office: see Getting started.
Connections from compatible AI assistants use OAuth instead of an API key. See Connect an AI assistant with MCP. The remainder of this page applies only to direct REST integrations.
Keep your API key secure
Treat your API key like a password. Store it server-side, revoke it in the Back Office if it is exposed, and never embed it in client-side code.
REST API key header¶
Send your API key in the X-Api-Key header on every request.
curl -X GET \
-H 'X-Api-Key: YOUR_API_KEY' \
-H 'X-Client-ID: YOUR_CLIENT_ID' \
-H 'X-Company-ID: YOUR_COMPANY_ID' \
'https://YOUR_ENV_DOMAIN/api/v2/management/clients/'
Replace YOUR_ENV_DOMAIN with public.production.bsport.io.
Tenant and client headers¶
Every request must include headers that identify the calling client and the tenant (company or franchisor) you are operating on.
Required headers¶
X-Api-Key: authenticates the request.X-Client-ID: the tool name entered when the API key was created.X-Company-IDorX-Franchisor-ID: sets the tenant context.
Tenant context rules¶
- Company API keys must include
X-Company-ID. - Franchise API keys must include
X-Franchisor-ID. - Franchise API keys can optionally include
X-Company-IDto act on behalf of a specific company within that franchise.
Optional headers¶
X-Timezone-Name: replaces the target company's time zone for a V2GETrequest. See Dates, time zones and amounts.
X-Client-ID must match the key
Send the tool name entered when the API key was created. Any other value returns
401.
Check your API key and usage¶
Send GET /api/v2/monitoring/me/ with your usual headers to see which key you are using and
how many calls were made on its company or franchise. The response gives the key's client_id,
its company or franchise, expires_at, and the successful calls (2xx or 3xx) of the last 12
UTC calendar months, current month first. Counts cover the whole company or franchise, not one
key. A month without calls shows 0.
The current month is live. Earlier months are copied once a day, at 02:15 Paris time: until that copy on the 1st, the previous month misses up to its last day of calls.
What the counts cover depends on the key:
| Key | monthly_usage |
companies |
|---|---|---|
| Company API key | Every call made on your company | Empty |
| Franchise API key | Every call made with your franchise's keys | Each company of the franchise, with every call made on it |
Company counts include franchise-key calls only from the release that added this endpoint, so earlier months of a franchise company show fewer calls. See the Changelog.
X-Company-ID does not change the answer for a franchise key. This call counts like any
other and follows the default rate limits.
REST API key troubleshooting¶
If you receive a 401 or 403, confirm that your API key is valid and that you
are sending the required tenant headers. See Tenant and client headers for details.