{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/schedulesmcp-com/json-schema/schedulesmcp-com-sailing-schema.json",
  "title": "Sailing",
  "description": "One carrier offer on the lane: what that line published for this departure.",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/schedulesmcp-com-openapi.json#/components/schemas/Sailing",
  "type": "object",
  "properties": {
    "sailing_id": {
      "type": "string",
      "format": "uuid",
      "description": "The key to store this sailing under. It stays the same when the line moves the dates of a sailing with a voyage number. It changes when the line changes the ship, the voyage or the routing, including the onward voyage at a transshipment hub, which some lines do often: to you that is one sailing gone and a new one added. With `routings=all`, an alternative carries the `sailing_id` of its departure and `is_alternative: true`; tell the routings of one departure apart by `route_legs`. Two main routings of one departure (`is_alternative: false`) each have their own `sailing_id`. An id can end when we merge two rows of one sailing, and removals are not reported."
    },
    "carrier_code": {
      "type": "string",
      "description": "The line's SCAC; with a `carrier` filter, the code you asked for."
    },
    "carrier_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "The line's trading name, or null where we hold none; program against `carrier_code`."
    },
    "service_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "The line's own name for the service loop, as published, or null; not comparable across carriers."
    },
    "vessel_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "The ship's name, `TBN` when the line has not named one yet, or null when it gave no ship."
    },
    "voyage_number": {
      "type": [
        "string",
        "null"
      ],
      "description": "The line's voyage number, or null when it has not assigned one."
    },
    "vessel_imo": {
      "type": [
        "string",
        "null"
      ],
      "description": "The ship's IMO number, or null when we cannot say for certain which ship this is."
    },
    "vessel": {
      "type": [
        "object",
        "null"
      ],
      "description": "Particulars of the ship in `vessel_imo`, or null when we hold none for it.",
      "properties": {
        "teu": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Nominal capacity in TEU; read it with `teu_estimated`."
        },
        "teu_estimated": {
          "type": "boolean",
          "description": "True when `teu` is derived from deadweight rather than published for the ship."
        },
        "flag": {
          "type": [
            "string",
            "null"
          ],
          "description": "Flag state as a country name, as the vessel register spells it."
        },
        "year_built": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Year the ship was built, from the vessel register."
        },
        "length_m": {
          "type": [
            "number",
            "null"
          ],
          "description": "Ship's length in metres, from the vessel register."
        }
      }
    },
    "published_departure": {
      "type": "string",
      "description": "Departure as the line publishes it, in the origin port's local time, with no offset; do not convert it."
    },
    "published_arrival": {
      "type": [
        "string",
        "null"
      ],
      "description": "Arrival as the line publishes it, in the destination port's local time, with no offset, or null when not published. Use `transit_days` for voyage length, not arrival minus departure."
    },
    "departure_precision": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "minute",
        "day"
      ],
      "description": "`minute` when the line published a departure time, `day` when only a date (the 00:00 is ours), null when unknown."
    },
    "arrival_precision": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "minute",
        "day"
      ],
      "description": "The same as `departure_precision`, for `published_arrival`."
    },
    "cy_cutoff": {
      "type": [
        "string",
        "null"
      ],
      "description": "Container yard cut-off, port-local with no offset; `cutoffs` holds every deadline and `cutoff_status` explains a null."
    },
    "doc_cutoff": {
      "type": [
        "string",
        "null"
      ],
      "description": "Documentation cut-off, port-local with no offset; `cutoffs` holds every deadline and `cutoff_status` explains a null."
    },
    "vgm_cutoff": {
      "type": [
        "string",
        "null"
      ],
      "description": "VGM (verified gross mass) cut-off, port-local with no offset; `cutoffs` holds every deadline and `cutoff_status` explains a null."
    },
    "cutoffs": {
      "type": [
        "array",
        "null"
      ],
      "description": "Every deadline the line published for this sailing, or null when we hold none (see `cutoff_status`).",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "Normalised deadline code (DCSA where one exists, `X-` prefixed otherwise); filter and compare on this."
          },
          "at": {
            "type": "string",
            "description": "The deadline in the local time of its port, with no offset."
          },
          "label": {
            "type": [
              "string",
              "null"
            ],
            "description": "The line's own wording for the deadline, to show a person, or null when we hold none."
          }
        }
      }
    },
    "cutoff_status": {
      "type": "string",
      "enum": [
        "published",
        "not_published",
        "not_held"
      ],
      "description": "Why cut-offs are present or null: `published`, `not_published` (the line publishes none), or `not_held` (we hold none from this line; ask it directly)."
    },
    "last_changed_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When we last saw the line move the published departure or arrival, in UTC, or null if never. `changed_since` filters on this and also returns sailings new to us, whose `last_changed_at` can be null or earlier."
    },
    "is_alternative": {
      "type": "boolean",
      "description": "With `routings=all` only: true for an extra routing of the departure, false for its main one. Not every line reports alternatives; for such a line each routing is a sailing of its own."
    },
    "retrieved_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the line last confirmed this sailing to us, in UTC; never older than 14 days."
    },
    "transit_days": {
      "type": [
        "integer",
        "null"
      ],
      "description": "The line's own transit time in days, or null when not published."
    },
    "is_transshipment": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "True when the box changes ship, false when it does not, null when we cannot tell."
    },
    "transship_via": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      },
      "description": "Hub UN/LOCODEs on a transshipment, null otherwise."
    },
    "route_legs": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/RouteLeg"
      },
      "description": "The routing as the line filed it, one entry per leg in order, or null when we have no legs for it (null alone does not mean direct). A direct sailing has its one leg when the line counts one, and null when the line lists only port calls."
    },
    "routing_status": {
      "type": "string",
      "enum": [
        "known",
        "unknown"
      ],
      "description": "`known` when `is_transshipment` is true or false, `unknown` when it is null."
    }
  },
  "$defs": {
    "RouteLeg": {
      "type": "object",
      "description": "One leg of the routing as the line filed it, with the same keys on every leg.",
      "properties": {
        "leg": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Position of the leg in the routing, from 1."
        },
        "from": {
          "type": [
            "string",
            "null"
          ],
          "description": "The leg's departure port: a UN/LOCODE, or the line's own code where we hold no translation."
        },
        "from_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "The departure port's name as the line wrote it; null when the line gives none."
        },
        "to": {
          "type": [
            "string",
            "null"
          ],
          "description": "The leg's arrival port: a UN/LOCODE, or the line's own code where we hold no translation."
        },
        "to_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "The arrival port's name as the line wrote it; null when the line gives none."
        },
        "vessel": {
          "type": [
            "string",
            "null"
          ],
          "description": "The ship on this leg, `TBN` when not yet named, or null when the leg has no ship (see `mode`)."
        },
        "mode": {
          "type": "string",
          "enum": [
            "water",
            "feeder",
            "rail",
            "truck",
            "barge",
            "inland",
            "unknown"
          ],
          "description": "What the leg travels on: `water` and `feeder` are ships, `rail`, `truck`, `barge` and `inland` are not transshipment, `unknown` is a ship not yet named."
        },
        "voyage": {
          "type": [
            "string",
            "null"
          ],
          "description": "The line's voyage number for this leg, or null when not assigned."
        },
        "service": {
          "type": [
            "string",
            "null"
          ],
          "description": "The line's own service name for this leg, or null when not given."
        },
        "departure": {
          "type": [
            "string",
            "null"
          ],
          "description": "Departure in the local time of this leg's port, with no offset."
        },
        "arrival": {
          "type": [
            "string",
            "null"
          ],
          "description": "Arrival in the local time of this leg's port, with no offset."
        }
      }
    }
  }
}