All systems functioning normally
Build powerful integrations with the Serve AI platform. Our REST API provides programmatic access to all platform features.
Sign up for an account and generate your API key from the dashboard
Choose from our official SDKs or use the REST API directly
Authenticate and make your first API request to list alerts
Deploy your integration and start receiving real-time alerts
// Include your API key in the Authorization header
const response = await fetch('https://api.serve-ai.com/v1/alerts', {
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
});
Important: Keep your API key secure and never expose it in client-side code. Use environment variables and server-side requests.
/api/v1/alerts
Retrieve a list of all alerts
/api/v1/alerts
Create a new alert rule
/api/v1/alerts/{id}
Get a specific alert by ID
/api/v1/alerts/{id}
Update an existing alert
/api/v1/alerts/{id}
Delete an alert
/api/v1/alerts/{id}/resolve
Resolve an alert and mark it as addressed
/api/v1/alerts/{id}/assign
Assign an alert to a group member
/api/v1/integrations
List all connected integrations
/api/v1/integrations/connect
Connect a new integration
/api/v1/reports
Get performance reports
/api/v1/webhooks
Configure webhook endpoints
/api/v1/groups
List all groups
/api/v1/groups
Create a new group
/api/v1/groups/{id}
Get group details
/api/v1/groups/{id}
Update group information
/api/v1/groups/{id}
Delete a group
/api/v1/users
List all users in the organization
/api/v1/users
Create a new user
/api/v1/users/{id}
Get user details
/api/v1/users/{id}
Update user information
/api/v1/users/{id}
Delete a user
/api/v1/users/{id}/groups
Add user to groups
/api/v1/users/{id}/groups/{groupId}
Remove user from a group
The Alerts API allows you to create, manage, and respond to real-time alerts about your restaurant operations.
/api/v1/alerts
Retrieve a list of all alerts
/api/v1/alerts
Create a new alert rule
/api/v1/alerts/{id}
Get a specific alert by ID
/api/v1/alerts/{id}
Update an existing alert
/api/v1/alerts/{id}
Delete an alert
/api/v1/alerts/{id}/resolve
Resolve an alert and mark it as addressed
/api/v1/alerts/{id}/assign
Assign an alert to a group member
Connect and manage third-party services and platforms with your Serve AI account.
/api/v1/integrations
List all connected integrations
/api/v1/integrations/connect
Connect a new integration
Manage groups, assign responsibilities, and control access permissions across your organization. Users can be part of multiple groups and have alerts assigned to them.
/api/v1/groups
List all groups
/api/v1/groups
Create a new group
/api/v1/groups/{id}
Get group details
/api/v1/groups/{id}
Update group information
/api/v1/groups/{id}
Delete a group
/api/v1/users/{id}/groups
Add user to groups
/api/v1/users/{id}/groups/{groupId}
Remove user from a group
Manage users within your organization. Users can be part of multiple groups and have alerts assigned to them directly.
/api/v1/users
List all users in the organization
/api/v1/users
Create a new user
/api/v1/users/{id}
Get user details
/api/v1/users/{id}
Update user information
/api/v1/users/{id}
Delete a user
/api/v1/users/{id}/groups
Add user to groups
/api/v1/users/{id}/groups/{groupId}
Remove user from a group
Configure webhooks to receive real-time notifications when events occur in your Serve AI account.
/api/v1/reports
Get performance reports
/api/v1/webhooks
Configure webhook endpoints
// Create a new alert rule
const response = await fetch('https://api.serve-ai.com/v1/alerts', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Cash Drawer Variance Alert',
type: 'variance',
threshold: 50,
frequency: 'immediate',
channels: ['push', 'email'],
conditions: {
metric: 'cash_drawer_variance',
operator: 'greater_than',
value: 50
}
})
});
const alert = await response.json();
// Get all alerts with pagination
const response = await fetch('https://api.serve-ai.com/v1/alerts?page=1&limit=20', {
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();
console.log(data.alerts); // Array of alert objects
console.log(data.pagination); // Pagination details
// Configure a webhook endpoint
const response = await fetch('https://api.serve-ai.com/v1/webhooks', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
url: 'https://your-server.com/webhook',
events: ['alert.triggered', 'alert.resolved'],
secret: 'your-webhook-secret'
})
});
// Resolve an alert
const response = await fetch('https://api.serve-ai.com/v1/alerts/alert_1234567890/resolve', {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
resolution: 'Cash drawer discrepancy was due to incorrect change given. Staff retrained.',
resolved_by: 'user_987654321',
resolution_time: new Date().toISOString()
})
});
const resolvedAlert = await response.json();
// Assign an alert to a group member
const response = await fetch('https://api.serve-ai.com/v1/alerts/alert_1234567890/assign', {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
assignee_id: 'user_123456789',
group_id: 'group_456789',
priority: 'high',
notes: 'Please investigate ASAP - multiple occurrences this week'
})
});
const assignedAlert = await response.json();
// Create a new group
const response = await fetch('https://api.serve-ai.com/v1/groups', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Morning Shift Group',
description: 'Handles operations from 6 AM to 2 PM',
location_ids: ['loc_123', 'loc_456'],
manager_id: 'user_789',
members: [
{ user_id: 'user_111', role: 'shift_lead' },
{ user_id: 'user_222', role: 'cashier' },
{ user_id: 'user_333', role: 'server' }
],
alert_preferences: {
channels: ['push', 'email'],
severity_levels: ['high', 'critical'],
categories: ['cash_management', 'labor', 'compliance']
}
})
});
const group = await response.json();
// Create a new user
const response = await fetch('https://api.serve-ai.com/v1/users', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: 'john.doe@restaurant.com',
name: 'John Doe',
role: 'manager',
department: 'operations',
phone: '+1-555-0123',
permissions: ['view_alerts', 'manage_alerts', 'view_reports'],
notification_preferences: {
channels: ['email', 'push'],
alert_types: ['critical', 'high']
}
})
});
const user = await response.json();
// Get all users with filtering
const response = await fetch('https://api.serve-ai.com/v1/users?role=manager&department=operations', {
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();
console.log(data.users); // Array of user objects
console.log(data.pagination); // Pagination details
// Successful response
{
"success": true,
"data": {
"id": "alert_1234567890",
"name": "Cash Drawer Variance Alert",
"type": "variance",
"status": "active",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z",
"conditions": {
"metric": "cash_drawer_variance",
"operator": "greater_than",
"value": 50
},
"last_triggered": null,
"trigger_count": 0
}
}
// Error response
{
"success": false,
"error": {
"code": "INVALID_REQUEST",
"message": "The threshold value must be a positive number",
"field": "threshold"
}
}
1,000
requests per hour
10,000
requests per hour
Custom
Contact sales
Rate limit information is included in response headers: X-RateLimit-Limit
, X-RateLimit-Remaining
, and X-RateLimit-Reset
npm install @serve-ai/sdk
pip install serve-ai
gem install serve-ai
go get github.com/serve-ai/go-sdk
The Go SDK is currently in development. Join our Discord to get notified when it's released.
// Error Response Structure
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request parameters",
"field": "email",
"details": {
"constraint": "email",
"value": "invalid-email"
}
},
"request_id": "req_abc123xyz"
}
400
- Bad Request401
- Unauthorized403
- Forbidden404
- Not Found429
- Rate Limited500
- Server ErrorVALIDATION_ERROR
AUTHENTICATION_FAILED
INSUFFICIENT_PERMISSIONS
RESOURCE_NOT_FOUND
RATE_LIMIT_EXCEEDED
INTERNAL_ERROR
// Request with pagination
GET /api/v1/alerts?page=2&limit=20
// Response with pagination metadata
{
"data": [...],
"pagination": {
"page": 2,
"limit": 20,
"total": 156,
"pages": 8,
"has_next": true,
"has_prev": true,
"next_page": 3,
"prev_page": 1
}
}
20
items per page
100
items per page
Yes
for real-time data
Check the current API status and subscribe to updates
Join our Discord community for discussions and help
Get dedicated support for enterprise integrations
Our developer support team is here to help you build amazing integrations