Guest Update

Update a Guest

Use this endpoint to modify an existing guest's profile information. You can change contact details, address, preferences, and other guest information. Updates will validate the new information and check for conflicts.

Endpoint

PATCH /api/v1/client/guests/{guestId}

Example curl

curl "/api/v1/client/guests/f1b2c3d4-5678-49ab-9cde-112233445566" \
  -X PATCH \
  -H "accept: application/json" \
  -H "content-type: application/json" \
  -H "origin: https://docs.hostelmate.co" \
  --data-raw '{
    "guest": {
      "phone": "+971501234567",
      "address": {
        "line1": "Downtown Dubai",
        "city": "Dubai",
        "postal_code": "12345",
        "country_code": "AE"
      },
      "preferences": {
        "language": "ar",
        "newsletter": false,
        "marketing": true
      }
    }
  }'

This is a partial update. Send only the fields you want to change.


Request Payload

Top-level Fields

Field
Type
Description

guest

object

Guest-level updates, such as contact details, address, and preferences.

Guest Object (updatable)

Field
Type
Description

first_name

string

Update guest's first name.

last_name

string

Update guest's last name.

email

string

Update guest's email address. Must be a valid email format.

phone

string

Update guest's phone number. E.164 format recommended.

country_code

string

Update guest's country code. ISO 3166-1 alpha-2.

address

object

Update guest's postal address (see below).

date_of_birth

string

Update guest's date of birth (format: YYYY-MM-DD).

nationality

string

Update guest's nationality. ISO 3166-1 alpha-2.

preferences

object

Update guest preferences (see below).

Address Object

Field
Type
Description

line1

string

Street line 1.

city

string

City.

postal_code

string

Postal/ZIP code.

country_code

string

ISO 3166-1 alpha-2 (e.g., AE).

Preferences Object

Field
Type
Description

language

string

Preferred language code (e.g., en, ar).

newsletter

boolean

Whether guest wants to receive newsletters.

marketing

boolean

Whether guest consents to marketing communications.


Response (200 OK)

{
  "guestId": "f1b2c3d4-5678-49ab-9cde-112233445566",
  "first_name": "John",
  "last_name": "Doe",
  "email": "[email protected]",
  "phone": "+971501234567",
  "country_code": "AE",
  "address": {
    "line1": "Downtown Dubai",
    "city": "Dubai",
    "postal_code": "12345",
    "country_code": "AE"
  },
  "date_of_birth": "1990-05-15",
  "nationality": "US",
  "preferences": {
    "language": "ar",
    "newsletter": false,
    "marketing": true
  },
  "updatedAt": "2025-10-02T11:05:13Z"
}

Validation Rules

  • The request may include any subset of fields; missing fields are left unchanged.

  • If email is provided, it must be a valid email format and not conflict with existing guests.

  • If date_of_birth is provided, it must be a valid date in YYYY-MM-DD format.

  • If country_code or nationality are provided, they must be valid ISO 3166-1 alpha-2 codes.

  • If phone is provided, it should follow E.164 format.


Error Codes

HTTP
Code
Description

400

bad_request

Invalid field(s) or payload structure.

404

guest_not_found

No guest with the specified guestId.

409

email_conflict

New email address already exists for another guest.

422

invalid_country_code

Invalid country code or nationality provided.

422

invalid_date_format

Invalid date format for date_of_birth.

500

server_error

Unexpected error.

Last updated

Was this helpful?