API Key Types
| Key Type | Prefix | Lifetime | Use Case |
|---|---|---|---|
| Secret Key | sk_live_ / sk_test_ | Long-lived | Server-side API calls |
| Restricted Key | rk_live_ / rk_test_ | Long-lived | Limited-scope server calls |
| Device Token | dtok_ | Long-lived | 4G device direct uploads |
| Upload Token | up_ | Short-lived (minutes) | Single recording upload |
Secret Keys
Secret keys provide full access to your project’s API. Use them only on your backend server.Restricted Keys
Restricted keys allow you to limit permissions for specific use cases. Create them in the Bota dashboard with only the scopes you need.| Scope | Description |
|---|---|
recordings:read | Read recording metadata |
recordings:write | Create recordings and uploads |
transcriptions:read | Read transcription results |
transcriptions:write | Trigger transcription jobs |
end_users:read | Read end user data |
end_users:write | Create/update end users |
devices:read | Read device data |
devices:write | Create/update/bind devices |
Device Tokens
Device tokens (dtok_*) authenticate 4G-enabled wearable devices for direct cloud uploads. Unlike other key types, device tokens are:
- Issued automatically when a device is bound to an end user
- Scoped to a single device and its bound end user
- Limited in permissions - can only create/upload recordings and report device status
- Create recordings (
POST /v1/recordings) - Get upload URLs (
POST /v1/recordings/:id/upload-url) - Complete uploads (
POST /v1/recordings/:id/upload-complete) - Send heartbeats (
POST /v1/devices/:id/heartbeat) - Refresh their token (
POST /v1/devices/:id/token/refresh)
Device tokens are returned only once when a device is bound. Store them securely on the device. If lost, unbind and rebind the device to get a new token.
Upload Tokens
Upload tokens authorize a single audio upload. They expire in minutes and are recording-scoped.Authentication Flows
Server-to-Server
Your backend authenticates directly with Bota using secret keys. For example, creating an end user:Mobile App Flow (BLE Devices)
Mobile apps authenticate through your backend, never directly with Bota. Here’s an example of uploading a recording from a BLE device via your app:4G Device Direct Upload Flow
4G-enabled devices authenticate directly with Bota using device tokens, bypassing the need for a mobile app:Device Provisioning Flow
Devices are provisioned during initial setup, typically via BLE pairing through your mobile app:Environment Separation
Bota provides separate environments for development and production:| Environment | Base URL | Key Prefix |
|---|---|---|
| Production | https://api.bota.dev/v1 | sk_live_, rk_live_ |
| Sandbox | https://api.sandbox.bota.dev/v1 | sk_test_, rk_test_ |
Security Best Practices
Store keys securely
Store keys securely
Use environment variables or a secrets manager. Never commit keys to version control.
Use restricted keys when possible
Use restricted keys when possible
If a service only needs to read transcriptions, create a restricted key with only
transcriptions:read scope.Rotate keys periodically
Rotate keys periodically
Rotate your API keys regularly and immediately if you suspect a compromise. For device tokens, use the token refresh endpoint.
Never expose keys in client code
Never expose keys in client code
Mobile apps and web frontends should never contain Bota API keys. Always proxy through your backend. Device tokens are the exception - they’re designed to be stored on devices.
Verify webhook signatures
Verify webhook signatures
Always verify the
X-Bota-Signature header when receiving webhooks to prevent spoofing.Secure device token storage
Secure device token storage
On 4G devices, store the device token in secure storage (encrypted flash, secure element if available). The token grants upload access to the bound user’s recordings.
Managing API Keys
API keys are managed in the Bota Dashboard:- Navigate to your project settings
- Select API Keys
- Create, rotate, or revoke keys as needed
- Create: Issued automatically when binding a device
- Refresh: Use the token refresh endpoint
- Revoke: Automatically revoked when unbinding a device

