---
title: "Create a guest"
method: POST
path: "/api/v1/restaurants/{restaurant_id}/guests"
tags: ["Guest"]
---

# Create a guest

`POST /api/v1/restaurants/{restaurant_id}/guests`

## Request

- Base URL: `https://gotable.app`
- URL: `https://gotable.app/api/v1/restaurants/{restaurant_id}/guests`
- Auth: HTTP bearer

## Path parameters

- `restaurant_id` integer, required

## Request body

- object
  - `name` string, required: Guest's name
  - `email` string, nullable: Guest's email address
  - `telephone` string, nullable: Guest's telephone number
  - `subscribed` boolean, nullable: Whether the guest may receive the newsletter

## Response `201`

With a valid API token

- Guest
  - `id` integer: The unique ID of the guest
  - `restaurant_id` integer: The unique ID of the restaurant
  - `name` string, nullable: Guest's name
  - `email` string, nullable: Guest's email address
  - `subscribed` boolean: If the guest has subscribed to the newsletter
  - `telephone` string, nullable: Guest's telephone number
  - `visits` integer: Guest's number of visits
  - `reservations` integer: Guest's number of reservations
  - `last_visit` string, date, nullable: The date of the guest's last visit
  - `diets` string[]: Guest's diets
  - `allergies` string[]: Guest's allergies
  - `tags` string[]: Guest's generic tags
  - `links` Link[]: An array of links useful for this reservation
    - `href` string: The URL to the related resource.
    - `method` 'GET' | 'POST' | 'PUT' | 'DELETE': The HTTP method that should be used to follow the link.
    - `rel` string: The relationship of this link to the current resource.

## Other responses

- `403`: With an unauthorized API token
- `404`: With a non-existant Restaurant ID
- `422`: With invalid data

---

[API](https://skmtc.dev/gotable/apis/gotable-api-v1.md) · [All operations](https://skmtc.dev/gotable/apis/gotable-api-v1/llms.txt) · [OpenAPI document](https://skmtc.dev/gotable/apis/gotable-api-v1/revisions/abe658488f5b?raw)
