Authentication
Learn how to authenticate with the Servicebay API
Authentication
The Servicebay API uses API keys for authentication. Every request must include a valid API key.
Getting an API Key
- Sign in to the Developer Portal with your Servicebay account
- Navigate to the Dashboard
- Select your organisation from the dropdown
- Click "Create API Key" and give it a descriptive name
- Copy and securely store your API key - it will only be shown once!
Using Your API Key
Include your API key in the X-API-Key header with every request:
curl -X GET \
'https://developer.servicebay.io/api/v1/organisations/{orgId}/customers' \
-H 'X-API-Key: sk_live_your_api_key_here' \
-H 'Content-Type: application/json'API Key Format
API keys follow this format:
- Production keys:
sk_live_followed by 32 hexadecimal characters
Example: sk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6
Key Scoping
Each API key is scoped to a single organisation. The key can only access data within that organisation.
If you need to access multiple organisations, you'll need to create separate API keys for each.
Security Best Practices
- Never expose your API key in client-side code or public repositories
- Rotate keys regularly - delete old keys and create new ones periodically
- Use environment variables to store API keys in your applications
- Revoke compromised keys immediately from the Dashboard
Admin Access Required
Only users with admin role in an organisation can:
- Create API keys for that organisation
- View existing API keys
- Revoke API keys
Regular members cannot manage API keys.