API Reference v1

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.

Base URL https://queue-index-server.railway.app Format JSON (REST) Auth Bearer token Version 1.0

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).

ⓘ
All requests and responses use JSON. Include the header Content-Type: application/json on all POST and PATCH requests.
⚠
The API is currently in private beta. Contact us to request access and receive your API credentials.

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.

StatusMeaning
200Success
201Resource created
400Bad request – missing or invalid parameters
401Unauthorised – missing or invalid Bearer token
404Resource not found
409Conflict – e.g. slot no longer available
429Rate limit exceeded
500Internal 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.

GET /api/public/availability Check available booking slots ● Public

Returns available time slots for a given restaurant and date. Use this to power a booking date/time picker.

Query parameters

ParameterTypeRequiredDescription
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 }
  ]
}
POST /api/public/book Create a booking ● Public

Creates a new booking for a restaurant. Returns a booking confirmation with a unique reference.

Body parameters

ParameterTypeRequiredDescription
restaurantstringrequiredRestaurant slug or ID
namestringrequiredGuest full name
phonestringrequiredUK mobile number (e.g. 07700900123)
emailstringoptionalGuest email address
datestringrequiredDate in YYYY-MM-DD format
timestringrequiredTime in HH:MM (24-hour) format
partySizeintegerrequiredNumber of covers (1–20)
notesstringoptionalSpecial 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"
}
GET /api/public/events List upcoming events ● Public

Returns a list of upcoming special events for a restaurant, such as tasting menus, sake nights, or private dining experiences.

Query parameters

ParameterTypeRequiredDescription
restaurantstringoptionalFilter by restaurant slug. Omit to return all.
fromstringoptionalStart date filter (YYYY-MM-DD). Defaults to today.
limitintegeroptionalMax 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"
    }
  ]
}
POST /api/public/events/:id/book Book a place at an event ● Public

Books one or more places at a special event. Replace :id with the event ID returned from GET /api/public/events.

Body parameters

ParameterTypeRequiredDescription
namestringrequiredGuest full name
phonestringrequiredUK mobile number
emailstringoptionalGuest email address
placesintegerrequiredNumber of places to book

Response

{
  "id": "evtbk_7c3b",
  "status": "confirmed",
  "event": "evt_3f9a",
  "places": 2,
  "totalCharge": 130,
  "currency": "GBP"
}
POST /api/public/order Submit a pre-order ● Public

Submits a pre-order linked to an existing booking. Useful for tasting menus or set courses where guests select dishes in advance.

Body parameters

ParameterTypeRequiredDescription
bookingIdstringrequiredBooking ID from POST /api/public/book
itemsarrayrequiredArray of { itemId, quantity } objects
notesstringoptionalAny additional notes for the kitchen

Response

{
  "orderId": "ord_f1a2b3",
  "bookingId": "bk_9f2a3c8d",
  "status": "received",
  "items": [
    { "itemId": "mi_aa01", "quantity": 1, "name": "Chicken Katsu" }
  ]
}
GET /api/public/loyalty Look up guest loyalty status ● Public

Returns loyalty points and tier status for a guest identified by phone number.

Query parameters

ParameterTypeRequiredDescription
phonestringrequiredGuest phone number
restaurantstringoptionalScope to a specific restaurant

Response

{
  "phone": "07700900123",
  "tier": "gold",
  "points": 340,
  "visits": 7,
  "vip": true,
  "joinedAt": "2025-11-04"
}
POST /api/public/chat Send a message to Moshi ● Public

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

ParameterTypeRequiredDescription
restaurantstringrequiredRestaurant context slug
messagestringrequiredThe user's message
sessionIdstringoptionalSession 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
}
GET /api/public/translations Retrieve UI translations ● Public

Returns localised strings for the Moshi booking widget in the requested language.

Query parameters

ParameterTypeRequiredDescription
langstringrequiredBCP 47 language code (e.g. en, ja, fr, es, it)

Response

{
  "lang": "ja",
  "strings": {
    "bookTable": "テーブルを予約する",
    "selectDate": "日付を選択",
    "partySize": "人数",
    "confirm": "予約を確認"
  }
}
GET /api/public/allergens Get allergen information ● Public

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

ParameterTypeRequiredDescription
restaurantstringrequiredRestaurant slug or ID

Response

{
  "restaurant": "wow-simply-japanese",
  "items": [
    {
      "id": "mi_aa01",
      "name": "Chicken Katsu",
      "allergens": ["gluten", "soya"],
      "mayContain": ["sesame"]
    }
  ]
}
POST /api/public/availability-alert Request a slot alert ● Public

Registers a guest to receive an SMS notification when a slot becomes available on a specific date.

Body parameters

ParameterTypeRequiredDescription
restaurantstringrequiredRestaurant slug
phonestringrequiredGuest phone number
datestringrequiredDesired date (YYYY-MM-DD)
partySizeintegerrequiredNumber of covers required

Response

