{"openapi":"3.0.3","info":{"title":"Vessel Network API","version":"v1","description":"Contract-first OpenAPI for the Vessel Network API, generated from the operation registry (ADR-B-023 #5); do not hand-edit. COVERAGE IS PARTIAL and grows one operation at a time. Published areas: gateway, notifications, operators, vessels. The API serves far more than this, so do not read the document as the whole product. Version negotiated via the X-API-Version header (ADR-0032)."},"servers":[{"url":"/","description":"Header-versioned via X-API-Version (default v1)."}],"components":{"securitySchemes":{"machineOAuth":{"type":"oauth2","description":"Per-operator machine-actor secret (control plane) or PoA-grant token (data plane). Scopes are the API scope registry; the three-plane invariant (control, data, staff) forbids a data-plane credential from holding a control-plane scope, and any machine credential from holding a staff scope.","flows":{"clientCredentials":{"tokenUrl":"/machine/token","scopes":{"operator.manage":"Manage the operator profile, branding, and capability configuration.","route.manage":"Create, update, and configure the operator's routes.","route.read":"Read the operator's routes and their configuration.","dispatch.write":"Create and cancel dispatches on behalf of the operator's customers.","dispatch.read":"Read the operator's dispatches and their status.","inventory.provision":"Provision and assign vessels in the operator's inventory.","inventory.read":"Read the operator's vessel inventory.","customers.read":"Read the operator's customer roster (crosses customers, control plane).","payments.read":"Read the Vessel↔operator reckoning: balances, commission, payouts owed.","gateway.attest":"Submit gateway device attestations (infrastructure machine actor).","deal.write":"Create escrow-deal invitations on behalf of the partner (no address or money fields).","deal.read":"Read the coarse status of the partner's own escrow deals.","concierge.edge":"The Concierge edge: claim turns and report on them. A call about one thread also needs that thread's grant.","concierge.front_door.drop":"Drop the Concierge front door stage to dark, with a reason. Only a person may raise it again.","self.profile.read":"Read the acting customer's own profile.","self.dispatch.read":"Read the acting customer's own dispatches.","self.dispatch.write":"Send and cancel dispatches as the acting customer (the PoA send capability).","self.vessel.read":"Read the acting customer's own vessels.","self.payments.read":"Read the acting customer's own payment and subsidy status.","self.concierge.act":"Act in the acting customer's own Concierge thread: read what they sent, quote a delivery, reply through the send gate, hand the thread to a person.","self.account.read":"Read the acting customer's own account facts: what is on file and how their texts are set.","self.deal.read":"Read the acting customer's own deals and drafts.","self.deal.draft":"Make a draft deal or a prefilled sell page as the acting customer. It never publishes, pays or holds.","storage.field":"Work a storage site in person: sweep, place, pick, stage empties, count, door sizes and grants, terminal enrollment codes.","storage.ops":"Run storage operations: the console, exceptions, installs by hand, sites, go live, holding sites, exits and the courier canary.","storage.support":"Help a storage member: the support view, refund a trip, pause an overdue case, issue a fresh door code, set a failed trip's fault.","storage.finance":"Storage money: publish a price table, month-end statements and the invoice line, margin per site."}}}},"customerBearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Customer Auth0 access token (data plane — the customer's own actions)."},"operatorId":{"type":"apiKey","in":"header","name":"X-Operator-Id","description":"Selects the operator tenant the request acts within."}},"parameters":{"ApiVersionHeader":{"name":"X-API-Version","in":"header","required":false,"description":"API contract version (ADR-0032). Defaults to v1 when absent.","schema":{"type":"string","default":"v1"}},"OperatorIdHeader":{"name":"X-Operator-Id","in":"header","required":false,"description":"Operator tenant id the machine actor acts within.","schema":{"type":"string"}}},"schemas":{"ErrorEnvelope":{"type":"object","required":["success","error"],"properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}},"paths":{"/gateway/attestation":{"post":{"operationId":"submitGatewayAttestation","summary":"Submit a gateway device attestation (machine actor).","tags":["gateway"],"parameters":[{"$ref":"#/components/parameters/ApiVersionHeader"},{"$ref":"#/components/parameters/OperatorIdHeader"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean","enum":[true]}}}}}},"400":{"description":"Validation or request error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Missing required scope(s)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"machineOAuth":["gateway.attest"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"vesselId":{"type":"string","format":"uuid"},"serialNumber":{"type":"string","pattern":"^VS-[A-Z0-9]{5}$"},"sealToken":{"type":"string","minLength":1,"maxLength":512},"photoHash":{"type":"string","pattern":"^[0-9a-f]{64}$"},"capturedAt":{"type":"string","format":"date-time"},"transport":{"type":"string","enum":["lora","site_wifi","site_ethernet"]},"gatewayId":{"type":"string","format":"uuid"}},"required":["vesselId","serialNumber","sealToken","photoHash","capturedAt","transport"],"additionalProperties":false}}}}}},"/notifications/inbox":{"get":{"operationId":"getNotificationInbox","summary":"The signed-in member's notification inbox: the open asks, then everything else newest-first.","tags":["notifications"],"parameters":[{"$ref":"#/components/parameters/ApiVersionHeader"},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","exclusiveMinimum":true,"minimum":0,"maximum":100,"default":50}},{"name":"role","in":"query","required":false,"schema":{"type":"string","enum":["buyer","seller"]}},{"name":"q","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"needsAttention":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["dispatch_created","dispatch_picked_up","dispatch_arriving","dispatch_delivered","inspection_window_reminder","inspection_passed","inspection_rejected","return_initiated","dispatch_returned","dispatch_failed","dwell_window_reminder","courier_matched","route_invite","route_joined","payment_success","payment_failed","hold_placed","hold_released","trust_level_up","vessel_low_battery","vessel_tamper_alert","vessel_geofence_breach","operator_approved","operator_rejected","operator_suspended","operator_reinstated","operator_payouts_enabled","operator_verification_tier_changed","vessel_assigned","vessel_assignment_failed","connection_requested","send_accepted","send_declined","send_expired","vessel_kept","marketplace_offer_received","marketplace_offer_accepted","marketplace_offer_declined","marketplace_offer_expired","reputation_badge_offered","seller_verification_due","seller_payout_destination_added","seller_payouts_enabled","seller_payout_deadline","host_incoming_vessel","host_vessel_arriving","host_outbound_pickup","wholesale_order_shipped","wholesale_order_delivered","deal_payment_held","deal_purchase_confirmed","deal_picked_up","deal_delivered","deal_issue_reported","deal_return_started","deal_payout_on_the_way","deal_refunded","deal_price_adjustment_accepted","deal_pickup_scheduled","deal_payment_not_completed","system"]},"title":{"type":"string"},"body":{"type":"string","nullable":true},"read":{"type":"boolean"},"data":{"type":"object","additionalProperties":{},"nullable":true},"readAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string","format":"date-time"}],"nullable":true},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string","format":"date-time"}]},"dealId":{"type":"string","format":"uuid","nullable":true},"dealRole":{"type":"string","enum":["buyer","seller"],"nullable":true},"itemName":{"type":"string","nullable":true},"action":{"type":"object","properties":{"label":{"type":"string","minLength":1},"href":{"type":"string","pattern":"^\\/"}},"required":["label","href"],"additionalProperties":false,"nullable":true},"attentionResolvedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string","format":"date-time"}],"nullable":true}},"required":["id","type","title","body","read","data","readAt","createdAt","dealId","dealRole","itemName","action","attentionResolvedAt"],"additionalProperties":false}},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["dispatch_created","dispatch_picked_up","dispatch_arriving","dispatch_delivered","inspection_window_reminder","inspection_passed","inspection_rejected","return_initiated","dispatch_returned","dispatch_failed","dwell_window_reminder","courier_matched","route_invite","route_joined","payment_success","payment_failed","hold_placed","hold_released","trust_level_up","vessel_low_battery","vessel_tamper_alert","vessel_geofence_breach","operator_approved","operator_rejected","operator_suspended","operator_reinstated","operator_payouts_enabled","operator_verification_tier_changed","vessel_assigned","vessel_assignment_failed","connection_requested","send_accepted","send_declined","send_expired","vessel_kept","marketplace_offer_received","marketplace_offer_accepted","marketplace_offer_declined","marketplace_offer_expired","reputation_badge_offered","seller_verification_due","seller_payout_destination_added","seller_payouts_enabled","seller_payout_deadline","host_incoming_vessel","host_vessel_arriving","host_outbound_pickup","wholesale_order_shipped","wholesale_order_delivered","deal_payment_held","deal_purchase_confirmed","deal_picked_up","deal_delivered","deal_issue_reported","deal_return_started","deal_payout_on_the_way","deal_refunded","deal_price_adjustment_accepted","deal_pickup_scheduled","deal_payment_not_completed","system"]},"title":{"type":"string"},"body":{"type":"string","nullable":true},"read":{"type":"boolean"},"data":{"type":"object","additionalProperties":{},"nullable":true},"readAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string","format":"date-time"}],"nullable":true},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string","format":"date-time"}]},"dealId":{"type":"string","format":"uuid","nullable":true},"dealRole":{"type":"string","enum":["buyer","seller"],"nullable":true},"itemName":{"type":"string","nullable":true},"action":{"type":"object","properties":{"label":{"type":"string","minLength":1},"href":{"type":"string","pattern":"^\\/"}},"required":["label","href"],"additionalProperties":false,"nullable":true},"attentionResolvedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string","format":"date-time"}],"nullable":true}},"required":["id","type","title","body","read","data","readAt","createdAt","dealId","dealRole","itemName","action","attentionResolvedAt"],"additionalProperties":false}},"cursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"},"counts":{"type":"object","properties":{"needsAttention":{"type":"integer","minimum":0},"unread":{"type":"integer","minimum":0}},"required":["needsAttention","unread"],"additionalProperties":false}},"required":["needsAttention","items","cursor","hasMore","counts"],"additionalProperties":false}}}}}},"400":{"description":"Validation or request error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"customerBearer":[]}]}},"/operators":{"post":{"operationId":"applyOperator","summary":"Apply to become an operator.","tags":["operators"],"parameters":[{"$ref":"#/components/parameters/ApiVersionHeader"}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean","enum":[true]}}}}}},"400":{"description":"Validation or request error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"customerBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"businessName":{"type":"string","minLength":1,"maxLength":200},"businessDescription":{"type":"string","maxLength":1000},"operatorType":{"type":"string","enum":["storage","commerce","logistics","lending","escrow","care","other"]},"ein":{"type":"string","pattern":"^\\d{2}-?\\d{7}$"},"contactEmail":{"type":"string","format":"email"},"websiteUrl":{"type":"string","format":"uri"},"logoUrl":{"type":"string","format":"uri"},"brandColor":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$"},"slug":{"type":"string","minLength":3,"maxLength":40,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"}},"required":["businessName","operatorType"],"additionalProperties":false}}}}}},"/operators/me/onboarding":{"get":{"operationId":"getOperatorOnboardingStatus","summary":"Get the authenticated operator's self-serve onboarding status.","tags":["operators"],"parameters":[{"$ref":"#/components/parameters/ApiVersionHeader"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"operatorId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["pending","approved","suspended","rejected"]},"isLive":{"type":"boolean"},"nextStep":{"type":"string","enum":["apply","approval","payments","credential","branding","capabilities"],"nullable":true},"steps":{"type":"array","items":{"type":"object","properties":{"step":{"type":"string","enum":["apply","approval","payments","credential","branding","capabilities"]},"status":{"type":"string","enum":["complete","available","locked","awaiting_review","optional"]},"required":{"type":"boolean"},"title":{"type":"string"},"description":{"type":"string"},"action":{"type":"object","properties":{"method":{"type":"string","enum":["GET","POST","PATCH","DELETE"]},"path":{"type":"string"}},"required":["method","path"],"additionalProperties":false,"nullable":true}},"required":["step","status","required","title","description","action"],"additionalProperties":false}}},"required":["operatorId","status","isLive","nextStep","steps"],"additionalProperties":false}}}}}},"400":{"description":"Validation or request error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"customerBearer":[]}]}},"/operators/me/routes":{"get":{"operationId":"listOperatorRoutes","summary":"List the routes owned by the authenticated operator.","tags":["operators"],"parameters":[{"$ref":"#/components/parameters/ApiVersionHeader"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean","enum":[true]}}}}}},"400":{"description":"Validation or request error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Missing required scope(s)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"customerBearer":[]},{"machineOAuth":["route.read"]}]},"post":{"operationId":"createOperatorRoute","summary":"Create a route owned by the authenticated operator.","tags":["operators"],"parameters":[{"$ref":"#/components/parameters/ApiVersionHeader"}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean","enum":[true]}}}}}},"400":{"description":"Validation or request error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Missing required scope(s)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"customerBearer":[]},{"machineOAuth":["route.manage"]}]}},"/vessels/lookup":{"get":{"operationId":"lookupVessel","summary":"Look up a vessel by serial or NFC id.","tags":["vessels"],"parameters":[{"$ref":"#/components/parameters/ApiVersionHeader"},{"name":"serial","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":50}},{"name":"nfcId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"vessel":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"serialNumber":{"type":"string"},"name":{"type":"string","nullable":true},"status":{"type":"string","enum":["inventory","unpaired","paired","suspended","decommissioned","lost"]},"place":{"type":"string","enum":["none","stored","in_transit"]},"ownerId":{"type":"string","format":"uuid","nullable":true},"ownerType":{"type":"string","enum":["operator","platform","member","host_network"],"nullable":true},"ownerName":{"type":"string","nullable":true},"batteryLevel":{"type":"integer","minimum":0,"maximum":100,"nullable":true},"lastSeenAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string","format":"date-time"}],"nullable":true},"sealCondition":{"type":"string","enum":["unsealed","intact","tamper"],"nullable":true},"lockState":{"type":"string","enum":["locked","unlocked","unknown"]},"operatorId":{"type":"string","format":"uuid","nullable":true}},"required":["id","serialNumber","name","status","place","ownerId","ownerType","ownerName","batteryLevel","lastSeenAt","sealCondition","lockState","operatorId"],"additionalProperties":false},"ownership":{"type":"string","enum":["self","other","none"]},"activeDispatch":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["draft","awaiting_address","pending_pickup","courier_booked","in_transit","arrived","delivered","inspection","rejected","returning","returned","failed","canceled"]},"role":{"type":"string","enum":["sender","recipient","courier","unrelated"]},"vesselProvenance":{"type":"string","enum":["network","recipient","sender"]},"itemName":{"type":"string","nullable":true},"senderName":{"type":"string","nullable":true},"recipientName":{"type":"string","nullable":true},"courierEtaAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string","format":"date-time"}],"nullable":true}},"required":["id","status","role","vesselProvenance","itemName","senderName","recipientName","courierEtaAt"],"additionalProperties":false,"nullable":true},"routeMembership":{"type":"object","properties":{"isInOwnerRoute":{"type":"boolean"},"routeId":{"type":"string","format":"uuid","nullable":true},"routeName":{"type":"string","nullable":true}},"required":["isInOwnerRoute","routeId","routeName"],"additionalProperties":false,"nullable":true},"pendingDraft":{"type":"object","properties":{"hasDraftNeedingVessel":{"type":"boolean"},"draftId":{"type":"string","format":"uuid","nullable":true}},"required":["hasDraftNeedingVessel","draftId"],"additionalProperties":false,"nullable":true},"pendingAcquisition":{"type":"boolean","nullable":true}},"required":["vessel","ownership","activeDispatch","routeMembership","pendingDraft","pendingAcquisition"],"additionalProperties":false}}}}}},"400":{"description":"Validation or request error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"customerBearer":[]}]}},"/vessels/pair":{"post":{"operationId":"pairVessel","summary":"Pair a vessel to the authenticated member.","tags":["vessels"],"parameters":[{"$ref":"#/components/parameters/ApiVersionHeader"}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean","enum":[true]}}}}}},"400":{"description":"Validation or request error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"customerBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"serialNumber":{"type":"string","minLength":1,"maxLength":50},"nfcId":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","minLength":1,"maxLength":100}},"required":["serialNumber"],"additionalProperties":false}}}}}}}}