Charter Boats API
Boats

Update Boat

Update a boat listing

PATCH/boats/:id

Update an existing boat listing. Only the fields you include in the request body will be changed. Requires an authenticated session -- this is a dashboard endpoint used by company members.

Authentication

Requires an authenticated user session (cookie-based). The user must be a member of the company that owns the boat.

Path Parameters

ParameterTypeRequiredDescription
idstringYesBoat UUID

Request Body

All fields are optional. Only include the fields you want to change.

Allowed Fields

FieldTypeDescription
titlestringBoat name/title
descriptionstringFull description
boat_typestringyacht, catamaran, sailboat, motorboat, rib, or other
capacityintegerMaximum guests
length_ftnumberLength in feet
yearintegerYear built
location_idintegerLocation/marina ID
latitudenumberGPS latitude
longitudenumberGPS longitude
price_per_daynumberDaily rate
instant_bookbooleanAllow instant booking
is_activebooleanWhether the listing is active
is_publishedbooleanWhether the listing is visible to guests

Amenities

Pass an array of amenity IDs to replace all amenities. Omit to leave amenities unchanged.

{
  "amenities": ["amenity-uuid-1", "amenity-uuid-2"]
}

Request

# Update price and enable instant booking
curl -X PATCH https://charter.boats/api/boats/550e8400-e29b-41d4-a716-446655440000 \
  -H "Content-Type: application/json" \
  -H "Cookie: session=..." \
  -d '{
    "price_per_day": 950,
    "instant_book": true
  }'
 
# Unpublish a boat
curl -X PATCH https://charter.boats/api/boats/550e8400-e29b-41d4-a716-446655440000 \
  -H "Content-Type: application/json" \
  -H "Cookie: session=..." \
  -d '{
    "is_published": false
  }'
 
# Replace amenities
curl -X PATCH https://charter.boats/api/boats/550e8400-e29b-41d4-a716-446655440000 \
  -H "Content-Type: application/json" \
  -H "Cookie: session=..." \
  -d '{
    "amenities": ["amenity-uuid-wifi", "amenity-uuid-ac"]
  }'

Response

Returns the full updated boat object. If the boat is missing required fields for publishing, a missing array is included.

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "title": "BALI Catspace",
  "boat_type": "catamaran",
  "capacity": 8,
  "length_ft": 40,
  "year": 2023,
  "price_per_day": 950,
  "instant_book": true,
  "is_active": true,
  "is_published": true,
  "missing": []
}

Auto-Unpublish

If an update causes the boat to no longer meet publishing requirements (e.g., removing required fields), the boat is automatically unpublished. In that case, the response includes:

{
  "is_published": false,
  "auto_unpublished": true,
  "missing": ["images", "seasons"]
}

Errors

StatusMessage
400Boat ID is required
401Unauthorized (no valid session)
403Not a member of the boat's company
404Boat not found

On this page