{
  "alertId": "alt_c9f1",
  "status": "watching",
  "message": "We'll text you the moment a table becomes available."
}
POST /api/public/waitlist Join the waitlist ● Public

Adds a guest to the walk-in waitlist for the current service. Moshi will contact them when a table is ready.

Body parameters

ParameterTypeRequiredDescription
restaurantstringrequiredRestaurant slug
namestringrequiredGuest name
phonestringrequiredGuest phone number
partySizeintegerrequiredNumber of covers

Response

{
  "waitlistId": "wl_d3e8",
  "position": 3,
  "estimatedWait": "25-35 minutes",
  "status": "queued"
}
GET /api/public/voucher Validate a voucher code ● Public

Validates a discount or gift voucher code and returns its value and restrictions.

Query parameters

ParameterTypeRequiredDescription
codestringrequiredThe voucher code to validate
restaurantstringoptionalScope 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"
}
GET /api/google/availability Google Reserve availability feed ● Public

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

ParameterTypeRequiredDescription
merchant_idstringrequiredYour Google Reserve merchant ID
service_idstringoptionalSpecific 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.

⚠
Never expose your API token in client-side code. All dashboard endpoint calls should be made server-side.
GET /api/bookings List all bookings 🔒 Auth

Returns a paginated list of bookings. Filter by date, status, or guest. Results are ordered by date descending.

Query parameters

ParameterTypeRequiredDescription
datestringoptionalFilter by date (YYYY-MM-DD)
statusstringoptionalOne of: confirmed, cancelled, completed, no-show
pageintegeroptionalPage number (default 1)
limitintegeroptionalResults 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
}
POST /api/bookings Create a booking (authenticated) 🔒 Auth

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

ParameterTypeRequiredDescription
sourcestringoptionalOrigin tag. One of: walk-in, phone, web, widget, voice
PATCH /api/bookings/:id Update a booking 🔒 Auth

Updates the status or details of an existing booking. Only the fields you include will be changed.

Body parameters

ParameterTypeRequiredDescription
statusstringoptionalNew status: confirmed, cancelled, completed, no-show
datestringoptionalUpdated date (YYYY-MM-DD)
timestringoptionalUpdated time (HH:MM)
partySizeintegeroptionalUpdated party size
notesstringoptionalUpdated notes

Response

{
  "id": "bk_9f2a3c8d",
  "status": "cancelled",
  "updatedAt": "2026-03-29T16:00:00Z"
}
GET /api/guests List guest profiles 🔒 Auth

Returns guest profiles ordered by total visits. Includes VIP flag, loyalty tier, and booking history summary.

Query parameters

ParameterTypeRequiredDescription
vipbooleanoptionalFilter to VIP guests only
searchstringoptionalSearch by name or phone
limitintegeroptionalResults 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"
    }
  ]
}
PATCH /api/guests/:id Update a guest profile 🔒 Auth

Updates notes, tags, or VIP status on a guest profile.

Body parameters

ParameterTypeRequiredDescription
vipbooleanoptionalSet or remove VIP status
notesstringoptionalStaff notes about this guest
tagsarrayoptionalCustom tags (e.g. ["regular", "birthday-next-month"])
GET /api/analytics Booking and revenue analytics 🔒 Auth

Returns summary analytics for bookings, covers, no-shows, and revenue over a specified period.

Query parameters

ParameterTypeRequiredDescription
fromstringoptionalStart date (YYYY-MM-DD). Defaults to 30 days ago.
tostringoptionalEnd 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"
}
GET /api/analytics/voice-conversion Voice call conversion metrics 🔒 Auth

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
  }
}
GET /api/analytics/no-show-risk Upcoming no-show risk scores 🔒 Auth

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"
    }
  ]
}
GET /api/analytics/forecast Cover and demand forecast 🔒 Auth

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" }
  ]
}
GET /api/live-covers Live covers for current service 🔒 Auth

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"
}
POST /api/webhooks Register a webhook endpoint 🔒 Auth

Registers a URL to receive outbound webhook events. You can register multiple endpoints and filter by event type.

Body parameters

ParameterTypeRequiredDescription
urlstringrequiredHTTPS endpoint URL to receive events
eventsarrayrequiredEvent types to subscribe to (see Webhooks section)
secretstringoptionalYour 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

booking.created
A new booking has been confirmed
booking.cancelled
A booking has been cancelled
booking.completed
A booking has been marked as completed
booking.no-show
A guest did not attend their booking
guest.created
A new guest profile has been created
order.created
A pre-order has been submitted
review.completed
A post-visit review has been submitted

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 typeLimitWindow
Public endpoints (read)120 requestsPer minute per IP
Public endpoints (write)30 requestsPer minute per IP
Dashboard endpoints300 requestsPer minute per token
Analytics endpoints60 requestsPer minute per token
Webhook registration10 requestsPer hour per token
ⓘ
Rate limit headers are included on every response: X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset (Unix timestamp).