Table booking API
Building it yourself? Everything the booking widget does is behind the same addresses.
The booking widget on your site
Paste the code where the widget should appear. Replace "your-restaurant" with the address name shown under Booking widget in the admin.
<div id="gotatable-widget"></div>
<script src="https://gotatable.com/embed.js" data-gotatable="your-restaurant" async></script>Keys
Open addresses need no key; the booking widget on your site uses them. Addresses marked Key send the key in a header. You create the key under API in the admin, and it belongs to one restaurant.
Authorization: Bearer gt_xxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxAddresses
| Method | Address | Access | Does | Parameters |
|---|---|---|---|---|
| GET | /api/public/v1/restaurant | Open | Name, images, opening hours, closed days and look of the booking widget. | slug |
| GET | /api/public/v1/slots | Open | Free times for a date and a party. | restaurant, date (YYYY-MM-DD), party |
| POST | /api/public/v1/bookings | Open | Creates a booking at a free time. | restaurant, starts_at, party, name, email, phone, notes, locale |
| GET | /api/public/v1/bookings | Key | Lists the restaurant's bookings. | from, to, status |
| PATCH | /api/public/v1/bookings/{id} | Key | Changes the status of a booking. | status (new, confirmed, cancelled, no_show) |
| GET | /api/public/v1/tables | Key | Tables with seats and zones, and tables that can be joined. | – |
| GET | /api/public/v1/hours | Key | Opening hours, closed days and booking rules. | – |
Examples
Read free times
curl "https://gotatable.com/api/public/v1/slots?restaurant=your-restaurant&date=2027-02-14&party=2"
Create a booking
curl -X POST "https://gotatable.com/api/public/v1/bookings" \
-H "Content-Type: application/json" \
-d '{"restaurant":"your-restaurant","starts_at":"2027-02-14T18:00:00+01:00","party":2,"name":"Anna","phone":"070 123 45 67"}'
Read bookings with a key
curl "https://gotatable.com/api/public/v1/bookings?from=2027-02-01&to=2027-02-28" \
-H "Authorization: Bearer gt_xxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Limits
Open addresses: 120 calls a minute per IP address, new bookings 10 a minute. With a key: 300 calls a minute. Answers are JSON.
Errors
Errors are always JSON in the form {"error": "<code>"} with a fitting HTTP status. The codes never change, so build on them rather than on texts.
| invalid_request | A parameter is missing or wrong. |
| unauthorized | The key is missing or not valid. |
| forbidden | The call is not allowed. |
| not_found | The address, restaurant or booking does not exist. |
| method_not_allowed | The address exists, but not with that method. |
| rate_limited | Too many calls. Wait as many seconds as the Retry-After header says. |
| server_error | Something went wrong on our side. Try again in a while. |
When a booking cannot be made (409 and 400) the code says why, for example slot_unavailable when the time was just taken.
Get a key
Create an account, add your restaurant and create the key under API in the admin. Free for 60 days.
Questions before you start? Email us at support@gotatable.com