API Reference · Introduction
Authentication
Every API request is authenticated with an API key that belongs to your company. The key decides which company's data you see and whether you may change anything.
Get a key
The company owner or an admin creates keys in the dashboard under System Settings → API Keys (see Create an API key). The full key is shown once, when it's created. Keys can't be created or revoked over the API.
Keys look like this — the start tells you what kind of key it is:
Key types
vk_live_…Full accessvk_test_…Read-onlyGET requests. Anything else is refused with 403. It reads your real data — it is not a sandbox.Send the key
Put the key in the Authorization header as a bearer token:
curl https://calling.ubiqproject.com/api/v1/campaigns \
-H "Authorization: Bearer vk_live_YOUR_KEY"Or, if your tool can't set an Authorization header, use X-API-Key:
curl https://calling.ubiqproject.com/api/v1/campaigns \
-H "X-API-Key: vk_live_YOUR_KEY"If you send both, X-API-Key wins. A bearer token is only treated as an API key when it starts with vk_.
Check a key
Call GET /whoami to confirm a key works and see whether it is full access or read-only.
When authentication fails
Responses
Invalid API key401Not authenticated401Authorization header isn't Bearer vk_….This API key is read-only403vk_test_ key was used for a POST, PATCH or DELETE.{ "detail": "Invalid API key" }Keep keys safe
- A key acts for your whole company. Use it from your server, never from a browser or a mobile app.
- Give each system its own key, so you can revoke one without breaking the others.
- Use a read-only key for anything that only reports on results.
- If a key leaks, revoke it in API Keys straight away — it stops working on the next request.
Keys act as an admin