Booking API
Bookings Optimization
AI-powered booking table optimization
Authorization
ApiKeyAuth X-API-Key<token>
API key authentication. Format: karma_live_* or karma_dev_*
In: header
Path Parameters
id*string
Booking ID
Format
uuidRequest Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
locked*boolean
Whether to lock (true) or unlock (false) the booking
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X PATCH "https://example.com/api/v1/bookings/497f6eca-6276-4993-bfeb-53cbbbba6f08/lock" \ -H "Content-Type: application/json" \ -d '{ "locked": true }'{ "status": "success", "data": { "customFields": [ { "fieldId": "string", "key": "string", "label": "string", "group": "string", "type": "string", "displayValue": "string", "value": null, "version": 0, "status": "string" } ], "metadata": { "customFields": {} }, "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "locationId": 0, "tableId": "073fbfcb-cd05-4203-be18-a1ce6f8e4d2d", "bookingDate": "2019-08-24", "startTime": "string", "endTime": "string", "timezone": "string", "primaryUserId": null, "guestCount": 0, "occasion": "none", "specialRequests": "string", "internalNotes": "string", "notes": [ { "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f", "note": "string", "sortOrder": 0, "createdByRetailerUserId": 0, "updatedByRetailerUserId": 0, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z" } ], "status": "pending", "paymentType": "none", "depositAmountCents": 0, "purchaseId": 0, "confirmationCode": "string", "bookingSource": "direct", "estimatedRevenueCents": 0, "guestName": "string", "guestEmail": "string", "guestPhone": "string", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "confirmedAt": "2019-08-24T14:15:22Z", "seatedAt": "2019-08-24T14:15:22Z", "completedAt": "2019-08-24T14:15:22Z", "cancelledAt": "2019-08-24T14:15:22Z", "tabId": "string", "defaultTabStrategy": "single", "resources": [ { "qrCodeId": "8a619d64-dbe8-4c9d-9490-babe22a53a28", "isPrimary": true, "position": 0 } ], "userName": "string", "userEmail": "string", "userPhone": "string", "tableName": "string", "location": { "id": 0, "name": "string", "city": "string", "latitude": 0, "longitude": 0, "logoImageUrl": "string" }, "attribution": { "firstTouch": { "capturedAt": "2019-08-24T14:15:22Z", "utmSource": "string", "utmMedium": "string", "utmCampaign": "string", "utmContent": "string", "utmTerm": "string", "referrer": "string", "landingPage": "string" }, "bookingTouch": { "capturedAt": "2019-08-24T14:15:22Z", "utmSource": "string", "utmMedium": "string", "utmCampaign": "string", "utmContent": "string", "utmTerm": "string", "referrer": "string", "landingPage": "string" }, "reportedSource": "string", "recordedAt": "2019-08-24T14:15:22Z" } }, "meta": { "requestId": "string", "timestamp": "2019-08-24T14:15:22Z", "executionTimeMs": 0 }}Authorization
ApiKeyAuth X-API-Key<token>
API key authentication. Format: karma_live_* or karma_dev_*
In: header
Path Parameters
locationId*number
Location ID
Query Parameters
date*string
Date to optimize (YYYY-MM-DD)
Format
dateRequest Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
dryRun?boolean
If true, only preview changes without applying them
Default
trueResponse Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/v1/locations/0/bookings/optimize?date=2019-08-24" \ -H "Content-Type: application/json" \ -d '{}'{ "status": "success", "data": { "changes": [ { "bookingId": "9a471128-954e-4e64-bde9-e8147015df89", "guestName": "string", "partySize": 0, "fromTableId": "f548610a-3318-4ba8-9887-456184ca0977", "fromTableName": "string", "toTableId": "5c4d5cd5-7baf-4874-a284-402f73d74692", "toTableName": "string", "reason": "string" } ], "stats": { "totalBookings": 0, "optimizedCount": 0, "lockedCount": 0, "tablesFreed": 0, "utilizationImprovement": 0 } }, "meta": { "requestId": "string", "timestamp": "2019-08-24T14:15:22Z", "executionTimeMs": 0 }}