Charter Boats
Charter Boats API
Boats

Photos & Videos

Upload, order, hide and delete a boat's photos and videos

Same in API v1.0 and v1.1

POST/boats/:id/imagesPATCH/boats/:id/imagesDELETE/boats/:id/images?image_id=

Manage the photos and videos of a boat your company owns. A boat needs at least one photo to be published, so every photo call checks the boat's completeness again: an upload can publish a complete draft, and hiding or deleting the last photo takes the boat offline.

Authentication

Requires one of:

  • API key: X-API-Key header with your API key. This is the way to call it from your own systems.
  • Session: a signed-in charter.boats session — what the dashboard uses from the browser. Outside charter.boats a request without a key is stopped by bot protection (HTML 403), so integrations should use the key.

Either way, the account must be a member of the company that owns the boat.

Upload photos

POST /boats/:id/images — multipart/form-data, one or more file parts whose field name starts with file (file, file1, …).

JPEG, PNG, GIF and WebP are accepted, up to 10 MB a file; a file that is not an image or is larger is skipped. New photos go after the existing ones, and the first photo of a boat that has none becomes its cover. A JSON body is refused: only files are accepted.

curl -X POST https://charter.boats/api/boats/550e8400-e29b-41d4-a716-446655440000/images \
  -H "X-API-Key: YOUR_API_KEY" \
  -F "file1=@deck.jpg" \
  -F "file2=@saloon.jpg"
{
  "uploaded": 2,
  "images": [{ "id": "…", "url": "…", "is_primary": true, "sort_order": 0 }]
}

uploaded is how many files were stored; images is every visible photo of the boat, in order.

Order, hide or show photos

PATCH /boats/:id/images — a JSON body with one of:

FieldTypeDescription
image_idsarrayPhoto ids in the new order; the first becomes the cover. Every id must belong to this boat
disable_idstringHide this photo from guests. A photo from MMK or Nausys can be hidden but not deleted — the next sync would add it back
enable_idstringShow a hidden photo again

Answers { "success": true, "is_published": …, "missing": [...] } — missing lists what the boat still lacks to be published.

Delete a photo

DELETE /boats/:id/images?image_id=<id> removes the photo and its files for good. A photo from MMK or Nausys is refused (400); hide it instead. Answers { "success": true, "deleted": "<id>", "is_published": …, "missing": [...] }.

Videos

POST/dashboard/boats/:id/videosPATCH/dashboard/boats/:id/videos/:videoIdDELETE/dashboard/boats/:id/videos/:videoId

A video on your own boat is public as soon as it is uploaded.

  • Upload — multipart/form-data with a file part (MP4, WebM or MOV, up to 100 MB), and optionally a poster part (one JPEG frame, up to 2 MB) and a duration part (seconds). A poster that does not fit is dropped and the video is stored without one. The response is the video: id, url, thumbnail_url, sort_order, caption, is_active, duration_seconds.
  • Hide or show — PATCH with { "is_active": false } or true. The response is the video. A video that was refused in review cannot be shown again (409).
  • Delete — removes the video and its files and answers { "success": true }.

Errors

StatusMessage
400Boat ID required / Boat ID and image_id required / Boat ID and video ID required
400Upload image files — a JSON body to the upload
400No images added successfully — no file part was a usable image
400image_ids, disable_id or enable_id required
400Some image IDs do not belong to this entity
400This photo comes from your booking system — hide it instead
400No file provided / Video must be MP4, WebM or MOV / File is empty / File too large (max 100MB)
400is_active is required
401Invalid API key — a key that belongs to no account
401Invalid API key format — a malformed key
401Authentication required — no key and no signed-in session
403Not a company member — you don't belong to the boat's company
404Boat not found / Image not found / Video not found
409This video was refused and its file was deleted — there is nothing left to publish. Delete it instead.
500Upload failed / Could not save video / Could not delete video

On this page