Quickstart
Get started with the Servicebay API in minutes
Quickstart Guide
Get up and running with the Servicebay API in just a few minutes.
Prerequisites
- A Servicebay account with admin access to at least one organisation
- An API key from the Developer Portal
Step 1: Get Your API Key
- Go to developer.servicebay.io/login
- Sign in with your Servicebay credentials
- Select your organisation
- Click "Create API Key"
- Copy and save your key securely
Step 2: Make Your First Request
Let's fetch your organisation's customers:
curl -X GET \
'https://developer.servicebay.io/api/v1/organisations/YOUR_ORG_ID/customers' \
-H 'X-API-Key: sk_live_your_api_key' \
-H 'Content-Type: application/json'Step 3: Check the Response
A successful response looks like this:
{
"success": true,
"data": {
"customers": [
{
"id": "abc123",
"firstName": "John",
"lastName": "Doe",
"email": "john@example.com",
"phone": "+1234567890",
"createdAt": "2025-01-15T10:30:00Z"
}
],
"pagination": {
"limit": 50,
"hasMore": false,
"nextCursor": null
}
}
}Step 4: Create a Customer
curl -X POST \
'https://developer.servicebay.io/api/v1/organisations/YOUR_ORG_ID/customers' \
-H 'X-API-Key: sk_live_your_api_key' \
-H 'Content-Type: application/json' \
-d '{
"firstName": "Jane",
"lastName": "Smith",
"email": "jane@example.com",
"phone": "+0987654321"
}'Code Examples
JavaScript (Node.js)
const response = await fetch("https://developer.servicebay.io/api/v1/organisations/YOUR_ORG_ID/customers", {
headers: {
"X-API-Key": "sk_live_your_api_key",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data.data.customers);Python
import requests
response = requests.get(
'https://developer.servicebay.io/api/v1/organisations/YOUR_ORG_ID/customers',
headers={
'X-API-Key': 'sk_live_your_api_key',
'Content-Type': 'application/json',
}
)
data = response.json()
print(data['data']['customers'])Next Steps
- Explore the API Reference for all available endpoints
- Learn about Pagination for large datasets
- Understand Error Handling for robust integrations