With Moshi API
Build integrations with our restaurant platform. Embed booking widgets, sync guest data, trigger automations, and receive real-time event notifications via webhooks.
Overview
The Moshi API is split into two tiers: public endpoints for customer-facing integrations (no authentication required) and dashboard endpoints for restaurant operators (Bearer token required).
Content-Type: application/json on all POST and PATCH requests.Authentication
Dashboard endpoints require a Bearer token sent in the Authorization header. Public endpoints do not require authentication.
Bearer token
Obtain your token from the Moshi dashboard under Settings > API Keys. Tokens are restaurant-scoped and do not expire unless revoked.
curl https://queue-index-server.railway.app/api/bookings \ -H "Authorization: Bearer moshi_live_xxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json"
const res = await fetch('https://queue-index-server.railway.app/api/bookings', { headers: { 'Authorization': 'Bearer moshi_live_xxxxxxxxxxxxxxxx', 'Content-Type': 'application/json' } }); const data = await res.json();
Base URL
All API requests are made to the following base URL. Append the endpoint path as documented below.
https://queue-index-server.railway.app
Error Handling
The API uses standard HTTP status codes. Error responses include a JSON body with a message field.
| Status | Meaning |
|---|---|
| 200 | Success |
| 201 | Resource created |
| 400 | Bad request – missing or invalid parameters |
| 401 | Unauthorised – missing or invalid Bearer token |
| 404 | Resource not found |
| 409 | Conflict – e.g. slot no longer available |
| 429 | Rate limit exceeded |
| 500 | Internal server error |
// Example error response { "error": "SLOT_UNAVAILABLE", "message": "No availability for 4 covers at 19:30 on 2026-04-15", "status": 409 }
Public Endpoints
No authentication required. Suitable for embedding in your own website, app, or booking widget.
Returns available time slots for a given restaurant and date. Use this to power a booking date/time picker.
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| restaurant | string | required | Restaurant slug or ID |
| date | string | required | Date in YYYY-MM-DD format |
| partySize | integer | optional | Number of covers. Defaults to 2. |
curl "https://queue-index-server.railway.app/api/public/availability?restaurant=wow-simply-japanese&date=2026-04-15&partySize=2"
const params = new URLSearchParams({ restaurant: 'wow-simply-japanese', date: '2026-04-15', partySize: 2 }); const res = await fetch(`/api/public/availability?${params}`); const data = await res.json();
Response
{
"restaurant": "wow-simply-japanese",
"date": "2026-04-15",
"slots": [
{ "time": "12:00", "available": true, "remaining": 8 },
{ "time": "12:30", "available": true, "remaining": 4 },
{ "time": "13:00", "available": false, "remaining": 0 },
{ "time": "19:00", "available": true, "remaining": 12 },
{ "time": "19:30", "available": true, "remaining": 6 }
]
}
Creates a new booking for a restaurant. Returns a booking confirmation with a unique reference.
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| restaurant | string | required | Restaurant slug or ID |
| name | string | required | Guest full name |
| phone | string | required | UK mobile number (e.g. 07700900123) |
| string | optional | Guest email address | |
| date | string | required | Date in YYYY-MM-DD format |
| time | string | required | Time in HH:MM (24-hour) format |
| partySize | integer | required | Number of covers (1–20) |
| notes | string | optional | Special requests, dietary requirements, occasion |
curl -X POST https://queue-index-server.railway.app/api/public/book \ -H "Content-Type: application/json" \ -d '{ "restaurant": "wow-simply-japanese", "name": "Sarah Chen", "phone": "07700900123", "email": "sarah@example.com", "date": "2026-04-15", "time": "19:30", "partySize": 2, "notes": "Anniversary dinner, nut allergy" }'
const res = await fetch('/api/public/book', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ restaurant: 'wow-simply-japanese', name: 'Sarah Chen', phone: '07700900123', email: 'sarah@example.com', date: '2026-04-15', time: '19:30', partySize: 2, notes: 'Anniversary dinner, nut allergy' }) });
Response
{
"id": "bk_9f2a3c8d",
"status": "confirmed",
"reference": "MOSHI-4821",
"restaurant": "wow-simply-japanese",
"name": "Sarah Chen",
"date": "2026-04-15",
"time": "19:30",
"partySize": 2,
"confirmationSentAt": "2026-03-29T14:22:11Z"
}
Returns a list of upcoming special events for a restaurant, such as tasting menus, sake nights, or private dining experiences.
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| restaurant | string | optional | Filter by restaurant slug. Omit to return all. |
| from | string | optional | Start date filter (YYYY-MM-DD). Defaults to today. |
| limit | integer | optional | Max results. Defaults to 20. |
Response
{
"events": [
{
"id": "evt_3f9a",
"title": "Sake Tasting Evening",
"description": "Six premium sakes paired with chef's small plates",
"date": "2026-04-22",
"time": "19:00",
"capacity": 24,
"remaining": 8,
"pricePerPerson": 65,
"currency": "GBP"
}
]
}
Books one or more places at a special event. Replace :id with the event ID returned from GET /api/public/events.
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | required | Guest full name |
| phone | string | required | UK mobile number |
| string | optional | Guest email address | |
| places | integer | required | Number of places to book |
Response
{
"id": "evtbk_7c3b",
"status": "confirmed",
"event": "evt_3f9a",
"places": 2,
"totalCharge": 130,
"currency": "GBP"
}
Submits a pre-order linked to an existing booking. Useful for tasting menus or set courses where guests select dishes in advance.
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| bookingId | string | required | Booking ID from POST /api/public/book |
| items | array | required | Array of { itemId, quantity } objects |
| notes | string | optional | Any additional notes for the kitchen |
Response
{
"orderId": "ord_f1a2b3",
"bookingId": "bk_9f2a3c8d",
"status": "received",
"items": [
{ "itemId": "mi_aa01", "quantity": 1, "name": "Chicken Katsu" }
]
}
Returns loyalty points and tier status for a guest identified by phone number.
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| phone | string | required | Guest phone number |
| restaurant | string | optional | Scope to a specific restaurant |
Response
{
"phone": "07700900123",
"tier": "gold",
"points": 340,
"visits": 7,
"vip": true,
"joinedAt": "2025-11-04"
}
Sends a conversational message to the Moshi AI and returns a response. Use this to embed a text-based chat widget on your website.
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| restaurant | string | required | Restaurant context slug |
| message | string | required | The user's message |
| sessionId | string | optional | Session ID for multi-turn conversations |
Response
{
"reply": "We have availability at 19:00 and 19:30 this Friday for two. Would you like me to book one of those for you?",
"sessionId": "sess_8d2f1c",
"intent": "booking_inquiry",
"handoff": false
}
Returns localised strings for the Moshi booking widget in the requested language.
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| lang | string | required | BCP 47 language code (e.g. en, ja, fr, es, it) |
Response
{
"lang": "ja",
"strings": {
"bookTable": "テーブルを予約する",
"selectDate": "日付を選択",
"partySize": "人数",
"confirm": "予約を確認"
}
}
Returns allergen information for all menu items at a restaurant, mapped to the 14 major UK allergens required under the Food Standards Agency regulations.
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| restaurant | string | required | Restaurant slug or ID |
Response
{
"restaurant": "wow-simply-japanese",
"items": [
{
"id": "mi_aa01",
"name": "Chicken Katsu",
"allergens": ["gluten", "soya"],
"mayContain": ["sesame"]
}
]
}
Registers a guest to receive an SMS notification when a slot becomes available on a specific date.
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| restaurant | string | required | Restaurant slug |
| phone | string | required | Guest phone number |
| date | string | required | Desired date (YYYY-MM-DD) |
| partySize | integer | required | Number of covers required |
Response
{
"alertId": "alt_c9f1",
"status": "watching",
"message": "We'll text you the moment a table becomes available."
}
Adds a guest to the walk-in waitlist for the current service. Moshi will contact them when a table is ready.
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| restaurant | string | required | Restaurant slug |
| name | string | required | Guest name |
| phone | string | required | Guest phone number |
| partySize | integer | required | Number of covers |
Response
{
"waitlistId": "wl_d3e8",
"position": 3,
"estimatedWait": "25-35 minutes",
"status": "queued"
}
Validates a discount or gift voucher code and returns its value and restrictions.
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| code | string | required | The voucher code to validate |
| restaurant | string | optional | Scope validation to a specific restaurant |
Response
{
"code": "WELCOME20",
"valid": true,
"type": "percentage",
"value": 20,
"expiresAt": "2026-06-30",
"restrictions": "Valid on food only, Monday to Thursday"
}
Returns availability in the format required by Google Reserve, enabling "Book a Table" functionality directly from Google Search and Maps. This endpoint is polled by Google's servers and must be publicly accessible.
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| merchant_id | string | required | Your Google Reserve merchant ID |
| service_id | string | optional | Specific service type (defaults to dining) |
Response
{
"merchant_id": "wow-simply-japanese",
"slots": [
{
"start_sec": 1744736400,
"duration_sec": 5400,
"avail_tag": "2_4_covers",
"resources": { "party_size": 2 }
}
]
}
Dashboard Endpoints
All dashboard endpoints require a valid Bearer token. These endpoints are for restaurant operators and their own systems only.
Returns a paginated list of bookings. Filter by date, status, or guest. Results are ordered by date descending.
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| date | string | optional | Filter by date (YYYY-MM-DD) |
| status | string | optional | One of: confirmed, cancelled, completed, no-show |
| page | integer | optional | Page number (default 1) |
| limit | integer | optional | Results per page (default 20, max 100) |
Response
{
"bookings": [
{
"id": "bk_9f2a3c8d",
"reference": "MOSHI-4821",
"name": "Sarah Chen",
"phone": "07700900123",
"date": "2026-04-15",
"time": "19:30",
"partySize": 2,
"status": "confirmed",
"notes": "Anniversary dinner, nut allergy",
"source": "voice",
"createdAt": "2026-03-29T14:22:11Z"
}
],
"total": 84,
"page": 1,
"pages": 5
}
Creates a booking as a restaurant operator. Identical body parameters to POST /api/public/book, with the addition of an optional source field to tag the booking origin.
Additional body parameter
| Parameter | Type | Required | Description |
|---|---|---|---|
| source | string | optional | Origin tag. One of: walk-in, phone, web, widget, voice |
Updates the status or details of an existing booking. Only the fields you include will be changed.
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| status | string | optional | New status: confirmed, cancelled, completed, no-show |
| date | string | optional | Updated date (YYYY-MM-DD) |
| time | string | optional | Updated time (HH:MM) |
| partySize | integer | optional | Updated party size |
| notes | string | optional | Updated notes |
Response
{
"id": "bk_9f2a3c8d",
"status": "cancelled",
"updatedAt": "2026-03-29T16:00:00Z"
}
Returns guest profiles ordered by total visits. Includes VIP flag, loyalty tier, and booking history summary.
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| vip | boolean | optional | Filter to VIP guests only |
| search | string | optional | Search by name or phone |
| limit | integer | optional | Results per page (default 50) |
Response
{
"guests": [
{
"id": "g_f3a1b2",
"name": "Sarah Chen",
"phone": "07700900123",
"visits": 7,
"vip": true,
"loyaltyTier": "gold",
"noShows": 0,
"lastVisit": "2026-03-14"
}
]
}
Updates notes, tags, or VIP status on a guest profile.
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| vip | boolean | optional | Set or remove VIP status |
| notes | string | optional | Staff notes about this guest |
| tags | array | optional | Custom tags (e.g. ["regular", "birthday-next-month"]) |
Returns summary analytics for bookings, covers, no-shows, and revenue over a specified period.
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| from | string | optional | Start date (YYYY-MM-DD). Defaults to 30 days ago. |
| to | string | optional | End date (YYYY-MM-DD). Defaults to today. |
Response
{
"period": { "from": "2026-03-01", "to": "2026-03-29" },
"bookings": { "total": 312, "confirmed": 289, "cancelled": 18, "noShow": 5 },
"covers": { "total": 718, "average": 2.3 },
"noShowRate": 1.6,
"topDays": ["Saturday", "Friday", "Sunday"],
"peakTime": "19:30"
}
Returns conversion metrics for voice calls handled by Moshi: total calls answered, bookings taken, and drop-off reasons.
Response
{
"calls": { "total": 140, "answered": 140, "handedOff": 12 },
"bookings": 98,
"conversionRate": 70,
"averageCallDuration": "1m 42s",
"dropOffReasons": {
"no_availability": 18,
"caller_hung_up": 11,
"requested_human": 12
}
}
Returns a risk score (0–100) for each upcoming booking, calculated from booking source, lead time, guest history, and party size. Use to prioritise confirmation calls.
Response
{
"bookings": [
{
"id": "bk_9f2a3c8d",
"name": "Sarah Chen",
"date": "2026-04-15",
"time": "19:30",
"partySize": 2,
"noShowRisk": 12,
"riskLabel": "low"
}
]
}
Returns a 14-day forward forecast of expected covers, based on current bookings, historic patterns, and seasonality signals.
Response
{
"forecast": [
{ "date": "2026-04-01", "expectedCovers": 34, "confidence": "high" },
{ "date": "2026-04-02", "expectedCovers": 28, "confidence": "medium" }
]
}
Returns a real-time snapshot of confirmed covers for the current service. Useful for kitchen displays and floor management tools.
Response
{
"service": "dinner",
"date": "2026-03-29",
"confirmedCovers": 42,
"seated": 18,
"remaining": 24,
"capacity": 60,
"updatedAt": "2026-03-29T19:14:00Z"
}
Registers a URL to receive outbound webhook events. You can register multiple endpoints and filter by event type.
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| url | string | required | HTTPS endpoint URL to receive events |
| events | array | required | Event types to subscribe to (see Webhooks section) |
| secret | string | optional | Your signing secret for HMAC verification |
Response
{
"webhookId": "wh_2c8f1a",
"url": "https://your-system.com/hooks/moshi",
"events": ["booking.created", "booking.cancelled"],
"status": "active"
}
Outbound Webhooks
Moshi sends real-time HTTP POST requests to your registered endpoints when events occur in the platform. All webhook payloads are JSON and signed with HMAC-SHA256.
Signature verification
Every webhook request includes a X-Moshi-Signature header. Verify it to confirm the request came from Moshi and has not been tampered with.
// Node.js HMAC verification const crypto = require('crypto'); function verifyWebhook(payload, signature, secret) { const expected = crypto .createHmac('sha256', secret) .update(payload, 'utf8') .digest('hex'); return crypto.timingSafeEqual( Buffer.from(expected), Buffer.from(signature) ); }
Webhook payload structure
{
"id": "evt_7a1c9d",
"type": "booking.created",
"createdAt": "2026-03-29T14:22:11Z",
"restaurant": "wow-simply-japanese",
"data": {
// the relevant object, e.g. booking or guest
}
}
Retry policy
If your endpoint returns a non-2xx response, Moshi will retry with exponential backoff: after 1 minute, 5 minutes, 30 minutes, and 2 hours. After four failed attempts the webhook is marked inactive.
Event types
Rate Limits
Rate limits apply per API token for dashboard endpoints, and per IP address for public endpoints. Exceeding a limit returns 429 Too Many Requests with a Retry-After header.
| Endpoint type | Limit | Window |
|---|---|---|
| Public endpoints (read) | 120 requests | Per minute per IP |
| Public endpoints (write) | 30 requests | Per minute per IP |
| Dashboard endpoints | 300 requests | Per minute per token |
| Analytics endpoints | 60 requests | Per minute per token |
| Webhook registration | 10 requests | Per hour per token |
X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset (Unix timestamp).