Skip to content
Vellum

Register a ship

Adds a ship to the harbor's register.

POST /ships

Warning

A ship's type cannot be changed once it is registered.

Authorization

harborAuth Authorization: Bearer <token>

Get a token the way a real API hands one out. The client ID is harbor-docs, and for client credentials the secret is harbor-docs-secret.

bearerAuth Authorization: Bearer <token>

Or skip signing in. Any token will do here. Without one the answer is a 401.

Header parameters

Idempotency-Key? string

Repeat a request safely.

Format uuid

Request body

application/json Required
name* string

Range 2 ≤ value ≤ 80

type* string

What the ship carries.

Value in cargo tanker ferry tug

tonnage? number

Gross tonnage.

Format float Range 0 ≤ value ≤ 500000

captain? object

Whoever is in command right now.

Properties
name* string
licence? string

Pattern ^[A-Z]{2}\d{6}$

crew? array<object>
Properties
name? string
role? string

Value in deck engine galley

escort? Ship

Repeats Ship

callbackUrl? string

Where to send the inspection result. See the callback below.

Format uri

Responses

201 The ship as registered. application/json
name* string

Range 2 ≤ value ≤ 80

type* string

What the ship carries.

Value in cargo tanker ferry tug

id? integer

Format int64

tonnage? number

Gross tonnage.

Format float Range 0 ≤ value ≤ 500000

captain? object

Whoever is in command right now.

Properties
name* string
licence? string

Pattern ^[A-Z]{2}\d{6}$

crew? array<object>
Properties
name? string
role? string

Value in deck engine galley

escort? Ship

Repeats Ship

registeredAt? string

Format date-time

422 The ship did not pass validation. application/json
message* string
errors? object

Callbacks

Requests the API sends back once this one is made, to the address shown.

POST {$request.body#/callbackUrl} Inspection done

Sent to the callbackUrl given at registration, once the harbor master has inspected the ship. This example never sends it.

shipId* integer
passed* boolean

Whether the ship may leave the harbor.

notes? string

Answer with 204