This API endpoint allows you to create a new vessel.

Supported Formats

json

Errors

Code Description
404 Not found.
500 Server crashed.

Examples

curl "https://app.octopi.co/api/v1/vessels.json" -X POST -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token token=YOURTOKEN" -d '{"vessel": {"name": "CFS PACENO", "call_sign": "6YSO4", "imo": "9403451", "vessel_type": "container", "gross_tonnage": 9957}}'
{
  "vessel": {
    "id": 1234,
    "name": "CFS PACENO",
    "call_sign": "6YSO4",
    "imo_number": "9403451",
    "vessel_type": "container",
    "loa": "148m",
    "gross_tonnage": 9957,
    "actions": {
      "show": { "method": "GET", "url": "https://app.octopi.co/api/v1/vessels/CFS%20PACENO.json" },
      "update": { "method": "PUT", "url": "https://app.octopi.co/api/v1/vessels/1234.json" }
    }
  }
}

Params

Param name Description
vessel
required

Validations:

  • Must be a Hash

vessel[name]
required

The vessel name. Must be unique per organization.

Validations:

  • Must be a String

vessel[call_sign]
optional

The vessel call sign. Must be unique per organization.

Validations:

  • Must be a String

vessel[imo]
optional

The vessel IMO number. Must be 7 digits and unique per organization.

Validations:

  • Must be a String

vessel[vessel_type]
optional

The vessel type (e.g. container, general_cargo, dry_bulk, tanker).

Validations:

  • Must be a String

vessel[loa]
optional

The length overall (LOA) of the vessel.

Validations:

  • Must be a String

vessel[woa]
optional

The width overall (WOA) of the vessel.

Validations:

  • Must be a number.

vessel[gross_tonnage]
optional

The gross tonnage of the vessel.

Validations:

  • Must be a Integer

vessel[net_tonnage]
optional

The net tonnage of the vessel.

Validations:

  • Must be a Integer

vessel[teu_capacity]
optional

The TEU capacity of the vessel.

Validations:

  • Must be a number.

vessel[country_code]
optional

The country code of the vessel.

Validations:

  • Must be a String

vessel[scac]
optional

The SCAC code of the vessel.

Validations:

  • Must be a String

vessel[agent_name]
optional

The name of the vessel’s agent.

Validations:

  • Must be a String

vessel[max_draught]
optional

The maximum draught of the vessel.

Validations:

  • Must be a number.

vessel[has_cranes]
optional

Whether the vessel has cranes.

Validations:

  • Must be one of: true, false.

vessel[number_of_bays]
optional

The number of bays on the vessel.

Validations:

  • Must be a Integer

vessel[number_of_rows]
optional

The number of rows on the vessel.

Validations:

  • Must be a Integer

vessel[number_of_tiers_above]
optional

The number of tiers above deck. Must be greater than above_deck_first_tier.

Validations:

  • Must be a Integer

vessel[number_of_tiers_below]
optional

The number of tiers below deck.

Validations:

  • Must be a Integer

vessel[above_deck_first_tier]
optional

The first tier above deck. Must be one of: 70, 72, 74, 76, 78, 80, 82, 84.

Validations:

  • Must be a Integer

vessel[bay_groups]
optional

The bay groups of the vessel. Array of bay group arrays e.g. [[1,3],[5],[7,9]].

Validations:

  • Must be an array of any type