> ## Documentation Index
> Fetch the complete documentation index at: https://docs.koulis.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# La Krème REST API: Widget and Restaurant Endpoints

> La Krème exposes two APIs: the public Widget API for custom booking UIs, and the authenticated Restaurant API for managing tables, hours, and reservations.

The La Krème REST API gives you programmatic access to your restaurant's reservation system. There are two distinct API surfaces: the **Widget API**, which is public and lets you build custom booking flows for your guests, and the **Restaurant API**, which requires authentication and gives you full control over your configuration, tables, opening hours, and reservations.

All requests and responses use JSON. The base URL for every endpoint is:

```
https://api.lakreme.fr
```

## The two API surfaces

<CardGroup cols={2}>
  <Card title="Widget API" icon="globe" href="/api/widget/config">
    Public endpoints — no authentication required. Use your `publicToken` in the URL path to access availability calendars, time slots, and the two-step reservation flow. Designed for custom booking UIs.
  </Card>

  <Card title="Restaurant API" icon="utensils" href="/api/restaurant/config">
    Authenticated endpoints — requires a JWT Bearer token. Use these to read and update your restaurant configuration, manage tables and opening hours, and view or create reservations from the operator side.
  </Card>
</CardGroup>

## Authentication

The Widget API uses your public token in the URL path — no secret credentials required. The Restaurant API requires a JWT Bearer token obtained after logging in through La Krème. See [Authentication](/api/authentication) for how to obtain and pass your token.

## Responses

All responses are JSON objects. Successful requests return one of the following HTTP status codes:

| Status | Meaning                                                    |
| ------ | ---------------------------------------------------------- |
| `200`  | Request succeeded. Response body contains the result.      |
| `201`  | Resource created. Response body contains the new resource. |
| `204`  | Request succeeded. No response body (used for DELETE).     |

## Errors

When a request fails, the API returns an error object with a human-readable message in the `detail` or `message` field. Always check the HTTP status code alongside the message.

```json theme={null}
{
  "detail": "No available slot for this date and party size."
}
```

Common error status codes:

| Status | Meaning                                                                     |
| ------ | --------------------------------------------------------------------------- |
| `400`  | Bad request — missing or invalid parameters.                                |
| `401`  | Unauthorized — your token is missing or expired.                            |
| `403`  | Forbidden — your token is valid but you don't have access to this resource. |
| `404`  | Not found — the resource does not exist.                                    |
| `422`  | Unprocessable entity — the request body failed validation.                  |
| `500`  | Internal server error — something went wrong on our end.                    |

## Quick links

<CardGroup cols={3}>
  <Card title="Authentication" icon="key" href="/api/authentication">
    How to obtain and pass your JWT token for Restaurant API calls.
  </Card>

  <Card title="Widget config" icon="sliders" href="/api/widget/config">
    Fetch restaurant branding, rules, and settings for your custom booking UI.
  </Card>

  <Card title="Restaurant config" icon="settings" href="/api/restaurant/config">
    Read and update your widget configuration and booking rules via the API.
  </Card>
</CardGroup>
