Charter Boats
Charter Boats API
Calendar

Blocks & Calendar Sources

Block dates, read your fleet's calendar and connect iCal feeds

Same in API v1.0 and v1.1

POST/dashboard/calendar/blocksDELETE/dashboard/calendar/blocks/:idGET/dashboard/calendar/availability

Block dates on a boat, read what is booked and blocked across your fleet, and connect outside calendars. These are the calls behind the dashboard's calendar.

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. Calls that take a company_id need your company's id — the company_id on any boat List Your Fleet returns.

Block dates

POST /dashboard/calendar/blocks

FieldTypeRequiredDescription
boat_idstringYesBoat UUID
start_atstringYesFirst day (YYYY-MM-DD)
end_atstringYesLast day (YYYY-MM-DD)
reasonstringNoStored as sent. Default owner_hold
notesstringNoA note for yourself

A block over several days starts at the boat's check-in time on the first day and ends at its check-out time on the last, so the last day stays free for the next check-in; a one-day block holds the whole day. On a boat priced by MMK or Nausys the block is also placed as a hold on that platform; with X-Lock on for your company it is placed on every other partner platform the boat is linked to as well.

The response is the block plus external_holds, one entry per platform a hold was placed on.

curl -X POST https://charter.boats/api/dashboard/calendar/blocks \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "boat_id": "550e8400-e29b-41d4-a716-446655440000", "start_at": "2027-07-03", "end_at": "2027-07-10", "reason": "maintenance" }'

Remove a block

DELETE /dashboard/calendar/blocks/:id releases the block's holds on MMK and Nausys first, then deletes it, and answers { "success": true }. When a platform refuses the release the block is kept (502), so you can retry.

Read the fleet calendar

GET /dashboard/calendar/availability?company_id=<id>

Answers { events, boats, last_sync_at } for every boat of the company, from one month back to a year ahead:

FieldDescription
eventsBookings, blocks, partner reservations and options, and the dates a boat has no price, each with boat_id, start, end, type and label; a block carries its block_id
boatsThe company's boats, with which partner each is linked to (sources)
last_sync_atWhen the calendar last synced from a partner

iCal sources

GET/dashboard/calendar/sources?boat_id=POST/dashboard/calendar/sourcesDELETE/dashboard/calendar/sources/:idPOST/dashboard/calendar/sources/:id/sync

Import an outside calendar (another booking site, your own calendar) into a boat's availability.

  • List — GET ?boat_id=<id> answers the boat's sources, newest first.
  • Add — POST with boat_id, source_name, source_url (an https URL) and optionally source_type (default ical). The response is the new source.
  • Sync one now — POST /dashboard/calendar/sources/:id/sync reads the feed and answers { success, events_processed, events_created, events_updated, events_removed, errors }.
  • Remove — DELETE /dashboard/calendar/sources/:id removes the source with the events it brought in, and answers { "success": true }. When a hold placed for those events cannot be released on MMK or Nausys, the source is kept (502).

To send your calendar the other way, subscribe to the iCal export.

Errors

StatusMessage
400boat_id, start_at, and end_at are required
400Block ID required
400company_id is required
400boat_id is required / boat_id, source_name, and source_url are required
400Invalid URL format / Calendar URL must use https / Calendar URL host is not allowed
400Source ID 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
403Source has no associated company
404Boat not found / Block not found / Calendar source not found
500Failed to load availability / Sync failed: …
502Platform cancel failed: … Block retained — retry to cancel again. (or Calendar source retained)

On this page