{"openapi":"3.1.0","info":{"title":"Blue Sea Line Freight Desk API","version":"1.0.0","description":"One API for the desk and for partners. Envelope { data, meta } on success, { error, meta } on failure; cursor pagination; Idempotency-Key on POST and PATCH; see specs/05-api/api-spec.md."},"servers":[{"url":"https://bluesealine.net/api/v1"}],"tags":[{"name":"platform"},{"name":"auth"},{"name":"organisations"},{"name":"members"},{"name":"api-keys"},{"name":"webhooks"},{"name":"events"},{"name":"intake"},{"name":"cargoOrders"},{"name":"tonnagePositions"},{"name":"matches"},{"name":"tenders"},{"name":"negotiations"},{"name":"fixtures"},{"name":"tags"},{"name":"rules"},{"name":"companies"},{"name":"contacts"},{"name":"watchlists"},{"name":"savedViews"},{"name":"notifications"},{"name":"assist"},{"name":"reference"},{"name":"trade"},{"name":"admin"},{"name":"team"},{"name":"tasks"},{"name":"voyages"}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"bsl_live_<prefix>_<secret>"},"session":{"type":"apiKey","in":"cookie","name":"bsl_desk_session"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}},"parameters":{}},"paths":{"/health":{"get":{"operationId":"health","summary":"Service health","tags":["platform"],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean"},"build":{"type":"string"},"db":{"type":"string"}},"required":["ok","build","db"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/openapi.json":{"get":{"operationId":"openapi","summary":"This document","tags":["platform"],"security":[],"responses":{"200":{"description":"Success"},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/auth/signup":{"post":{"operationId":"auth.signup","summary":"Create an account","tags":["auth"],"security":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"},"name":{"type":"string","minLength":2,"maxLength":120},"password":{"type":"string","minLength":12,"maxLength":200},"locale":{"type":"string","enum":["en","fa"]}},"required":["email","name","password"]}}}},"responses":{"202":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/auth/login":{"post":{"operationId":"auth.login","summary":"Sign in with a password; an account with a passkey or codes gets a five minute second step instead of a session (ADR-0016)","tags":["auth"],"security":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"password":{"type":"string"},"keepSignedIn":{"type":"boolean","description":"Seven days; otherwise 12 hours and a browser session cookie"}},"required":["email","password"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"anyOf":[{"type":"object","properties":{"next":{"type":"string","enum":["done"]}},"required":["next"]},{"type":"object","properties":{"next":{"type":"string","enum":["two_step"]},"methods":{"type":"array","items":{"type":"string","enum":["code","recovery","passkey"]}}},"required":["next","methods"]}]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/auth/two-step":{"post":{"operationId":"auth.twoStep","summary":"The second step of sign in: a code from the authenticator app or a recovery code","tags":["auth"],"security":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"recoveryCode":{"type":"string"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"anyOf":[{"type":"object","properties":{"next":{"type":"string","enum":["done"]}},"required":["next"]},{"type":"object","properties":{"next":{"type":"string","enum":["two_step"]},"methods":{"type":"array","items":{"type":"string","enum":["code","recovery","passkey"]}}},"required":["next","methods"]}]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/auth/passkey/options":{"post":{"operationId":"auth.passkeyOptions","summary":"Sign in with a passkey, step one: the WebAuthn request options","tags":["auth"],"security":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"keepSignedIn":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","additionalProperties":{}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/auth/passkey":{"post":{"operationId":"auth.passkey","summary":"Sign in with a passkey, step two: the device's answer; user verification required","tags":["auth"],"security":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"response":{"type":"object","additionalProperties":{}}},"required":["response"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"anyOf":[{"type":"object","properties":{"next":{"type":"string","enum":["done"]}},"required":["next"]},{"type":"object","properties":{"next":{"type":"string","enum":["two_step"]},"methods":{"type":"array","items":{"type":"string","enum":["code","recovery","passkey"]}}},"required":["next","methods"]}]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/auth/not-me":{"post":{"operationId":"auth.notMe","summary":"This was not me, from the new device mail: every session signed out and a password reset sent; one use","tags":["auth"],"security":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/me/security":{"get":{"operationId":"me.security","summary":"Security: whether two step sign in is required, codes on or off, recovery codes left, passkeys and signed in devices","tags":["auth"],"security":[{"session":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"required":{"type":"boolean","description":"Staff always; anyone else once they turned it on for their account"},"staff":{"type":"boolean","description":"A Blue Sea Line staff account: the requirement cannot be turned off"},"recommended":{"type":"boolean","description":"An owner or admin of an organisation: recommended, not required"},"totp":{"type":"boolean"},"recoveryLeft":{"type":"integer"},"passkeys":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"lastUsedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"}},"required":["id","name","createdAt","lastUsedAt"]}},"sessions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"device":{"type":"string"},"ip":{"type":["string","null"]},"method":{"type":"string"},"startedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"lastSeenAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"current":{"type":"boolean"}},"required":["id","device","ip","method","startedAt","lastSeenAt","current"]}}},"required":["required","staff","recommended","totp","recoveryLeft","passkeys","sessions"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/me/security/two-step":{"post":{"operationId":"me.security.twoStepRequire","summary":"Require two step sign in for this account (on needs a passkey or an authenticator app; off is refused for staff)","tags":["auth"],"security":[{"session":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"on":{"type":"boolean"}},"required":["on"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/me/security/totp":{"post":{"operationId":"me.security.totpStart","summary":"Start adding an authenticator app: a new key and the link a QR code carries","tags":["auth"],"security":[{"session":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"setupToken":{"type":"string"},"secret":{"type":"string"},"uri":{"type":"string"},"qr":{"type":"string","description":"An SVG of the QR code"}},"required":["setupToken","secret","uri","qr"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/me/security/totp/confirm":{"post":{"operationId":"me.security.totpConfirm","summary":"Confirm the first code: codes on, ten recovery codes returned once","tags":["auth"],"security":[{"session":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"setupToken":{"type":"string"},"code":{"type":"string"}},"required":["setupToken","code"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"recoveryCodes":{"type":"array","items":{"type":"string"}}},"required":["recoveryCodes"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/me/security/totp/remove":{"post":{"operationId":"me.security.totpRemove","summary":"Turn codes off with a current code; refused when the role needs two step sign in and no passkey is left","tags":["auth"],"security":[{"session":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"}},"required":["code"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/me/security/recovery-codes":{"post":{"operationId":"me.security.recoveryCodes","summary":"New recovery codes replace the old ones (a current code, or a session started with a passkey)","tags":["auth"],"security":[{"session":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"recoveryCodes":{"type":"array","items":{"type":"string"}}},"required":["recoveryCodes"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/me/security/passkeys/options":{"post":{"operationId":"me.security.passkeyOptions","summary":"Add a passkey, step one: the WebAuthn creation options and a ticket","tags":["auth"],"security":[{"session":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"options":{"type":"object","additionalProperties":{}},"ticket":{"type":"string"}},"required":["options","ticket"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/me/security/passkeys":{"post":{"operationId":"me.security.passkeyAdd","summary":"Add a passkey, step two: the device's answer and a name; the first one brings recovery codes when there are none","tags":["auth"],"security":[{"session":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"ticket":{"type":"string"},"response":{"type":"object","additionalProperties":{}},"name":{"type":"string"}},"required":["ticket","response"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"passkey":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"lastUsedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"}},"required":["id","name","createdAt","lastUsedAt"]},"recoveryCodes":{"type":["array","null"],"items":{"type":"string"}}},"required":["passkey","recoveryCodes"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/me/security/passkeys/{passkeyId}":{"delete":{"operationId":"me.security.passkeyRemove","summary":"Remove a passkey; refused when it is the last factor of a role that needs two step sign in","tags":["auth"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"passkeyId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/me/security/sessions/{sessionId}":{"delete":{"operationId":"me.security.sessionRevoke","summary":"Sign out one device","tags":["auth"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"sessionId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/auth/logout":{"post":{"operationId":"auth.logout","summary":"Sign out this session","tags":["auth"],"security":[{"session":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/auth/logout-all":{"post":{"operationId":"auth.logoutAll","summary":"Sign out everywhere","tags":["auth"],"security":[{"session":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/auth/verify-email":{"post":{"operationId":"auth.verifyEmail","summary":"Confirm an email address","tags":["auth"],"security":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/auth/resend-verification":{"post":{"operationId":"auth.resendVerification","summary":"Send the confirmation again","tags":["auth"],"security":[{"session":[]}],"responses":{"202":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/auth/forgot-password":{"post":{"operationId":"auth.forgotPassword","summary":"Request a password reset","tags":["auth"],"security":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"locale":{"type":"string","enum":["en","fa"]}},"required":["email"]}}}},"responses":{"202":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/auth/reset-password":{"post":{"operationId":"auth.resetPassword","summary":"Choose a new password with a reset token","tags":["auth"],"security":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"password":{"type":"string"}},"required":["token","password"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/auth/change-password":{"post":{"operationId":"auth.changePassword","summary":"Change the password","tags":["auth"],"security":[{"session":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"current":{"type":"string"},"next":{"type":"string"}},"required":["current","next"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/me":{"get":{"operationId":"me","summary":"Who is calling","tags":["platform"],"security":[{"apiKey":[]},{"session":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["session"]},"user":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"email":{"type":"string"},"name":{"type":"string"},"locale":{"type":"string"},"verified":{"type":"boolean"},"isStaff":{"type":"boolean"},"preferences":{"type":"object","properties":{"theme":{"type":"string","enum":["light","dark","system"]},"density":{"type":"string","enum":["compact","normal","comfortable"]},"accent":{"type":"string","enum":["sea","teal","green","amber","violet","rose"]}},"additionalProperties":false,"description":"Personal settings that follow the account (task 29)"}},"required":["id","email","name","locale","verified","isStaff","preferences"]},"memberships":{"type":"array","items":{"type":"object","properties":{"organisation":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"slug":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"plan":{"type":"string"},"branding":{"type":["object","null"],"properties":{"productName":{"type":"string"},"logoUrl":{"type":"string"},"primary":{"type":"string"},"accent":{"type":"string"},"emailFromName":{"type":"string"},"supportEmail":{"type":"string"}}}},"required":["id","slug","name","type","plan","branding"]},"role":{"type":"string","enum":["owner","admin","member","viewer"]}},"required":["organisation","role"]}}},"required":["kind","user","memberships"]},{"type":"object","properties":{"kind":{"type":"string","enum":["api_key"]},"scopes":{"type":"array","items":{"type":"string","enum":["org:read","members:read","cargo:read","cargo:write","tonnage:read","tonnage:write","matches:read","tenders:read","tenders:write","negotiations:read","negotiations:write","fixtures:read","fixtures:write","messages:read","reference:read","webhooks:manage","events:read"]}},"organisation":{"type":["object","null"],"properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"slug":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"plan":{"type":"string"},"branding":{"type":["object","null"],"properties":{"productName":{"type":"string"},"logoUrl":{"type":"string"},"primary":{"type":"string"},"accent":{"type":"string"},"emailFromName":{"type":"string"},"supportEmail":{"type":"string"}}}},"required":["id","slug","name","type","plan","branding"]}},"required":["kind","scopes","organisation"]}]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"patch":{"operationId":"me.update","summary":"Change your own name, language or preferences","tags":["platform"],"security":[{"session":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"locale":{"type":"string","enum":["en","fa"]},"preferences":{"type":"object","properties":{"theme":{"type":"string","enum":["light","dark","system"]},"density":{"type":"string","enum":["compact","normal","comfortable"]},"accent":{"type":"string","enum":["sea","teal","green","amber","violet","rose"]}},"additionalProperties":false}},"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"name":{"type":"string"},"locale":{"type":"string"},"preferences":{"type":"object","properties":{"theme":{"type":"string","enum":["light","dark","system"]},"density":{"type":"string","enum":["compact","normal","comfortable"]},"accent":{"type":"string","enum":["sea","teal","green","amber","violet","rose"]}},"additionalProperties":false}},"required":["name","locale","preferences"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs":{"get":{"operationId":"orgs.list","summary":"Organisations of the signed-in user","tags":["organisations"],"security":[{"session":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"organisation":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"slug":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"plan":{"type":"string"},"branding":{"type":["object","null"],"properties":{"productName":{"type":"string"},"logoUrl":{"type":"string"},"primary":{"type":"string"},"accent":{"type":"string"},"emailFromName":{"type":"string"},"supportEmail":{"type":"string"}}}},"required":["id","slug","name","type","plan","branding"]},"role":{"type":"string","enum":["owner","admin","member","viewer"]}},"required":["organisation","role"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"post":{"operationId":"orgs.create","summary":"Create an organisation","tags":["organisations"],"security":[{"session":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":120},"slug":{"type":"string","minLength":3,"maxLength":40},"type":{"type":"string"},"product":{"type":"string","enum":["desk","assist"],"description":"assist: made from the Freight Assist app, on the Assist plan (ADR-0015)"}},"required":["name"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"slug":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"plan":{"type":"string"},"branding":{"type":["object","null"],"properties":{"productName":{"type":"string"},"logoUrl":{"type":"string"},"primary":{"type":"string"},"accent":{"type":"string"},"emailFromName":{"type":"string"},"supportEmail":{"type":"string"}}}},"required":["id","slug","name","type","plan","branding"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}":{"get":{"operationId":"orgs.get","summary":"Get the organisation","tags":["organisations"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"slug":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"plan":{"type":"string"},"branding":{"type":["object","null"],"properties":{"productName":{"type":"string"},"logoUrl":{"type":"string"},"primary":{"type":"string"},"accent":{"type":"string"},"emailFromName":{"type":"string"},"supportEmail":{"type":"string"}}}},"required":["id","slug","name","type","plan","branding"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"patch":{"operationId":"orgs.update","summary":"Update name, type or branding","tags":["organisations"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"},"branding":{"type":["object","null"],"properties":{"productName":{"type":"string"},"logoUrl":{"type":"string"},"primary":{"type":"string"},"accent":{"type":"string"},"emailFromName":{"type":"string"},"supportEmail":{"type":"string"}}}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"slug":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"plan":{"type":"string"},"branding":{"type":["object","null"],"properties":{"productName":{"type":"string"},"logoUrl":{"type":"string"},"primary":{"type":"string"},"accent":{"type":"string"},"emailFromName":{"type":"string"},"supportEmail":{"type":"string"}}}},"required":["id","slug","name","type","plan","branding"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/members":{"get":{"operationId":"members.list","summary":"List members","tags":["members"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string","minLength":1,"description":"Opaque identifier"},"role":{"type":"string","enum":["owner","admin","member","viewer"]},"name":{"type":"string"},"email":{"type":"string"},"verified":{"type":"boolean"},"joinedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"departments":{"type":"array","items":{"type":"string","enum":["sales","operations","support","administration","accounting"]},"description":"The member's current departments (task 27)"}},"required":["userId","role","name","email","verified","joinedAt","departments"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/members/{userId}":{"patch":{"operationId":"members.role","summary":"Change a member's role","tags":["members"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"userId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["owner","admin","member","viewer"]}},"required":["role"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"delete":{"operationId":"members.remove","summary":"Remove a member","tags":["members"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"userId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/invites":{"get":{"operationId":"invites.list","summary":"Pending invitations","tags":["members"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"email":{"type":"string"},"role":{"type":"string","enum":["owner","admin","member","viewer"]},"expiresAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","email","role","expiresAt","createdAt"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"post":{"operationId":"invites.create","summary":"Invite by email","tags":["members"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"},"role":{"type":"string","enum":["owner","admin","member","viewer"]},"locale":{"type":"string","enum":["en","fa"]}},"required":["email"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"email":{"type":"string"},"role":{"type":"string","enum":["owner","admin","member","viewer"]},"expiresAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","email","role","expiresAt","createdAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/invites/{id}":{"delete":{"operationId":"invites.revoke","summary":"Revoke an invitation","tags":["members"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/invites/lookup":{"get":{"operationId":"invites.lookup","summary":"Read an invitation by token","tags":["members"],"security":[],"parameters":[{"schema":{"type":"string"},"required":true,"name":"token","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"email":{"type":"string"},"role":{"type":"string","enum":["owner","admin","member","viewer"]},"org":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"slug":{"type":"string"},"name":{"type":"string"}},"required":["id","slug","name"]},"inviter":{"type":"string"},"hasAccount":{"type":"boolean"}},"required":["email","role","org","inviter","hasAccount"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/invites/accept":{"post":{"operationId":"invites.accept","summary":"Accept an invitation","tags":["members"],"security":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"name":{"type":"string"},"password":{"type":"string"},"locale":{"type":"string","enum":["en","fa"]}},"required":["token"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"orgSlug":{"type":"string"}},"required":["orgSlug"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/api-keys":{"get":{"operationId":"apiKeys.list","summary":"List API keys","tags":["api-keys"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"masked":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["org:read","members:read","cargo:read","cargo:write","tonnage:read","tonnage:write","matches:read","tenders:read","tenders:write","negotiations:read","negotiations:write","fixtures:read","fixtures:write","messages:read","reference:read","webhooks:manage","events:read"]}},"createdById":{"type":"string","minLength":1,"description":"Opaque identifier"},"lastUsedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"expiresAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"revokedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","name","masked","scopes","createdById","lastUsedAt","expiresAt","revokedAt","createdAt"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"post":{"operationId":"apiKeys.create","summary":"Create an API key (plaintext returned once)","tags":["api-keys"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"scopes":{"type":"array","items":{"type":"string","enum":["org:read","members:read","cargo:read","cargo:write","tonnage:read","tonnage:write","matches:read","tenders:read","tenders:write","negotiations:read","negotiations:write","fixtures:read","fixtures:write","messages:read","reference:read","webhooks:manage","events:read"]},"minItems":1},"expiresAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"}},"required":["name","scopes"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"masked":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["org:read","members:read","cargo:read","cargo:write","tonnage:read","tonnage:write","matches:read","tenders:read","tenders:write","negotiations:read","negotiations:write","fixtures:read","fixtures:write","messages:read","reference:read","webhooks:manage","events:read"]}},"createdById":{"type":"string","minLength":1,"description":"Opaque identifier"},"lastUsedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"expiresAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"revokedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"plaintext":{"type":"string"}},"required":["id","name","masked","scopes","createdById","lastUsedAt","expiresAt","revokedAt","createdAt","plaintext"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/api-keys/{id}":{"delete":{"operationId":"apiKeys.revoke","summary":"Revoke an API key","tags":["api-keys"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/webhooks":{"get":{"operationId":"webhooks.list","summary":"List webhooks","tags":["webhooks"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":200},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"}},"description":{"type":["string","null"]},"active":{"type":"boolean"},"disabledAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","url","events","description","active","disabledAt","createdAt"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"post":{"operationId":"webhooks.create","summary":"Create webhook","tags":["webhooks"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"},"minItems":1},"description":{"type":"string"}},"required":["url","events"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"}},"description":{"type":["string","null"]},"active":{"type":"boolean"},"disabledAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"secret":{"type":"string","description":"whsec_ plus 64 hex; signs X-BlueSea-Signature; returned once"}},"required":["id","url","events","description","active","disabledAt","createdAt","secret"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/webhooks/{webhookId}":{"get":{"operationId":"webhooks.get","summary":"Get webhook","tags":["webhooks"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"webhookId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"}},"description":{"type":["string","null"]},"active":{"type":"boolean"},"disabledAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","url","events","description","active","disabledAt","createdAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"patch":{"operationId":"webhooks.update","summary":"Update webhook","tags":["webhooks"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"webhookId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"active":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"}},"description":{"type":["string","null"]},"active":{"type":"boolean"},"disabledAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","url","events","description","active","disabledAt","createdAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"delete":{"operationId":"webhooks.delete","summary":"Delete a webhook","tags":["webhooks"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"webhookId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/webhooks/{webhookId}/test":{"post":{"operationId":"webhooks.test","summary":"Send a ping event","tags":["webhooks"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"webhookId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/webhook-deliveries":{"get":{"operationId":"webhookDeliveries.list","summary":"List deliveries","tags":["webhooks"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":200},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":false,"description":"Opaque identifier","name":"webhookId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"webhookId":{"type":"string","minLength":1,"description":"Opaque identifier"},"eventId":{"type":"string","minLength":1,"description":"Opaque identifier"},"attempt":{"type":"integer"},"status":{"type":"string","enum":["pending","delivered","failed"]},"responseStatus":{"type":["integer","null"]},"durationMs":{"type":["integer","null"]},"nextAttemptAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","webhookId","eventId","attempt","status","responseStatus","durationMs","nextAttemptAt","createdAt"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/webhook-deliveries/{deliveryId}/retry":{"post":{"operationId":"webhookDeliveries.retry","summary":"Retry a delivery","tags":["webhooks"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"deliveryId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/events":{"get":{"operationId":"events.list","summary":"Poll the event stream","tags":["events"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":200},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string"},"required":false,"name":"type","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"type":{"type":"string"},"entityType":{"type":"string"},"entityId":{"type":"string","minLength":1,"description":"Opaque identifier"},"payload":{"type":"object","additionalProperties":{}},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","type","entityType","entityId","payload","createdAt"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/mailboxes":{"get":{"operationId":"mailboxes.get","summary":"The desk mailbox","tags":["intake"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"address":{"type":"string"},"source":{"type":"string","enum":["imap","webhook"]},"mode":{"type":"string","enum":["desk","own"]},"status":{"type":"string"},"lastPolledAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"lastError":{"type":["string","null"]},"imap":{"type":["object","null"],"properties":{"host":{"type":"string"},"port":{"type":"integer"},"secure":{"type":"boolean"},"user":{"type":"string"},"mailbox":{"type":"string"},"hasPassword":{"type":"boolean"}},"required":["host","port","secure","user","mailbox","hasPassword"],"description":"The password is write-only and never returned"},"inbound":{"type":"object","properties":{"active":{"type":"boolean"},"createdAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"}},"required":["active","createdAt"]}},"required":["id","address","source","mode","status","lastPolledAt","lastError","imap","inbound"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"patch":{"operationId":"mailboxes.update","summary":"Configure the mailbox","tags":["intake"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"type":"string","enum":["desk","own"]},"imap":{"type":"object","properties":{"host":{"type":"string","minLength":3,"maxLength":253},"port":{"type":"integer","minimum":1,"maximum":65535},"secure":{"type":"boolean"},"user":{"type":"string","minLength":1,"maxLength":320},"password":{"type":"string","minLength":1,"maxLength":500},"mailbox":{"type":"string","minLength":1,"maxLength":200}},"required":["host","user"]},"status":{"type":"string","enum":["active","paused"]}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"address":{"type":"string"},"source":{"type":"string","enum":["imap","webhook"]},"mode":{"type":"string","enum":["desk","own"]},"status":{"type":"string"},"lastPolledAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"lastError":{"type":["string","null"]},"imap":{"type":["object","null"],"properties":{"host":{"type":"string"},"port":{"type":"integer"},"secure":{"type":"boolean"},"user":{"type":"string"},"mailbox":{"type":"string"},"hasPassword":{"type":"boolean"}},"required":["host","port","secure","user","mailbox","hasPassword"],"description":"The password is write-only and never returned"},"inbound":{"type":"object","properties":{"active":{"type":"boolean"},"createdAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"}},"required":["active","createdAt"]}},"required":["id","address","source","mode","status","lastPolledAt","lastError","imap","inbound"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/mailboxes/poll":{"post":{"operationId":"mailboxes.poll","summary":"Poll now","tags":["intake"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]},"fetched":{"type":"integer"},"stored":{"type":"integer"},"created":{"type":"integer"},"merged":{"type":"integer"},"error":{"type":["string","null"]}},"required":["ok","fetched","stored","created","merged","error"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/mailboxes/inbound-token":{"post":{"operationId":"mailboxes.inboundToken","summary":"Create the inbound address (shown once; replaces any earlier one)","tags":["intake"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"delete":{"operationId":"mailboxes.inboundRevoke","summary":"Stop the inbound address","tags":["intake"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/inbound/{token}":{"post":{"operationId":"inbound.receive","summary":"A mail provider pushes one raw RFC 822 message (message/rfc822, or JSON {raw: base64})","tags":["intake"],"security":[],"parameters":[{"schema":{"type":"string"},"required":true,"name":"token","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"raw":{"type":"string","description":"base64 of the RFC 822 message"}},"required":["raw"]}}}},"responses":{"202":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"created":{"type":"boolean"}},"required":["id","created"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/messages":{"get":{"operationId":"messages.list","summary":"List messages","tags":["intake"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":200},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string"},"required":false,"name":"parseStatus","in":"query"},{"schema":{"type":"string"},"required":false,"name":"tag","in":"query"},{"schema":{"type":"string"},"required":false,"name":"q","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"messageId":{"type":"string"},"fromAddress":{"type":"string"},"fromName":{"type":["string","null"]},"subject":{"type":"string"},"receivedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"parseStatus":{"type":"string","enum":["pending","parsed","none","failed"]},"tags":{"type":"array","items":{"type":"string"}}},"required":["id","messageId","fromAddress","fromName","subject","receivedAt","parseStatus","tags"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/messages/{messageId}":{"get":{"operationId":"messages.get","summary":"Get a message","tags":["intake"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"messageId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"messageId":{"type":"string"},"fromAddress":{"type":"string"},"fromName":{"type":["string","null"]},"subject":{"type":"string"},"receivedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"parseStatus":{"type":"string","enum":["pending","parsed","none","failed"]},"tags":{"type":"array","items":{"type":"string"}},"textBody":{"type":"string"},"attachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"filename":{"type":"string"},"contentType":{"type":"string"},"sizeBytes":{"type":"integer"}},"required":["id","filename","contentType","sizeBytes"]}},"orders":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["cargo","tonnage"]},"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"action":{"type":"string","enum":["create","merge"]},"confidence":{"type":"integer"},"blockIndex":{"type":"integer"}},"required":["kind","id","action","confidence","blockIndex"]}}},"required":["id","messageId","fromAddress","fromName","subject","receivedAt","parseStatus","tags","textBody","attachments","orders"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/messages/{messageId}/raw":{"get":{"operationId":"messages.raw","summary":"Download the .eml","tags":["intake"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"messageId","in":"path"}],"responses":{"200":{"description":"Success"},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/messages/{messageId}/parse":{"post":{"operationId":"messages.parse","summary":"Parse again","tags":["intake"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"messageId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"status":{"type":"string","enum":["parsed","none","failed"]},"candidates":{"type":"integer"},"created":{"type":"array","items":{"type":"string","minLength":1,"description":"Opaque identifier"}},"merged":{"type":"array","items":{"type":"string","minLength":1,"description":"Opaque identifier"}},"skipped":{"type":"integer"}},"required":["status","candidates","created","merged","skipped"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/messages/{messageId}/tags":{"post":{"operationId":"messages.tag","summary":"Add a tag","tags":["intake"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"messageId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"tagId":{"type":"string","minLength":1,"description":"Opaque identifier"}},"required":["tagId"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/messages/{messageId}/tags/{tagId}":{"delete":{"operationId":"messages.untag","summary":"Remove a tag","tags":["intake"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"messageId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"tagId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/attachments/{attachmentId}":{"get":{"operationId":"attachments.get","summary":"Download an attachment","tags":["intake"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"attachmentId","in":"path"}],"responses":{"200":{"description":"Success"},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/cargo-orders":{"get":{"operationId":"cargoOrders.list","summary":"List cargoOrders","tags":["cargoOrders"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":200},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"reference":{"type":"string"},"status":{"type":"string","enum":["candidate","open","working","fixed","withdrawn","expired"]},"revision":{"type":"integer"},"confidence":{"type":"integer"},"visibility":{"type":"string","enum":["market","whitelist","private"],"description":"Who outside the organisation sees it (ADR-0013)"},"data":{"type":"object","properties":{"commodity":{"type":"string","maxLength":200},"quantityMt":{"type":["number","null"],"exclusiveMinimum":0},"tolerancePct":{"type":"number","minimum":0,"maximum":50},"loadPortIds":{"type":"array","items":{"type":"string","minLength":1,"description":"Opaque identifier"},"maxItems":20},"dischargePortIds":{"type":"array","items":{"type":"string","minLength":1,"description":"Opaque identifier"},"maxItems":20},"loadPortRaw":{"type":"string","maxLength":200},"dischargePortRaw":{"type":"string","maxLength":200},"laycanFrom":{"type":["string","null"],"format":"date"},"laycanTo":{"type":["string","null"],"format":"date"},"chartererCompanyId":{"type":"string","minLength":1,"description":"Opaque identifier"},"freightIdea":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":0,"maximum":1000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amountCents","currency"]},"terms":{"type":"string","maxLength":200},"loadRate":{"type":"string","maxLength":200},"dischargeRate":{"type":"string","maxLength":200},"demurrage":{"type":"string","maxLength":200},"commission":{"type":"number","minimum":0,"maximum":10},"notes":{"type":"string","maxLength":4000}},"required":["commodity","quantityMt","loadPortIds","dischargePortIds","laycanFrom","laycanTo"]},"sourceMessageId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"updatedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","reference","status","revision","confidence","visibility","data","sourceMessageId","createdAt","updatedAt"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"post":{"operationId":"cargoOrders.create","summary":"Create cargoOrder","tags":["cargoOrders"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"commodity":{"type":"string","maxLength":200},"quantityMt":{"type":["number","null"],"exclusiveMinimum":0},"tolerancePct":{"type":"number","minimum":0,"maximum":50},"loadPortIds":{"type":"array","items":{"type":"string","minLength":1,"description":"Opaque identifier"},"maxItems":20},"dischargePortIds":{"type":"array","items":{"type":"string","minLength":1,"description":"Opaque identifier"},"maxItems":20},"loadPortRaw":{"type":"string","maxLength":200},"dischargePortRaw":{"type":"string","maxLength":200},"laycanFrom":{"type":["string","null"],"format":"date"},"laycanTo":{"type":["string","null"],"format":"date"},"chartererCompanyId":{"type":"string","minLength":1,"description":"Opaque identifier"},"freightIdea":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":0,"maximum":1000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amountCents","currency"]},"terms":{"type":"string","maxLength":200},"loadRate":{"type":"string","maxLength":200},"dischargeRate":{"type":"string","maxLength":200},"demurrage":{"type":"string","maxLength":200},"commission":{"type":"number","minimum":0,"maximum":10},"notes":{"type":"string","maxLength":4000}},"required":["commodity","quantityMt","loadPortIds","dischargePortIds","laycanFrom","laycanTo"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"reference":{"type":"string"},"status":{"type":"string","enum":["candidate","open","working","fixed","withdrawn","expired"]},"revision":{"type":"integer"},"confidence":{"type":"integer"},"visibility":{"type":"string","enum":["market","whitelist","private"],"description":"Who outside the organisation sees it (ADR-0013)"},"data":{"type":"object","properties":{"commodity":{"type":"string","maxLength":200},"quantityMt":{"type":["number","null"],"exclusiveMinimum":0},"tolerancePct":{"type":"number","minimum":0,"maximum":50},"loadPortIds":{"type":"array","items":{"type":"string","minLength":1,"description":"Opaque identifier"},"maxItems":20},"dischargePortIds":{"type":"array","items":{"type":"string","minLength":1,"description":"Opaque identifier"},"maxItems":20},"loadPortRaw":{"type":"string","maxLength":200},"dischargePortRaw":{"type":"string","maxLength":200},"laycanFrom":{"type":["string","null"],"format":"date"},"laycanTo":{"type":["string","null"],"format":"date"},"chartererCompanyId":{"type":"string","minLength":1,"description":"Opaque identifier"},"freightIdea":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":0,"maximum":1000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amountCents","currency"]},"terms":{"type":"string","maxLength":200},"loadRate":{"type":"string","maxLength":200},"dischargeRate":{"type":"string","maxLength":200},"demurrage":{"type":"string","maxLength":200},"commission":{"type":"number","minimum":0,"maximum":10},"notes":{"type":"string","maxLength":4000}},"required":["commodity","quantityMt","loadPortIds","dischargePortIds","laycanFrom","laycanTo"]},"sourceMessageId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"updatedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","reference","status","revision","confidence","visibility","data","sourceMessageId","createdAt","updatedAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/cargo-orders/{cargoOrderId}":{"get":{"operationId":"cargoOrders.get","summary":"Get cargoOrder","tags":["cargoOrders"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"cargoOrderId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"reference":{"type":"string"},"status":{"type":"string","enum":["candidate","open","working","fixed","withdrawn","expired"]},"revision":{"type":"integer"},"confidence":{"type":"integer"},"visibility":{"type":"string","enum":["market","whitelist","private"],"description":"Who outside the organisation sees it (ADR-0013)"},"data":{"type":"object","properties":{"commodity":{"type":"string","maxLength":200},"quantityMt":{"type":["number","null"],"exclusiveMinimum":0},"tolerancePct":{"type":"number","minimum":0,"maximum":50},"loadPortIds":{"type":"array","items":{"type":"string","minLength":1,"description":"Opaque identifier"},"maxItems":20},"dischargePortIds":{"type":"array","items":{"type":"string","minLength":1,"description":"Opaque identifier"},"maxItems":20},"loadPortRaw":{"type":"string","maxLength":200},"dischargePortRaw":{"type":"string","maxLength":200},"laycanFrom":{"type":["string","null"],"format":"date"},"laycanTo":{"type":["string","null"],"format":"date"},"chartererCompanyId":{"type":"string","minLength":1,"description":"Opaque identifier"},"freightIdea":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":0,"maximum":1000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amountCents","currency"]},"terms":{"type":"string","maxLength":200},"loadRate":{"type":"string","maxLength":200},"dischargeRate":{"type":"string","maxLength":200},"demurrage":{"type":"string","maxLength":200},"commission":{"type":"number","minimum":0,"maximum":10},"notes":{"type":"string","maxLength":4000}},"required":["commodity","quantityMt","loadPortIds","dischargePortIds","laycanFrom","laycanTo"]},"sourceMessageId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"updatedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","reference","status","revision","confidence","visibility","data","sourceMessageId","createdAt","updatedAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"patch":{"operationId":"cargoOrders.update","summary":"Update cargoOrder","tags":["cargoOrders"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"cargoOrderId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"commodity":{"type":"string","maxLength":200},"quantityMt":{"type":["number","null"],"exclusiveMinimum":0},"tolerancePct":{"type":"number","minimum":0,"maximum":50},"loadPortIds":{"type":"array","items":{"type":"string","minLength":1,"description":"Opaque identifier"},"maxItems":20},"dischargePortIds":{"type":"array","items":{"type":"string","minLength":1,"description":"Opaque identifier"},"maxItems":20},"loadPortRaw":{"type":"string","maxLength":200},"dischargePortRaw":{"type":"string","maxLength":200},"laycanFrom":{"type":["string","null"],"format":"date"},"laycanTo":{"type":["string","null"],"format":"date"},"chartererCompanyId":{"type":"string","minLength":1,"description":"Opaque identifier"},"freightIdea":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":0,"maximum":1000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amountCents","currency"]},"terms":{"type":"string","maxLength":200},"loadRate":{"type":"string","maxLength":200},"dischargeRate":{"type":"string","maxLength":200},"demurrage":{"type":"string","maxLength":200},"commission":{"type":"number","minimum":0,"maximum":10},"notes":{"type":"string","maxLength":4000}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"reference":{"type":"string"},"status":{"type":"string","enum":["candidate","open","working","fixed","withdrawn","expired"]},"revision":{"type":"integer"},"confidence":{"type":"integer"},"visibility":{"type":"string","enum":["market","whitelist","private"],"description":"Who outside the organisation sees it (ADR-0013)"},"data":{"type":"object","properties":{"commodity":{"type":"string","maxLength":200},"quantityMt":{"type":["number","null"],"exclusiveMinimum":0},"tolerancePct":{"type":"number","minimum":0,"maximum":50},"loadPortIds":{"type":"array","items":{"type":"string","minLength":1,"description":"Opaque identifier"},"maxItems":20},"dischargePortIds":{"type":"array","items":{"type":"string","minLength":1,"description":"Opaque identifier"},"maxItems":20},"loadPortRaw":{"type":"string","maxLength":200},"dischargePortRaw":{"type":"string","maxLength":200},"laycanFrom":{"type":["string","null"],"format":"date"},"laycanTo":{"type":["string","null"],"format":"date"},"chartererCompanyId":{"type":"string","minLength":1,"description":"Opaque identifier"},"freightIdea":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":0,"maximum":1000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amountCents","currency"]},"terms":{"type":"string","maxLength":200},"loadRate":{"type":"string","maxLength":200},"dischargeRate":{"type":"string","maxLength":200},"demurrage":{"type":"string","maxLength":200},"commission":{"type":"number","minimum":0,"maximum":10},"notes":{"type":"string","maxLength":4000}},"required":["commodity","quantityMt","loadPortIds","dischargePortIds","laycanFrom","laycanTo"]},"sourceMessageId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"updatedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","reference","status","revision","confidence","visibility","data","sourceMessageId","createdAt","updatedAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/cargo-orders/{cargoOrderId}/accept":{"post":{"operationId":"cargoOrders.accept","summary":"Accept a candidate, with corrections","tags":["cargoOrders"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"cargoOrderId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"commodity":{"type":"string","maxLength":200},"quantityMt":{"type":["number","null"],"exclusiveMinimum":0},"tolerancePct":{"type":"number","minimum":0,"maximum":50},"loadPortIds":{"type":"array","items":{"type":"string","minLength":1,"description":"Opaque identifier"},"maxItems":20},"dischargePortIds":{"type":"array","items":{"type":"string","minLength":1,"description":"Opaque identifier"},"maxItems":20},"loadPortRaw":{"type":"string","maxLength":200},"dischargePortRaw":{"type":"string","maxLength":200},"laycanFrom":{"type":["string","null"],"format":"date"},"laycanTo":{"type":["string","null"],"format":"date"},"chartererCompanyId":{"type":"string","minLength":1,"description":"Opaque identifier"},"freightIdea":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":0,"maximum":1000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amountCents","currency"]},"terms":{"type":"string","maxLength":200},"loadRate":{"type":"string","maxLength":200},"dischargeRate":{"type":"string","maxLength":200},"demurrage":{"type":"string","maxLength":200},"commission":{"type":"number","minimum":0,"maximum":10},"notes":{"type":"string","maxLength":4000}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"reference":{"type":"string"},"status":{"type":"string","enum":["candidate","open","working","fixed","withdrawn","expired"]},"revision":{"type":"integer"},"confidence":{"type":"integer"},"visibility":{"type":"string","enum":["market","whitelist","private"],"description":"Who outside the organisation sees it (ADR-0013)"},"data":{"type":"object","properties":{"commodity":{"type":"string","maxLength":200},"quantityMt":{"type":["number","null"],"exclusiveMinimum":0},"tolerancePct":{"type":"number","minimum":0,"maximum":50},"loadPortIds":{"type":"array","items":{"type":"string","minLength":1,"description":"Opaque identifier"},"maxItems":20},"dischargePortIds":{"type":"array","items":{"type":"string","minLength":1,"description":"Opaque identifier"},"maxItems":20},"loadPortRaw":{"type":"string","maxLength":200},"dischargePortRaw":{"type":"string","maxLength":200},"laycanFrom":{"type":["string","null"],"format":"date"},"laycanTo":{"type":["string","null"],"format":"date"},"chartererCompanyId":{"type":"string","minLength":1,"description":"Opaque identifier"},"freightIdea":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":0,"maximum":1000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amountCents","currency"]},"terms":{"type":"string","maxLength":200},"loadRate":{"type":"string","maxLength":200},"dischargeRate":{"type":"string","maxLength":200},"demurrage":{"type":"string","maxLength":200},"commission":{"type":"number","minimum":0,"maximum":10},"notes":{"type":"string","maxLength":4000}},"required":["commodity","quantityMt","loadPortIds","dischargePortIds","laycanFrom","laycanTo"]},"sourceMessageId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"updatedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","reference","status","revision","confidence","visibility","data","sourceMessageId","createdAt","updatedAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/cargo-orders/{cargoOrderId}/withdraw":{"post":{"operationId":"cargoOrders.withdraw","summary":"Withdraw","tags":["cargoOrders"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"cargoOrderId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"reference":{"type":"string"},"status":{"type":"string","enum":["candidate","open","working","fixed","withdrawn","expired"]},"revision":{"type":"integer"},"confidence":{"type":"integer"},"visibility":{"type":"string","enum":["market","whitelist","private"],"description":"Who outside the organisation sees it (ADR-0013)"},"data":{"type":"object","properties":{"commodity":{"type":"string","maxLength":200},"quantityMt":{"type":["number","null"],"exclusiveMinimum":0},"tolerancePct":{"type":"number","minimum":0,"maximum":50},"loadPortIds":{"type":"array","items":{"type":"string","minLength":1,"description":"Opaque identifier"},"maxItems":20},"dischargePortIds":{"type":"array","items":{"type":"string","minLength":1,"description":"Opaque identifier"},"maxItems":20},"loadPortRaw":{"type":"string","maxLength":200},"dischargePortRaw":{"type":"string","maxLength":200},"laycanFrom":{"type":["string","null"],"format":"date"},"laycanTo":{"type":["string","null"],"format":"date"},"chartererCompanyId":{"type":"string","minLength":1,"description":"Opaque identifier"},"freightIdea":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":0,"maximum":1000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amountCents","currency"]},"terms":{"type":"string","maxLength":200},"loadRate":{"type":"string","maxLength":200},"dischargeRate":{"type":"string","maxLength":200},"demurrage":{"type":"string","maxLength":200},"commission":{"type":"number","minimum":0,"maximum":10},"notes":{"type":"string","maxLength":4000}},"required":["commodity","quantityMt","loadPortIds","dischargePortIds","laycanFrom","laycanTo"]},"sourceMessageId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"updatedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","reference","status","revision","confidence","visibility","data","sourceMessageId","createdAt","updatedAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/cargo-orders/{cargoOrderId}/revisions":{"get":{"operationId":"cargoOrders.revisions","summary":"Revision history","tags":["cargoOrders"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"cargoOrderId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"revision":{"type":"integer"},"data":{"type":"object","properties":{"commodity":{"type":"string","maxLength":200},"quantityMt":{"type":["number","null"],"exclusiveMinimum":0},"tolerancePct":{"type":"number","minimum":0,"maximum":50},"loadPortIds":{"type":"array","items":{"type":"string","minLength":1,"description":"Opaque identifier"},"maxItems":20},"dischargePortIds":{"type":"array","items":{"type":"string","minLength":1,"description":"Opaque identifier"},"maxItems":20},"loadPortRaw":{"type":"string","maxLength":200},"dischargePortRaw":{"type":"string","maxLength":200},"laycanFrom":{"type":["string","null"],"format":"date"},"laycanTo":{"type":["string","null"],"format":"date"},"chartererCompanyId":{"type":"string","minLength":1,"description":"Opaque identifier"},"freightIdea":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":0,"maximum":1000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amountCents","currency"]},"terms":{"type":"string","maxLength":200},"loadRate":{"type":"string","maxLength":200},"dischargeRate":{"type":"string","maxLength":200},"demurrage":{"type":"string","maxLength":200},"commission":{"type":"number","minimum":0,"maximum":10},"notes":{"type":"string","maxLength":4000}},"required":["commodity","quantityMt","loadPortIds","dischargePortIds","laycanFrom","laycanTo"]},"source":{"type":"string"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["revision","data","source","createdAt"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/cargo-orders/{cargoOrderId}/matches":{"get":{"operationId":"cargoOrders.matches","summary":"Matches for this order","tags":["cargoOrders"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"cargoOrderId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"cargoOrderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"tonnagePositionId":{"type":"string","minLength":1,"description":"Opaque identifier"},"score":{"type":"integer"},"breakdown":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"score":{"type":"number"},"weight":{"type":"number"},"note":{"type":"string"},"noteKey":{"type":"string"},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}},"fail":{"type":"boolean"}},"required":["key","score","weight"],"description":"One element of a score: weight 0 elements are checks, fail true is a hard fail that makes the score 0"}},"status":{"type":"string","enum":["suggested","shortlisted","dismissed","worked"]},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","cargoOrderId","tonnagePositionId","score","breakdown","status","createdAt"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/cargo-orders/{cargoOrderId}/rematch":{"post":{"operationId":"cargoOrders.rematch","summary":"Score matches again","tags":["cargoOrders"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"cargoOrderId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/tonnage-positions":{"get":{"operationId":"tonnagePositions.list","summary":"List tonnagePositions","tags":["tonnagePositions"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":200},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"reference":{"type":"string"},"status":{"type":"string","enum":["candidate","open","fixed","withdrawn","expired"]},"revision":{"type":"integer"},"confidence":{"type":"integer"},"visibility":{"type":"string","enum":["market","whitelist","private"],"description":"Who outside the organisation sees it (ADR-0013)"},"data":{"type":"object","properties":{"vesselNameRaw":{"type":"string","maxLength":200},"imo":{"type":"string","pattern":"^\\d{7}$"},"openPortId":{"type":"string","minLength":1,"description":"Opaque identifier"},"openAreaRaw":{"type":"string","maxLength":200},"openFrom":{"type":["string","null"],"format":"date"},"openTo":{"type":["string","null"],"format":"date"},"dwt":{"type":["integer","null"],"exclusiveMinimum":0},"built":{"type":"integer"},"gear":{"type":"string","maxLength":200},"lastCargoes":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":20},"ownerCompanyId":{"type":"string","minLength":1,"description":"Opaque identifier"},"rateIdea":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":0,"maximum":1000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amountCents","currency"]},"notes":{"type":"string","maxLength":4000}},"required":["vesselNameRaw","openFrom","openTo","dwt"]},"sourceMessageId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"updatedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","reference","status","revision","confidence","visibility","data","sourceMessageId","createdAt","updatedAt"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"post":{"operationId":"tonnagePositions.create","summary":"Create tonnagePosition","tags":["tonnagePositions"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"vesselNameRaw":{"type":"string","maxLength":200},"imo":{"type":"string","pattern":"^\\d{7}$"},"openPortId":{"type":"string","minLength":1,"description":"Opaque identifier"},"openAreaRaw":{"type":"string","maxLength":200},"openFrom":{"type":["string","null"],"format":"date"},"openTo":{"type":["string","null"],"format":"date"},"dwt":{"type":["integer","null"],"exclusiveMinimum":0},"built":{"type":"integer"},"gear":{"type":"string","maxLength":200},"lastCargoes":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":20},"ownerCompanyId":{"type":"string","minLength":1,"description":"Opaque identifier"},"rateIdea":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":0,"maximum":1000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amountCents","currency"]},"notes":{"type":"string","maxLength":4000}},"required":["vesselNameRaw","openFrom","openTo","dwt"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"reference":{"type":"string"},"status":{"type":"string","enum":["candidate","open","fixed","withdrawn","expired"]},"revision":{"type":"integer"},"confidence":{"type":"integer"},"visibility":{"type":"string","enum":["market","whitelist","private"],"description":"Who outside the organisation sees it (ADR-0013)"},"data":{"type":"object","properties":{"vesselNameRaw":{"type":"string","maxLength":200},"imo":{"type":"string","pattern":"^\\d{7}$"},"openPortId":{"type":"string","minLength":1,"description":"Opaque identifier"},"openAreaRaw":{"type":"string","maxLength":200},"openFrom":{"type":["string","null"],"format":"date"},"openTo":{"type":["string","null"],"format":"date"},"dwt":{"type":["integer","null"],"exclusiveMinimum":0},"built":{"type":"integer"},"gear":{"type":"string","maxLength":200},"lastCargoes":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":20},"ownerCompanyId":{"type":"string","minLength":1,"description":"Opaque identifier"},"rateIdea":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":0,"maximum":1000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amountCents","currency"]},"notes":{"type":"string","maxLength":4000}},"required":["vesselNameRaw","openFrom","openTo","dwt"]},"sourceMessageId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"updatedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","reference","status","revision","confidence","visibility","data","sourceMessageId","createdAt","updatedAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/tonnage-positions/{tonnagePositionId}":{"get":{"operationId":"tonnagePositions.get","summary":"Get tonnagePosition","tags":["tonnagePositions"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"tonnagePositionId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"reference":{"type":"string"},"status":{"type":"string","enum":["candidate","open","fixed","withdrawn","expired"]},"revision":{"type":"integer"},"confidence":{"type":"integer"},"visibility":{"type":"string","enum":["market","whitelist","private"],"description":"Who outside the organisation sees it (ADR-0013)"},"data":{"type":"object","properties":{"vesselNameRaw":{"type":"string","maxLength":200},"imo":{"type":"string","pattern":"^\\d{7}$"},"openPortId":{"type":"string","minLength":1,"description":"Opaque identifier"},"openAreaRaw":{"type":"string","maxLength":200},"openFrom":{"type":["string","null"],"format":"date"},"openTo":{"type":["string","null"],"format":"date"},"dwt":{"type":["integer","null"],"exclusiveMinimum":0},"built":{"type":"integer"},"gear":{"type":"string","maxLength":200},"lastCargoes":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":20},"ownerCompanyId":{"type":"string","minLength":1,"description":"Opaque identifier"},"rateIdea":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":0,"maximum":1000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amountCents","currency"]},"notes":{"type":"string","maxLength":4000}},"required":["vesselNameRaw","openFrom","openTo","dwt"]},"sourceMessageId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"updatedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","reference","status","revision","confidence","visibility","data","sourceMessageId","createdAt","updatedAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"patch":{"operationId":"tonnagePositions.update","summary":"Update tonnagePosition","tags":["tonnagePositions"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"tonnagePositionId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"vesselNameRaw":{"type":"string","maxLength":200},"imo":{"type":"string","pattern":"^\\d{7}$"},"openPortId":{"type":"string","minLength":1,"description":"Opaque identifier"},"openAreaRaw":{"type":"string","maxLength":200},"openFrom":{"type":["string","null"],"format":"date"},"openTo":{"type":["string","null"],"format":"date"},"dwt":{"type":["integer","null"],"exclusiveMinimum":0},"built":{"type":"integer"},"gear":{"type":"string","maxLength":200},"lastCargoes":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":20},"ownerCompanyId":{"type":"string","minLength":1,"description":"Opaque identifier"},"rateIdea":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":0,"maximum":1000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amountCents","currency"]},"notes":{"type":"string","maxLength":4000}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"reference":{"type":"string"},"status":{"type":"string","enum":["candidate","open","fixed","withdrawn","expired"]},"revision":{"type":"integer"},"confidence":{"type":"integer"},"visibility":{"type":"string","enum":["market","whitelist","private"],"description":"Who outside the organisation sees it (ADR-0013)"},"data":{"type":"object","properties":{"vesselNameRaw":{"type":"string","maxLength":200},"imo":{"type":"string","pattern":"^\\d{7}$"},"openPortId":{"type":"string","minLength":1,"description":"Opaque identifier"},"openAreaRaw":{"type":"string","maxLength":200},"openFrom":{"type":["string","null"],"format":"date"},"openTo":{"type":["string","null"],"format":"date"},"dwt":{"type":["integer","null"],"exclusiveMinimum":0},"built":{"type":"integer"},"gear":{"type":"string","maxLength":200},"lastCargoes":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":20},"ownerCompanyId":{"type":"string","minLength":1,"description":"Opaque identifier"},"rateIdea":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":0,"maximum":1000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amountCents","currency"]},"notes":{"type":"string","maxLength":4000}},"required":["vesselNameRaw","openFrom","openTo","dwt"]},"sourceMessageId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"updatedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","reference","status","revision","confidence","visibility","data","sourceMessageId","createdAt","updatedAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/tonnage-positions/{tonnagePositionId}/accept":{"post":{"operationId":"tonnagePositions.accept","summary":"Accept a candidate, with corrections","tags":["tonnagePositions"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"tonnagePositionId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"vesselNameRaw":{"type":"string","maxLength":200},"imo":{"type":"string","pattern":"^\\d{7}$"},"openPortId":{"type":"string","minLength":1,"description":"Opaque identifier"},"openAreaRaw":{"type":"string","maxLength":200},"openFrom":{"type":["string","null"],"format":"date"},"openTo":{"type":["string","null"],"format":"date"},"dwt":{"type":["integer","null"],"exclusiveMinimum":0},"built":{"type":"integer"},"gear":{"type":"string","maxLength":200},"lastCargoes":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":20},"ownerCompanyId":{"type":"string","minLength":1,"description":"Opaque identifier"},"rateIdea":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":0,"maximum":1000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amountCents","currency"]},"notes":{"type":"string","maxLength":4000}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"reference":{"type":"string"},"status":{"type":"string","enum":["candidate","open","fixed","withdrawn","expired"]},"revision":{"type":"integer"},"confidence":{"type":"integer"},"visibility":{"type":"string","enum":["market","whitelist","private"],"description":"Who outside the organisation sees it (ADR-0013)"},"data":{"type":"object","properties":{"vesselNameRaw":{"type":"string","maxLength":200},"imo":{"type":"string","pattern":"^\\d{7}$"},"openPortId":{"type":"string","minLength":1,"description":"Opaque identifier"},"openAreaRaw":{"type":"string","maxLength":200},"openFrom":{"type":["string","null"],"format":"date"},"openTo":{"type":["string","null"],"format":"date"},"dwt":{"type":["integer","null"],"exclusiveMinimum":0},"built":{"type":"integer"},"gear":{"type":"string","maxLength":200},"lastCargoes":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":20},"ownerCompanyId":{"type":"string","minLength":1,"description":"Opaque identifier"},"rateIdea":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":0,"maximum":1000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amountCents","currency"]},"notes":{"type":"string","maxLength":4000}},"required":["vesselNameRaw","openFrom","openTo","dwt"]},"sourceMessageId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"updatedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","reference","status","revision","confidence","visibility","data","sourceMessageId","createdAt","updatedAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/tonnage-positions/{tonnagePositionId}/withdraw":{"post":{"operationId":"tonnagePositions.withdraw","summary":"Withdraw","tags":["tonnagePositions"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"tonnagePositionId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"reference":{"type":"string"},"status":{"type":"string","enum":["candidate","open","fixed","withdrawn","expired"]},"revision":{"type":"integer"},"confidence":{"type":"integer"},"visibility":{"type":"string","enum":["market","whitelist","private"],"description":"Who outside the organisation sees it (ADR-0013)"},"data":{"type":"object","properties":{"vesselNameRaw":{"type":"string","maxLength":200},"imo":{"type":"string","pattern":"^\\d{7}$"},"openPortId":{"type":"string","minLength":1,"description":"Opaque identifier"},"openAreaRaw":{"type":"string","maxLength":200},"openFrom":{"type":["string","null"],"format":"date"},"openTo":{"type":["string","null"],"format":"date"},"dwt":{"type":["integer","null"],"exclusiveMinimum":0},"built":{"type":"integer"},"gear":{"type":"string","maxLength":200},"lastCargoes":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":20},"ownerCompanyId":{"type":"string","minLength":1,"description":"Opaque identifier"},"rateIdea":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":0,"maximum":1000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amountCents","currency"]},"notes":{"type":"string","maxLength":4000}},"required":["vesselNameRaw","openFrom","openTo","dwt"]},"sourceMessageId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"updatedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","reference","status","revision","confidence","visibility","data","sourceMessageId","createdAt","updatedAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/tonnage-positions/{tonnagePositionId}/revisions":{"get":{"operationId":"tonnagePositions.revisions","summary":"Revision history","tags":["tonnagePositions"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"tonnagePositionId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"revision":{"type":"integer"},"data":{"type":"object","properties":{"vesselNameRaw":{"type":"string","maxLength":200},"imo":{"type":"string","pattern":"^\\d{7}$"},"openPortId":{"type":"string","minLength":1,"description":"Opaque identifier"},"openAreaRaw":{"type":"string","maxLength":200},"openFrom":{"type":["string","null"],"format":"date"},"openTo":{"type":["string","null"],"format":"date"},"dwt":{"type":["integer","null"],"exclusiveMinimum":0},"built":{"type":"integer"},"gear":{"type":"string","maxLength":200},"lastCargoes":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":20},"ownerCompanyId":{"type":"string","minLength":1,"description":"Opaque identifier"},"rateIdea":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":0,"maximum":1000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amountCents","currency"]},"notes":{"type":"string","maxLength":4000}},"required":["vesselNameRaw","openFrom","openTo","dwt"]},"source":{"type":"string"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["revision","data","source","createdAt"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/tonnage-positions/{tonnagePositionId}/matches":{"get":{"operationId":"tonnagePositions.matches","summary":"Matches for this position","tags":["tonnagePositions"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"tonnagePositionId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"cargoOrderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"tonnagePositionId":{"type":"string","minLength":1,"description":"Opaque identifier"},"score":{"type":"integer"},"breakdown":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"score":{"type":"number"},"weight":{"type":"number"},"note":{"type":"string"},"noteKey":{"type":"string"},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}},"fail":{"type":"boolean"}},"required":["key","score","weight"],"description":"One element of a score: weight 0 elements are checks, fail true is a hard fail that makes the score 0"}},"status":{"type":"string","enum":["suggested","shortlisted","dismissed","worked"]},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","cargoOrderId","tonnagePositionId","score","breakdown","status","createdAt"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/tonnage-positions/{tonnagePositionId}/rematch":{"post":{"operationId":"tonnagePositions.rematch","summary":"Score matches again","tags":["tonnagePositions"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"tonnagePositionId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/matches":{"get":{"operationId":"matches.list","summary":"List matches","tags":["matches"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":200},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string"},"required":false,"name":"status","in":"query"},{"schema":{"type":["number","null"]},"required":false,"name":"minScore","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"cargoOrderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"tonnagePositionId":{"type":"string","minLength":1,"description":"Opaque identifier"},"score":{"type":"integer"},"breakdown":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"score":{"type":"number"},"weight":{"type":"number"},"note":{"type":"string"},"noteKey":{"type":"string"},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}},"fail":{"type":"boolean"}},"required":["key","score","weight"],"description":"One element of a score: weight 0 elements are checks, fail true is a hard fail that makes the score 0"}},"status":{"type":"string","enum":["suggested","shortlisted","dismissed","worked"]},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","cargoOrderId","tonnagePositionId","score","breakdown","status","createdAt"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/matches/{matchId}/shortlist":{"post":{"operationId":"matches.shortlist","summary":"Shortlist","tags":["matches"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"matchId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"cargoOrderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"tonnagePositionId":{"type":"string","minLength":1,"description":"Opaque identifier"},"score":{"type":"integer"},"breakdown":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"score":{"type":"number"},"weight":{"type":"number"},"note":{"type":"string"},"noteKey":{"type":"string"},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}},"fail":{"type":"boolean"}},"required":["key","score","weight"],"description":"One element of a score: weight 0 elements are checks, fail true is a hard fail that makes the score 0"}},"status":{"type":"string","enum":["suggested","shortlisted","dismissed","worked"]},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","cargoOrderId","tonnagePositionId","score","breakdown","status","createdAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/matches/{matchId}/dismiss":{"post":{"operationId":"matches.dismiss","summary":"Dismiss","tags":["matches"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"matchId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"cargoOrderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"tonnagePositionId":{"type":"string","minLength":1,"description":"Opaque identifier"},"score":{"type":"integer"},"breakdown":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"score":{"type":"number"},"weight":{"type":"number"},"note":{"type":"string"},"noteKey":{"type":"string"},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}},"fail":{"type":"boolean"}},"required":["key","score","weight"],"description":"One element of a score: weight 0 elements are checks, fail true is a hard fail that makes the score 0"}},"status":{"type":"string","enum":["suggested","shortlisted","dismissed","worked"]},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","cargoOrderId","tonnagePositionId","score","breakdown","status","createdAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/tenders":{"get":{"operationId":"tenders.list","summary":"List tenders","tags":["tenders"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":200},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","description":"Comma list of draft, open, closed, awarded, cancelled"},"required":false,"description":"Comma list of draft, open, closed, awarded, cancelled","name":"status","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":false,"description":"Opaque identifier","name":"cargoOrderId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"cargoOrderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"kind":{"type":"string","enum":["open","closed","reverse"]},"status":{"type":"string","enum":["draft","open","closed","awarded","cancelled"]},"opensAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"closesAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"visibility":{"type":"string","enum":["invited","market"]},"awardedBidId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","cargoOrderId","kind","status","opensAt","closesAt","visibility","awardedBidId","createdAt"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"post":{"operationId":"tenders.create","summary":"Create tender","tags":["tenders"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"cargoOrderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"kind":{"type":"string","enum":["open","closed","reverse"]},"closesAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"visibility":{"type":"string","enum":["invited","market"]}},"required":["cargoOrderId","kind"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"cargoOrderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"kind":{"type":"string","enum":["open","closed","reverse"]},"status":{"type":"string","enum":["draft","open","closed","awarded","cancelled"]},"opensAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"closesAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"visibility":{"type":"string","enum":["invited","market"]},"awardedBidId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","cargoOrderId","kind","status","opensAt","closesAt","visibility","awardedBidId","createdAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/tenders/{tenderId}":{"get":{"operationId":"tenders.get","summary":"Get tender","tags":["tenders"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"tenderId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"cargoOrderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"kind":{"type":"string","enum":["open","closed","reverse"]},"status":{"type":"string","enum":["draft","open","closed","awarded","cancelled"]},"opensAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"closesAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"visibility":{"type":"string","enum":["invited","market"]},"awardedBidId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","cargoOrderId","kind","status","opensAt","closesAt","visibility","awardedBidId","createdAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"patch":{"operationId":"tenders.update","summary":"Update tender","tags":["tenders"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"tenderId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"closesAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"visibility":{"type":"string","enum":["invited","market"]}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"cargoOrderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"kind":{"type":"string","enum":["open","closed","reverse"]},"status":{"type":"string","enum":["draft","open","closed","awarded","cancelled"]},"opensAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"closesAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"visibility":{"type":"string","enum":["invited","market"]},"awardedBidId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","cargoOrderId","kind","status","opensAt","closesAt","visibility","awardedBidId","createdAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/tenders/{tenderId}/open":{"post":{"operationId":"tenders.open","summary":"Open for bids","tags":["tenders"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"tenderId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"cargoOrderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"kind":{"type":"string","enum":["open","closed","reverse"]},"status":{"type":"string","enum":["draft","open","closed","awarded","cancelled"]},"opensAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"closesAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"visibility":{"type":"string","enum":["invited","market"]},"awardedBidId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","cargoOrderId","kind","status","opensAt","closesAt","visibility","awardedBidId","createdAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/tenders/{tenderId}/close":{"post":{"operationId":"tenders.close","summary":"Close","tags":["tenders"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"tenderId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"cargoOrderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"kind":{"type":"string","enum":["open","closed","reverse"]},"status":{"type":"string","enum":["draft","open","closed","awarded","cancelled"]},"opensAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"closesAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"visibility":{"type":"string","enum":["invited","market"]},"awardedBidId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","cargoOrderId","kind","status","opensAt","closesAt","visibility","awardedBidId","createdAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/tenders/{tenderId}/award":{"post":{"operationId":"tenders.award","summary":"Award to a bid","tags":["tenders"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"tenderId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"bidId":{"type":"string","minLength":1,"description":"Opaque identifier"}},"required":["bidId"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"cargoOrderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"kind":{"type":"string","enum":["open","closed","reverse"]},"status":{"type":"string","enum":["draft","open","closed","awarded","cancelled"]},"opensAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"closesAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"visibility":{"type":"string","enum":["invited","market"]},"awardedBidId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","cargoOrderId","kind","status","opensAt","closesAt","visibility","awardedBidId","createdAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/tenders/{tenderId}/cancel":{"post":{"operationId":"tenders.cancel","summary":"Cancel a draft or open tender","tags":["tenders"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"tenderId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"cargoOrderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"kind":{"type":"string","enum":["open","closed","reverse"]},"status":{"type":"string","enum":["draft","open","closed","awarded","cancelled"]},"opensAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"closesAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"visibility":{"type":"string","enum":["invited","market"]},"awardedBidId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","cargoOrderId","kind","status","opensAt","closesAt","visibility","awardedBidId","createdAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/tenders/{tenderId}/bids":{"get":{"operationId":"tenders.bids.list","summary":"Bids","tags":["tenders"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"tenderId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"tenderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"tonnagePositionId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"bidderContact":{"type":["string","null"]},"rate":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":0,"maximum":1000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amountCents","currency"]},"rateBasis":{"type":"string","enum":["per_mt","lumpsum","per_day"]},"terms":{"type":"object","additionalProperties":{}},"submittedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"withdrawnAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"}},"required":["id","tenderId","tonnagePositionId","bidderContact","rate","rateBasis","terms","submittedAt","withdrawnAt"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"post":{"operationId":"tenders.bids.create","summary":"Place a bid on behalf of an owner","tags":["tenders"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"tenderId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"tonnagePositionId":{"type":"string","minLength":1,"description":"Opaque identifier"},"bidderCompanyId":{"type":"string","minLength":1,"description":"Opaque identifier"},"bidderContact":{"type":"string","maxLength":320},"rate":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":0,"maximum":1000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amountCents","currency"]},"rateBasis":{"type":"string","enum":["per_mt","lumpsum","per_day"]},"terms":{"type":"object","properties":{"vesselName":{"type":"string","maxLength":200},"dwt":{"type":"integer","exclusiveMinimum":0},"openFrom":{"type":"string","format":"date"},"laycan":{"type":"string","maxLength":100},"loadRate":{"type":"string","maxLength":200},"dischargeRate":{"type":"string","maxLength":200},"demurrage":{"type":"string","maxLength":200},"commission":{"type":"number","minimum":0,"maximum":10},"note":{"type":"string","maxLength":1000}},"additionalProperties":false}},"required":["rate","rateBasis"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"tenderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"tonnagePositionId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"bidderContact":{"type":["string","null"]},"rate":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":0,"maximum":1000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amountCents","currency"]},"rateBasis":{"type":"string","enum":["per_mt","lumpsum","per_day"]},"terms":{"type":"object","additionalProperties":{}},"submittedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"withdrawnAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"}},"required":["id","tenderId","tonnagePositionId","bidderContact","rate","rateBasis","terms","submittedAt","withdrawnAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/tenders/{tenderId}/invites":{"get":{"operationId":"tenders.invites.list","summary":"Invites with sent and opened","tags":["tenders"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"tenderId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"email":{"type":["string","null"]},"companyId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"sentAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"openedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"bids":{"type":"integer"}},"required":["id","email","companyId","sentAt","openedAt","createdAt","bids"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"post":{"operationId":"tenders.invites","summary":"Invite bidders by email or company; each link is returned once","tags":["tenders"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"tenderId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"companyIds":{"type":"array","items":{"type":"string","minLength":1,"description":"Opaque identifier"},"maxItems":50},"emails":{"type":"array","items":{"type":"string","format":"email"},"maxItems":50}}}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"email":{"type":["string","null"]},"companyId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"url":{"type":"string","description":"The bid link, returned once"},"sent":{"type":"boolean"}},"required":["id","email","companyId","url","sent"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/tender-invites/{token}":{"get":{"operationId":"tenderInvites.get","summary":"What an invited bidder sees through the link","tags":["tenders"],"security":[],"parameters":[{"schema":{"type":"string"},"required":true,"name":"token","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"organisation":{"type":"string"},"cargo":{"type":"object","properties":{"commodity":{"type":["string","null"]},"quantityMt":{"type":["number","null"]},"loadPorts":{"type":"array","items":{"type":"string"}},"dischargePorts":{"type":"array","items":{"type":"string"}},"laycanFrom":{"type":["string","null"]},"laycanTo":{"type":["string","null"]}},"required":["commodity","quantityMt","loadPorts","dischargePorts","laycanFrom","laycanTo"]},"status":{"type":"string","enum":["draft","open","closed","awarded","cancelled"]},"open":{"type":"boolean"},"closesAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"bids":{"type":"array","items":{"type":"object","properties":{"rate":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":0,"maximum":1000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amountCents","currency"]},"rateBasis":{"type":"string"},"submittedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"withdrawnAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"}},"required":["rate","rateBasis","submittedAt","withdrawnAt"]}}},"required":["organisation","cargo","status","open","closesAt","bids"],"description":"What an invited bidder sees through the link: the cargo, the state and their own bids"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/tender-invites/{token}/bids":{"post":{"operationId":"tenderInvites.bid","summary":"Place a bid through the link; replaces the earlier bid from the same link","tags":["tenders"],"security":[],"parameters":[{"schema":{"type":"string"},"required":true,"name":"token","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"rate":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":0,"maximum":1000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amountCents","currency"]},"rateBasis":{"type":"string","enum":["per_mt","lumpsum","per_day"]},"terms":{"type":"object","properties":{"vesselName":{"type":"string","maxLength":200},"dwt":{"type":"integer","exclusiveMinimum":0},"openFrom":{"type":"string","format":"date"},"laycan":{"type":"string","maxLength":100},"loadRate":{"type":"string","maxLength":200},"dischargeRate":{"type":"string","maxLength":200},"demurrage":{"type":"string","maxLength":200},"commission":{"type":"number","minimum":0,"maximum":10},"note":{"type":"string","maxLength":1000}},"additionalProperties":false}},"required":["rate","rateBasis"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"tenderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"tonnagePositionId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"bidderContact":{"type":["string","null"]},"rate":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":0,"maximum":1000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amountCents","currency"]},"rateBasis":{"type":"string","enum":["per_mt","lumpsum","per_day"]},"terms":{"type":"object","additionalProperties":{}},"submittedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"withdrawnAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"}},"required":["id","tenderId","tonnagePositionId","bidderContact","rate","rateBasis","terms","submittedAt","withdrawnAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/negotiations":{"get":{"operationId":"negotiations.list","summary":"List negotiations, newest first","tags":["negotiations"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":200},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","description":"Comma list of commercial statuses or states"},"required":false,"description":"Comma list of commercial statuses or states","name":"status","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":false,"description":"Opaque identifier","name":"cargoOrderId","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":false,"description":"Opaque identifier","name":"tonnagePositionId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"cargoOrderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"tonnagePositionId":{"type":"string","minLength":1,"description":"Opaque identifier"},"matchId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"status":{"type":"string","enum":["open","subjects","fixed","failed"]},"commercialStatus":{"type":"string","enum":["open","not_firm","firm_trading","on_subs","fixed","withdrawn","gone_in_house","backstopped","on_hold","fixed_and_failed"],"description":"The Shipfix commercial status list; status is derived from it"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","cargoOrderId","tonnagePositionId","matchId","status","commercialStatus","createdAt"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"post":{"operationId":"negotiations.create","summary":"Open a negotiation","tags":["negotiations"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"cargoOrderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"tonnagePositionId":{"type":"string","minLength":1,"description":"Opaque identifier"},"matchId":{"type":"string","minLength":1,"description":"Opaque identifier"},"counterpartyCompanyId":{"type":"string","minLength":1,"description":"Opaque identifier"}},"required":["cargoOrderId","tonnagePositionId"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"cargoOrderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"tonnagePositionId":{"type":"string","minLength":1,"description":"Opaque identifier"},"matchId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"status":{"type":"string","enum":["open","subjects","fixed","failed"]},"commercialStatus":{"type":"string","enum":["open","not_firm","firm_trading","on_subs","fixed","withdrawn","gone_in_house","backstopped","on_hold","fixed_and_failed"],"description":"The Shipfix commercial status list; status is derived from it"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","cargoOrderId","tonnagePositionId","matchId","status","commercialStatus","createdAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/negotiations/{negotiationId}":{"get":{"operationId":"negotiations.get","summary":"Get a negotiation","tags":["negotiations"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"negotiationId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"cargoOrderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"tonnagePositionId":{"type":"string","minLength":1,"description":"Opaque identifier"},"matchId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"status":{"type":"string","enum":["open","subjects","fixed","failed"]},"commercialStatus":{"type":"string","enum":["open","not_firm","firm_trading","on_subs","fixed","withdrawn","gone_in_house","backstopped","on_hold","fixed_and_failed"],"description":"The Shipfix commercial status list; status is derived from it"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"offers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"negotiationId":{"type":"string","minLength":1,"description":"Opaque identifier"},"sequence":{"type":"integer"},"side":{"type":"string","enum":["ours","theirs"]},"kind":{"type":"string","enum":["offer","counter","accept","reject","subjects_lifted"]},"rate":{"type":["object","null"],"properties":{"amountCents":{"type":"integer","minimum":0,"maximum":1000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amountCents","currency"]},"rateBasis":{"type":["string","null"]},"terms":{"type":"object","properties":{"vesselName":{"type":"string","maxLength":200},"dwt":{"type":"integer","exclusiveMinimum":0},"openFrom":{"type":"string","format":"date"},"laycan":{"type":"string","maxLength":100},"loadRate":{"type":"string","maxLength":200},"dischargeRate":{"type":"string","maxLength":200},"demurrage":{"type":"string","maxLength":200},"commission":{"type":"number","minimum":0,"maximum":10},"note":{"type":"string","maxLength":1000}},"additionalProperties":false},"message":{"type":["string","null"]},"sourceMessageId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","negotiationId","sequence","side","kind","rate","rateBasis","terms","message","sourceMessageId","createdAt"]}}},"required":["id","cargoOrderId","tonnagePositionId","matchId","status","commercialStatus","createdAt","offers"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/negotiations/{negotiationId}/offers":{"get":{"operationId":"negotiations.offers.list","summary":"Offer chain","tags":["negotiations"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"negotiationId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"negotiationId":{"type":"string","minLength":1,"description":"Opaque identifier"},"sequence":{"type":"integer"},"side":{"type":"string","enum":["ours","theirs"]},"kind":{"type":"string","enum":["offer","counter","accept","reject","subjects_lifted"]},"rate":{"type":["object","null"],"properties":{"amountCents":{"type":"integer","minimum":0,"maximum":1000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amountCents","currency"]},"rateBasis":{"type":["string","null"]},"terms":{"type":"object","properties":{"vesselName":{"type":"string","maxLength":200},"dwt":{"type":"integer","exclusiveMinimum":0},"openFrom":{"type":"string","format":"date"},"laycan":{"type":"string","maxLength":100},"loadRate":{"type":"string","maxLength":200},"dischargeRate":{"type":"string","maxLength":200},"demurrage":{"type":"string","maxLength":200},"commission":{"type":"number","minimum":0,"maximum":10},"note":{"type":"string","maxLength":1000}},"additionalProperties":false},"message":{"type":["string","null"]},"sourceMessageId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","negotiationId","sequence","side","kind","rate","rateBasis","terms","message","sourceMessageId","createdAt"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"post":{"operationId":"negotiations.offers.append","summary":"Append an offer (immutable, numbered)","tags":["negotiations"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"negotiationId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"side":{"type":"string","enum":["ours","theirs"]},"kind":{"type":"string","enum":["offer","counter","accept","reject","subjects_lifted"]},"rate":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":0,"maximum":1000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amountCents","currency"]},"rateBasis":{"type":"string","enum":["per_mt","lumpsum","per_day"]},"terms":{"type":"object","properties":{"vesselName":{"type":"string","maxLength":200},"dwt":{"type":"integer","exclusiveMinimum":0},"openFrom":{"type":"string","format":"date"},"laycan":{"type":"string","maxLength":100},"loadRate":{"type":"string","maxLength":200},"dischargeRate":{"type":"string","maxLength":200},"demurrage":{"type":"string","maxLength":200},"commission":{"type":"number","minimum":0,"maximum":10},"note":{"type":"string","maxLength":1000}},"additionalProperties":false},"message":{"type":"string","maxLength":4000},"sourceMessageId":{"type":"string","minLength":1,"description":"Opaque identifier"}},"required":["side","kind"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"negotiationId":{"type":"string","minLength":1,"description":"Opaque identifier"},"sequence":{"type":"integer"},"side":{"type":"string","enum":["ours","theirs"]},"kind":{"type":"string","enum":["offer","counter","accept","reject","subjects_lifted"]},"rate":{"type":["object","null"],"properties":{"amountCents":{"type":"integer","minimum":0,"maximum":1000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amountCents","currency"]},"rateBasis":{"type":["string","null"]},"terms":{"type":"object","properties":{"vesselName":{"type":"string","maxLength":200},"dwt":{"type":"integer","exclusiveMinimum":0},"openFrom":{"type":"string","format":"date"},"laycan":{"type":"string","maxLength":100},"loadRate":{"type":"string","maxLength":200},"dischargeRate":{"type":"string","maxLength":200},"demurrage":{"type":"string","maxLength":200},"commission":{"type":"number","minimum":0,"maximum":10},"note":{"type":"string","maxLength":1000}},"additionalProperties":false},"message":{"type":["string","null"]},"sourceMessageId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","negotiationId","sequence","side","kind","rate","rateBasis","terms","message","sourceMessageId","createdAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/negotiations/{negotiationId}/status":{"post":{"operationId":"negotiations.status","summary":"Set the commercial status","tags":["negotiations"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"negotiationId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"commercialStatus":{"type":"string","enum":["open","not_firm","firm_trading","on_subs","fixed","withdrawn","gone_in_house","backstopped","on_hold","fixed_and_failed"],"description":"The Shipfix commercial status list; status is derived from it"},"note":{"type":"string","maxLength":500}},"required":["commercialStatus"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"cargoOrderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"tonnagePositionId":{"type":"string","minLength":1,"description":"Opaque identifier"},"matchId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"status":{"type":"string","enum":["open","subjects","fixed","failed"]},"commercialStatus":{"type":"string","enum":["open","not_firm","firm_trading","on_subs","fixed","withdrawn","gone_in_house","backstopped","on_hold","fixed_and_failed"],"description":"The Shipfix commercial status list; status is derived from it"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","cargoOrderId","tonnagePositionId","matchId","status","commercialStatus","createdAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/negotiations/{negotiationId}/fix":{"post":{"operationId":"negotiations.fix","summary":"Mark fixed (commercial status fixed)","tags":["negotiations"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"negotiationId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"cargoOrderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"tonnagePositionId":{"type":"string","minLength":1,"description":"Opaque identifier"},"matchId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"status":{"type":"string","enum":["open","subjects","fixed","failed"]},"commercialStatus":{"type":"string","enum":["open","not_firm","firm_trading","on_subs","fixed","withdrawn","gone_in_house","backstopped","on_hold","fixed_and_failed"],"description":"The Shipfix commercial status list; status is derived from it"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","cargoOrderId","tonnagePositionId","matchId","status","commercialStatus","createdAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/negotiations/{negotiationId}/fail":{"post":{"operationId":"negotiations.fail","summary":"Mark failed (withdrawn, or fixed and failed after subjects)","tags":["negotiations"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"negotiationId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"cargoOrderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"tonnagePositionId":{"type":"string","minLength":1,"description":"Opaque identifier"},"matchId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"status":{"type":"string","enum":["open","subjects","fixed","failed"]},"commercialStatus":{"type":"string","enum":["open","not_firm","firm_trading","on_subs","fixed","withdrawn","gone_in_house","backstopped","on_hold","fixed_and_failed"],"description":"The Shipfix commercial status list; status is derived from it"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","cargoOrderId","tonnagePositionId","matchId","status","commercialStatus","createdAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/fixtures":{"get":{"operationId":"fixtures.list","summary":"List fixtures","tags":["fixtures"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":200},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","description":"Comma list of recap_draft, recap_sent, clean_fixed, cancelled"},"required":false,"description":"Comma list of recap_draft, recap_sent, clean_fixed, cancelled","name":"status","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":false,"description":"Opaque identifier","name":"negotiationId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"reference":{"type":"string"},"negotiationId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"cargoOrderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"tonnagePositionId":{"type":"string","minLength":1,"description":"Opaque identifier"},"status":{"type":"string","enum":["recap_draft","recap_sent","clean_fixed","cancelled"]},"mainTerms":{"type":"object","properties":{"vessel":{"type":"string"},"charterer":{"type":"string"},"owner":{"type":"string"},"cargo":{"type":"string"},"loadPort":{"type":"string"},"dischargePort":{"type":"string"},"laycan":{"type":"string"},"freight":{"type":"string"},"demurrage":{"type":"string"},"despatch":{"type":"string"},"laytime":{"type":"string"},"commission":{"type":"string"},"charterPartyForm":{"type":"string"}},"required":["vessel","charterer","owner","cargo","loadPort","dischargePort","laycan","freight","demurrage","despatch","laytime","commission","charterPartyForm"]},"recapText":{"type":"string"},"fixedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","reference","negotiationId","cargoOrderId","tonnagePositionId","status","mainTerms","recapText","fixedAt","createdAt"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"post":{"operationId":"fixtures.create","summary":"Create fixture","tags":["fixtures"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"negotiationId":{"type":"string","minLength":1,"description":"Opaque identifier"},"cargoOrderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"tonnagePositionId":{"type":"string","minLength":1,"description":"Opaque identifier"},"mainTerms":{"type":"object","properties":{"vessel":{"type":"string"},"charterer":{"type":"string"},"owner":{"type":"string"},"cargo":{"type":"string"},"loadPort":{"type":"string"},"dischargePort":{"type":"string"},"laycan":{"type":"string"},"freight":{"type":"string"},"demurrage":{"type":"string"},"despatch":{"type":"string"},"laytime":{"type":"string"},"commission":{"type":"string"},"charterPartyForm":{"type":"string"}},"required":["vessel","charterer","owner","cargo","loadPort","dischargePort","laycan","freight","demurrage","despatch","laytime","commission","charterPartyForm"]}},"required":["cargoOrderId","tonnagePositionId","mainTerms"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"reference":{"type":"string"},"negotiationId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"cargoOrderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"tonnagePositionId":{"type":"string","minLength":1,"description":"Opaque identifier"},"status":{"type":"string","enum":["recap_draft","recap_sent","clean_fixed","cancelled"]},"mainTerms":{"type":"object","properties":{"vessel":{"type":"string"},"charterer":{"type":"string"},"owner":{"type":"string"},"cargo":{"type":"string"},"loadPort":{"type":"string"},"dischargePort":{"type":"string"},"laycan":{"type":"string"},"freight":{"type":"string"},"demurrage":{"type":"string"},"despatch":{"type":"string"},"laytime":{"type":"string"},"commission":{"type":"string"},"charterPartyForm":{"type":"string"}},"required":["vessel","charterer","owner","cargo","loadPort","dischargePort","laycan","freight","demurrage","despatch","laytime","commission","charterPartyForm"]},"recapText":{"type":"string"},"fixedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","reference","negotiationId","cargoOrderId","tonnagePositionId","status","mainTerms","recapText","fixedAt","createdAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/fixtures/{fixtureId}":{"get":{"operationId":"fixtures.get","summary":"Get fixture","tags":["fixtures"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"fixtureId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"reference":{"type":"string"},"negotiationId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"cargoOrderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"tonnagePositionId":{"type":"string","minLength":1,"description":"Opaque identifier"},"status":{"type":"string","enum":["recap_draft","recap_sent","clean_fixed","cancelled"]},"mainTerms":{"type":"object","properties":{"vessel":{"type":"string"},"charterer":{"type":"string"},"owner":{"type":"string"},"cargo":{"type":"string"},"loadPort":{"type":"string"},"dischargePort":{"type":"string"},"laycan":{"type":"string"},"freight":{"type":"string"},"demurrage":{"type":"string"},"despatch":{"type":"string"},"laytime":{"type":"string"},"commission":{"type":"string"},"charterPartyForm":{"type":"string"}},"required":["vessel","charterer","owner","cargo","loadPort","dischargePort","laycan","freight","demurrage","despatch","laytime","commission","charterPartyForm"]},"recapText":{"type":"string"},"fixedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","reference","negotiationId","cargoOrderId","tonnagePositionId","status","mainTerms","recapText","fixedAt","createdAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"patch":{"operationId":"fixtures.update","summary":"Update fixture","tags":["fixtures"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"fixtureId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"mainTerms":{"type":"object","properties":{"vessel":{"type":"string"},"charterer":{"type":"string"},"owner":{"type":"string"},"cargo":{"type":"string"},"loadPort":{"type":"string"},"dischargePort":{"type":"string"},"laycan":{"type":"string"},"freight":{"type":"string"},"demurrage":{"type":"string"},"despatch":{"type":"string"},"laytime":{"type":"string"},"commission":{"type":"string"},"charterPartyForm":{"type":"string"}}},"status":{"type":"string","enum":["recap_draft","recap_sent","clean_fixed","cancelled"]}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"reference":{"type":"string"},"negotiationId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"cargoOrderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"tonnagePositionId":{"type":"string","minLength":1,"description":"Opaque identifier"},"status":{"type":"string","enum":["recap_draft","recap_sent","clean_fixed","cancelled"]},"mainTerms":{"type":"object","properties":{"vessel":{"type":"string"},"charterer":{"type":"string"},"owner":{"type":"string"},"cargo":{"type":"string"},"loadPort":{"type":"string"},"dischargePort":{"type":"string"},"laycan":{"type":"string"},"freight":{"type":"string"},"demurrage":{"type":"string"},"despatch":{"type":"string"},"laytime":{"type":"string"},"commission":{"type":"string"},"charterPartyForm":{"type":"string"}},"required":["vessel","charterer","owner","cargo","loadPort","dischargePort","laycan","freight","demurrage","despatch","laytime","commission","charterPartyForm"]},"recapText":{"type":"string"},"fixedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","reference","negotiationId","cargoOrderId","tonnagePositionId","status","mainTerms","recapText","fixedAt","createdAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/fixtures/{fixtureId}/recap":{"post":{"operationId":"fixtures.recap","summary":"Send the recap through the email frame","tags":["fixtures"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"fixtureId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"array","items":{"type":"string","format":"email"},"minItems":1,"maxItems":20}},"required":["to"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"reference":{"type":"string"},"negotiationId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"cargoOrderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"tonnagePositionId":{"type":"string","minLength":1,"description":"Opaque identifier"},"status":{"type":"string","enum":["recap_draft","recap_sent","clean_fixed","cancelled"]},"mainTerms":{"type":"object","properties":{"vessel":{"type":"string"},"charterer":{"type":"string"},"owner":{"type":"string"},"cargo":{"type":"string"},"loadPort":{"type":"string"},"dischargePort":{"type":"string"},"laycan":{"type":"string"},"freight":{"type":"string"},"demurrage":{"type":"string"},"despatch":{"type":"string"},"laytime":{"type":"string"},"commission":{"type":"string"},"charterPartyForm":{"type":"string"}},"required":["vessel","charterer","owner","cargo","loadPort","dischargePort","laycan","freight","demurrage","despatch","laytime","commission","charterPartyForm"]},"recapText":{"type":"string"},"fixedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","reference","negotiationId","cargoOrderId","tonnagePositionId","status","mainTerms","recapText","fixedAt","createdAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/fixtures/{fixtureId}/recap.txt":{"get":{"operationId":"fixtures.recapText","summary":"Recap as plain text","tags":["fixtures"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"fixtureId","in":"path"}],"responses":{"200":{"description":"Success"},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/fixtures/{fixtureId}/versions":{"get":{"operationId":"fixtures.versions","summary":"Recap versions, oldest first","tags":["fixtures"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"fixtureId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"version":{"type":"integer"},"mainTerms":{"type":"object","properties":{"vessel":{"type":"string"},"charterer":{"type":"string"},"owner":{"type":"string"},"cargo":{"type":"string"},"loadPort":{"type":"string"},"dischargePort":{"type":"string"},"laycan":{"type":"string"},"freight":{"type":"string"},"demurrage":{"type":"string"},"despatch":{"type":"string"},"laytime":{"type":"string"},"commission":{"type":"string"},"charterPartyForm":{"type":"string"}},"required":["vessel","charterer","owner","cargo","loadPort","dischargePort","laycan","freight","demurrage","despatch","laytime","commission","charterPartyForm"]},"recapText":{"type":"string"},"sentTo":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["version","mainTerms","recapText","sentTo","createdAt"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/negotiations/{negotiationId}/fixture-draft":{"get":{"operationId":"fixtures.draft","summary":"The main terms a negotiation on subjects or fixed settles","tags":["fixtures"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"negotiationId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"vessel":{"type":"string"},"charterer":{"type":"string"},"owner":{"type":"string"},"cargo":{"type":"string"},"loadPort":{"type":"string"},"dischargePort":{"type":"string"},"laycan":{"type":"string"},"freight":{"type":"string"},"demurrage":{"type":"string"},"despatch":{"type":"string"},"laytime":{"type":"string"},"commission":{"type":"string"},"charterPartyForm":{"type":"string"}},"required":["vessel","charterer","owner","cargo","loadPort","dischargePort","laycan","freight","demurrage","despatch","laytime","commission","charterPartyForm"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/tags":{"get":{"operationId":"tags.list","summary":"List tags","tags":["tags"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":200},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"colour":{"type":"string"},"kind":{"type":"string","enum":["voyage","vessel","port","counterparty","custom"]}},"required":["id","name","colour","kind"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"post":{"operationId":"tags.create","summary":"Create tag","tags":["tags"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":40},"colour":{"type":"string","pattern":"^#[0-9a-f]{6}$","default":"#64748b"},"kind":{"type":"string","enum":["voyage","vessel","port","counterparty","custom"],"default":"custom"}},"required":["name"],"additionalProperties":false}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"colour":{"type":"string"},"kind":{"type":"string","enum":["voyage","vessel","port","counterparty","custom"]}},"required":["id","name","colour","kind"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/tags/{tagId}":{"get":{"operationId":"tags.get","summary":"Get tag","tags":["tags"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"tagId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"colour":{"type":"string"},"kind":{"type":"string","enum":["voyage","vessel","port","counterparty","custom"]}},"required":["id","name","colour","kind"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"patch":{"operationId":"tags.update","summary":"Update tag","tags":["tags"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"tagId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":40},"colour":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"kind":{"type":"string","enum":["voyage","vessel","port","counterparty","custom"]}},"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"colour":{"type":"string"},"kind":{"type":"string","enum":["voyage","vessel","port","counterparty","custom"]}},"required":["id","name","colour","kind"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"delete":{"operationId":"tags.delete","summary":"Delete a tag","tags":["tags"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"tagId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/rules":{"get":{"operationId":"rules.list","summary":"List rules","tags":["rules"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":200},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"enabled":{"type":"boolean"},"conditions":{"type":"object","additionalProperties":{}},"actions":{"type":"object","additionalProperties":{}},"order":{"type":"integer"}},"required":["id","name","enabled","conditions","actions","order"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"post":{"operationId":"rules.create","summary":"Create rule","tags":["rules"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"enabled":{"type":"boolean","default":true},"conditions":{"type":"object","properties":{"fromDomain":{"type":"string","minLength":1,"maxLength":200},"fromAddress":{"type":"string","minLength":1,"maxLength":200},"toAddress":{"type":"string","minLength":1,"maxLength":200},"subjectContains":{"type":"string","minLength":1,"maxLength":200},"bodyMatches":{"type":"string"},"hasAttachment":{"type":"boolean"}},"additionalProperties":false},"actions":{"type":"object","properties":{"addTag":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"maxItems":10},"setKind":{"type":"string","enum":["cargo","tonnage","ignore"]},"assignTo":{"type":"string","minLength":1,"maxLength":64},"skipParse":{"type":"boolean"}},"additionalProperties":false}},"required":["name","conditions","actions"],"additionalProperties":false}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"enabled":{"type":"boolean"},"conditions":{"type":"object","additionalProperties":{}},"actions":{"type":"object","additionalProperties":{}},"order":{"type":"integer"}},"required":["id","name","enabled","conditions","actions","order"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/rules/{ruleId}":{"get":{"operationId":"rules.get","summary":"Get rule","tags":["rules"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"ruleId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"enabled":{"type":"boolean"},"conditions":{"type":"object","additionalProperties":{}},"actions":{"type":"object","additionalProperties":{}},"order":{"type":"integer"}},"required":["id","name","enabled","conditions","actions","order"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"patch":{"operationId":"rules.update","summary":"Update rule","tags":["rules"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"ruleId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"enabled":{"type":"boolean"},"conditions":{"type":"object","properties":{"fromDomain":{"type":"string","minLength":1,"maxLength":200},"fromAddress":{"type":"string","minLength":1,"maxLength":200},"toAddress":{"type":"string","minLength":1,"maxLength":200},"subjectContains":{"type":"string","minLength":1,"maxLength":200},"bodyMatches":{"type":"string"},"hasAttachment":{"type":"boolean"}},"additionalProperties":false},"actions":{"type":"object","properties":{"addTag":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"maxItems":10},"setKind":{"type":"string","enum":["cargo","tonnage","ignore"]},"assignTo":{"type":"string","minLength":1,"maxLength":64},"skipParse":{"type":"boolean"}},"additionalProperties":false},"order":{"type":"integer","minimum":0,"maximum":50}},"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"enabled":{"type":"boolean"},"conditions":{"type":"object","additionalProperties":{}},"actions":{"type":"object","additionalProperties":{}},"order":{"type":"integer"}},"required":["id","name","enabled","conditions","actions","order"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"delete":{"operationId":"rules.delete","summary":"Delete a rule","tags":["rules"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"ruleId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/companies":{"get":{"operationId":"companies.list","summary":"List companies","tags":["companies"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":200},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string"},"required":false,"name":"q","in":"query"},{"schema":{"type":"string"},"required":false,"name":"type","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"type":{"type":"string"},"country":{"type":["string","null"]},"website":{"type":["string","null"]},"domains":{"type":"array","items":{"type":"string"}}},"required":["id","name","type","country","website","domains"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"post":{"operationId":"companies.create","summary":"Create company","tags":["companies"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"},"country":{"type":["string","null"]},"website":{"type":["string","null"]},"domains":{"type":"array","items":{"type":"string"}}},"required":["name","type","country","website","domains"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"type":{"type":"string"},"country":{"type":["string","null"]},"website":{"type":["string","null"]},"domains":{"type":"array","items":{"type":"string"}}},"required":["id","name","type","country","website","domains"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/companies/{companyId}":{"get":{"operationId":"companies.get","summary":"Get company","tags":["companies"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"companyId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"type":{"type":"string"},"country":{"type":["string","null"]},"website":{"type":["string","null"]},"domains":{"type":"array","items":{"type":"string"}}},"required":["id","name","type","country","website","domains"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"patch":{"operationId":"companies.update","summary":"Update company","tags":["companies"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"companyId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"},"country":{"type":["string","null"]},"website":{"type":["string","null"]},"domains":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"type":{"type":"string"},"country":{"type":["string","null"]},"website":{"type":["string","null"]},"domains":{"type":"array","items":{"type":"string"}}},"required":["id","name","type","country","website","domains"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/contacts":{"get":{"operationId":"contacts.list","summary":"List contacts","tags":["contacts"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":200},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string"},"required":false,"name":"q","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":false,"description":"Opaque identifier","name":"companyId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"companyId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"role":{"type":["string","null"]}},"required":["id","companyId","name","email","phone","role"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"post":{"operationId":"contacts.create","summary":"Create contact","tags":["contacts"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"companyId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"role":{"type":["string","null"]}},"required":["companyId","name","email","phone","role"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"companyId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"role":{"type":["string","null"]}},"required":["id","companyId","name","email","phone","role"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/contacts/{contactId}":{"get":{"operationId":"contacts.get","summary":"Get contact","tags":["contacts"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"contactId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"companyId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"role":{"type":["string","null"]}},"required":["id","companyId","name","email","phone","role"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"patch":{"operationId":"contacts.update","summary":"Update contact","tags":["contacts"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"contactId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"companyId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"role":{"type":["string","null"]}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"companyId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"role":{"type":["string","null"]}},"required":["id","companyId","name","email","phone","role"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/watchlists":{"get":{"operationId":"watchlists.list","summary":"List watchlists","tags":["watchlists"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":200},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"kind":{"type":"string","enum":["cargo","tonnage","vessel","port","company"]},"criteria":{"type":"object","additionalProperties":{},"description":"Per kind: cargo {commodity, loadPort, dischargePort, minQuantityMt, maxQuantityMt, laycanFrom, laycanTo}, tonnage {vesselName, openPort, minDwt, maxDwt, openFrom, openTo}, vessel {imo, name}, port {port}, company {domain, companyId}; at least one"},"notify":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","name","kind","criteria","notify","createdAt"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"post":{"operationId":"watchlists.create","summary":"Create watchlist","tags":["watchlists"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"kind":{"type":"string","enum":["cargo","tonnage","vessel","port","company"]},"criteria":{"type":"object","additionalProperties":{},"description":"Per kind: cargo {commodity, loadPort, dischargePort, minQuantityMt, maxQuantityMt, laycanFrom, laycanTo}, tonnage {vesselName, openPort, minDwt, maxDwt, openFrom, openTo}, vessel {imo, name}, port {port}, company {domain, companyId}; at least one"},"notify":{"type":"boolean"}},"required":["name","kind","criteria"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"kind":{"type":"string","enum":["cargo","tonnage","vessel","port","company"]},"criteria":{"type":"object","additionalProperties":{},"description":"Per kind: cargo {commodity, loadPort, dischargePort, minQuantityMt, maxQuantityMt, laycanFrom, laycanTo}, tonnage {vesselName, openPort, minDwt, maxDwt, openFrom, openTo}, vessel {imo, name}, port {port}, company {domain, companyId}; at least one"},"notify":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","name","kind","criteria","notify","createdAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/watchlists/{watchlistId}":{"get":{"operationId":"watchlists.get","summary":"Get watchlist","tags":["watchlists"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"watchlistId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"kind":{"type":"string","enum":["cargo","tonnage","vessel","port","company"]},"criteria":{"type":"object","additionalProperties":{},"description":"Per kind: cargo {commodity, loadPort, dischargePort, minQuantityMt, maxQuantityMt, laycanFrom, laycanTo}, tonnage {vesselName, openPort, minDwt, maxDwt, openFrom, openTo}, vessel {imo, name}, port {port}, company {domain, companyId}; at least one"},"notify":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","name","kind","criteria","notify","createdAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"patch":{"operationId":"watchlists.update","summary":"Update watchlist","tags":["watchlists"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"watchlistId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"kind":{"type":"string","enum":["cargo","tonnage","vessel","port","company"]},"criteria":{"type":"object","additionalProperties":{},"description":"Per kind: cargo {commodity, loadPort, dischargePort, minQuantityMt, maxQuantityMt, laycanFrom, laycanTo}, tonnage {vesselName, openPort, minDwt, maxDwt, openFrom, openTo}, vessel {imo, name}, port {port}, company {domain, companyId}; at least one"},"notify":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"kind":{"type":"string","enum":["cargo","tonnage","vessel","port","company"]},"criteria":{"type":"object","additionalProperties":{},"description":"Per kind: cargo {commodity, loadPort, dischargePort, minQuantityMt, maxQuantityMt, laycanFrom, laycanTo}, tonnage {vesselName, openPort, minDwt, maxDwt, openFrom, openTo}, vessel {imo, name}, port {port}, company {domain, companyId}; at least one"},"notify":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","name","kind","criteria","notify","createdAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"delete":{"operationId":"watchlists.delete","summary":"Delete a watchlist","tags":["watchlists"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"watchlistId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/saved-views":{"get":{"operationId":"savedViews.list","summary":"List savedViews","tags":["savedViews"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":200},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"screen":{"type":"string"},"name":{"type":"string"},"filters":{"type":"object","additionalProperties":{}},"sort":{"type":["object","null"],"additionalProperties":{}},"shared":{"type":"boolean"},"mine":{"type":"boolean"}},"required":["id","screen","name","filters","sort","shared","mine"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"post":{"operationId":"savedViews.create","summary":"Create savedView","tags":["savedViews"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"screen":{"type":"string","enum":["cargo","tonnage"]},"filters":{"type":"object","properties":{"status":{"type":"array","items":{"type":"string","enum":["candidate","open","working","fixed","withdrawn","expired"]},"minItems":1,"maxItems":6},"q":{"type":"string","minLength":1,"maxLength":100},"port":{"type":"string","pattern":"^[A-Z]{2}[A-Z2-9]{3}$"},"minConfidence":{"type":["integer","null"],"minimum":0,"maximum":100}},"additionalProperties":false},"name":{"type":"string","minLength":1,"maxLength":60},"sort":{"type":["object","null"],"properties":{"key":{"type":"string","enum":["reference","status","confidence","updated"]},"dir":{"type":"string","enum":["asc","desc"]}},"default":null,"required":["key","dir"],"additionalProperties":false},"shared":{"type":"boolean","default":false}},"required":["screen","filters","name"],"additionalProperties":false},{"type":"object","properties":{"screen":{"type":"string","enum":["trade_cargo"]},"filters":{"type":"object","properties":{"mine":{"type":"boolean"},"q":{"type":"string","minLength":1,"maxLength":100},"pol":{"type":"string","pattern":"^[A-Z]{2}[A-Z2-9]{3}$"},"pod":{"type":"string","pattern":"^[A-Z]{2}[A-Z2-9]{3}$"},"laycanFrom":{"type":"string","format":"date"},"laycanTo":{"type":"string","format":"date"},"qtyMin":{"type":"integer","minimum":0,"maximum":10000000},"qtyMax":{"type":"integer","minimum":0,"maximum":10000000},"showExpired":{"type":"boolean"}},"additionalProperties":false},"name":{"type":"string","minLength":1,"maxLength":60},"sort":{"type":["object","null"],"properties":{"key":{"type":"string","enum":["reference","status","confidence","updated"]},"dir":{"type":"string","enum":["asc","desc"]}},"default":null,"required":["key","dir"],"additionalProperties":false},"shared":{"type":"boolean","default":false}},"required":["screen","filters","name"],"additionalProperties":false},{"type":"object","properties":{"screen":{"type":"string","enum":["trade_tonnage"]},"filters":{"type":"object","properties":{"mine":{"type":"boolean"},"area":{"anyOf":[{"type":"string","enum":["gulf","gulf_of_oman","red_sea","caspian","indian_subcontinent","east_africa","black_sea","med","far_east","other"]},{"type":"string","pattern":"^[A-Z]{2}[A-Z2-9]{3}$"}]},"openFrom":{"type":"string","format":"date"},"openTo":{"type":"string","format":"date"},"type":{"type":"string","pattern":"^[a-z_]{2,40}$"},"dwtMin":{"type":"integer","minimum":0,"maximum":10000000},"dwtMax":{"type":"integer","minimum":0,"maximum":10000000},"gear":{"type":"string","enum":["geared","gearless"]},"showExpired":{"type":"boolean"}},"additionalProperties":false},"name":{"type":"string","minLength":1,"maxLength":60},"sort":{"type":["object","null"],"properties":{"key":{"type":"string","enum":["reference","status","confidence","updated"]},"dir":{"type":"string","enum":["asc","desc"]}},"default":null,"required":["key","dir"],"additionalProperties":false},"shared":{"type":"boolean","default":false}},"required":["screen","filters","name"],"additionalProperties":false}]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"screen":{"type":"string"},"name":{"type":"string"},"filters":{"type":"object","additionalProperties":{}},"sort":{"type":["object","null"],"additionalProperties":{}},"shared":{"type":"boolean"},"mine":{"type":"boolean"}},"required":["id","screen","name","filters","sort","shared","mine"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/saved-views/{savedViewId}":{"get":{"operationId":"savedViews.get","summary":"Get savedView","tags":["savedViews"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"savedViewId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"screen":{"type":"string"},"name":{"type":"string"},"filters":{"type":"object","additionalProperties":{}},"sort":{"type":["object","null"],"additionalProperties":{}},"shared":{"type":"boolean"},"mine":{"type":"boolean"}},"required":["id","screen","name","filters","sort","shared","mine"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"patch":{"operationId":"savedViews.update","summary":"Update savedView","tags":["savedViews"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"savedViewId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"filters":{"type":"object","additionalProperties":{}},"sort":{"type":["object","null"],"properties":{"key":{"type":"string","enum":["reference","status","confidence","updated"]},"dir":{"type":"string","enum":["asc","desc"]}},"required":["key","dir"],"additionalProperties":false},"shared":{"type":"boolean"}},"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"screen":{"type":"string"},"name":{"type":"string"},"filters":{"type":"object","additionalProperties":{}},"sort":{"type":["object","null"],"additionalProperties":{}},"shared":{"type":"boolean"},"mine":{"type":"boolean"}},"required":["id","screen","name","filters","sort","shared","mine"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"delete":{"operationId":"savedViews.delete","summary":"Delete a saved view","tags":["savedViews"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"savedViewId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/notifications":{"get":{"operationId":"notifications.list","summary":"The caller's notifications, newest first","tags":["notifications"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":200},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"unread","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Hits of one watchlist"},"required":false,"description":"Hits of one watchlist","name":"watchlistId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"kind":{"type":"string"},"title":{"type":"string"},"body":{"type":["string","null"]},"href":{"type":["string","null"]},"readAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","kind","title","body","href","readAt","createdAt"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/notifications/preferences":{"get":{"operationId":"notifications.preferences","summary":"What reaches the caller per deal event kind","tags":["notifications"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"events":{"type":"object","properties":{"match.suggested":{"type":"string","enum":["off","app","email"]},"offer.appended":{"type":"string","enum":["off","app","email"]},"tender_bid.received":{"type":"string","enum":["off","app","email"]},"fixture.recap_sent":{"type":"string","enum":["off","app","email"]},"task.assigned":{"type":"string","enum":["off","app","email"]},"task.due":{"type":"string","enum":["off","app","email"]}},"required":["match.suggested","offer.appended","tender_bid.received","fixture.recap_sent","task.assigned","task.due"]}},"required":["events"],"description":"One channel per deal event kind: off, app (the desk) or email (the desk and the frame)"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"patch":{"operationId":"notifications.updatePreferences","summary":"Change the caller's channels; unknown kinds and channels are refused","tags":["notifications"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"object","properties":{"match.suggested":{"type":"string","enum":["off","app","email"]},"offer.appended":{"type":"string","enum":["off","app","email"]},"tender_bid.received":{"type":"string","enum":["off","app","email"]},"fixture.recap_sent":{"type":"string","enum":["off","app","email"]},"task.assigned":{"type":"string","enum":["off","app","email"]},"task.due":{"type":"string","enum":["off","app","email"]}}}},"required":["events"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"events":{"type":"object","properties":{"match.suggested":{"type":"string","enum":["off","app","email"]},"offer.appended":{"type":"string","enum":["off","app","email"]},"tender_bid.received":{"type":"string","enum":["off","app","email"]},"fixture.recap_sent":{"type":"string","enum":["off","app","email"]},"task.assigned":{"type":"string","enum":["off","app","email"]},"task.due":{"type":"string","enum":["off","app","email"]}},"required":["match.suggested","offer.appended","tender_bid.received","fixture.recap_sent","task.assigned","task.due"]}},"required":["events"],"description":"One channel per deal event kind: off, app (the desk) or email (the desk and the frame)"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/notifications/{notificationId}/read":{"post":{"operationId":"notifications.read","summary":"Mark read","tags":["notifications"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"notificationId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/notifications/read-all":{"post":{"operationId":"notifications.readAll","summary":"Mark all read","tags":["notifications"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/assist":{"get":{"operationId":"assist.status","summary":"Whether Freight Assist is on for the organisation, and this month's allowance","tags":["assist"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"enabled":{"type":"boolean"},"provider":{"type":"string","enum":["anthropic","fake","none"]},"usage":{"type":["object","null"],"properties":{"used":{"type":"integer"},"allowance":{"type":"integer"},"remaining":{"type":"integer"},"resetsAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["used","allowance","remaining","resetsAt"]}},"required":["enabled","provider","usage"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"post":{"operationId":"assist.ask","summary":"A Freight Assist draft for the screen that is open; nothing is sent or changed","tags":["assist"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","enum":["summarise","explain_match","draft_counter","draft_reply","check_recap","write_recap","morning_brief","follow_ups","draft_chaser","chat"]},"context":{"type":"object","properties":{"kind":{"type":"string","enum":["desk","cargo","tonnage","match","negotiation","tender","fixture"]},"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}},"required":["kind"],"additionalProperties":false},"question":{"type":"string","maxLength":1000},"locale":{"type":"string","enum":["en","fa"],"default":"en"}},"required":["action","context"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"text":{"type":"string"},"source":{"type":"string","enum":["model","rules","demo"]},"usage":{"type":"object","properties":{"used":{"type":"integer"},"allowance":{"type":"integer"},"remaining":{"type":"integer"},"resetsAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["used","allowance","remaining","resetsAt"]}},"required":["text","source","usage"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/assist/skills":{"get":{"operationId":"assist.skills","summary":"The Freight Assist skills this member may use, each with its department, the screens it fits and whether rules or the model answer it (ADR-0015)","tags":["assist"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string","enum":["summarise","explain_match","draft_counter","draft_reply","check_recap","write_recap","morning_brief","follow_ups","draft_chaser","chat"]},"department":{"type":"string","enum":["sales","operations","support","administration","accounting"]},"contexts":{"type":"array","items":{"type":"string","enum":["desk","cargo","tonnage","match","negotiation","tender","fixture"]}},"answeredBy":{"type":"string","enum":["rules","model"]}},"required":["action","department","contexts","answeredBy"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/assist/sales":{"get":{"operationId":"assist.sales","summary":"The sales lists behind the morning brief and the follow ups: counts of the last 24 hours, the best new matches, negotiations waiting for us, our offers unanswered for two days, tenders closing within 48 hours (rules only, not metered; task 25)","tags":["assist"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"organisation":{"type":"string"},"circulars":{"type":"integer"},"newCargo":{"type":"integer"},"newTonnage":{"type":"integer"},"matches":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"score":{"type":"integer"},"cargo":{"type":"object","properties":{"reference":{"type":"string"},"title":{"type":["string","null"]},"route":{"type":["string","null"]},"window":{"type":["string","null"]}},"required":["reference","title","route","window"]},"tonnage":{"type":"object","properties":{"reference":{"type":"string"},"title":{"type":["string","null"]},"route":{"type":["string","null"]},"window":{"type":["string","null"]}},"required":["reference","title","route","window"]}},"required":["id","score","cargo","tonnage"]}},"awaiting":{"type":"array","items":{"type":"object","properties":{"negotiationId":{"type":"string","minLength":1,"description":"Opaque identifier"},"cargo":{"type":"object","properties":{"reference":{"type":"string"},"title":{"type":["string","null"]},"route":{"type":["string","null"]},"window":{"type":["string","null"]}},"required":["reference","title","route","window"]},"tonnage":{"type":"object","properties":{"reference":{"type":"string"},"title":{"type":["string","null"]},"route":{"type":["string","null"]},"window":{"type":["string","null"]}},"required":["reference","title","route","window"]},"lastOffer":{"type":"object","properties":{"sequence":{"type":"integer"},"side":{"type":"string"},"summary":{"type":"string"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["sequence","side","summary","createdAt"]}},"required":["negotiationId","cargo","tonnage","lastOffer"]}},"stale":{"type":"array","items":{"type":"object","properties":{"negotiationId":{"type":"string","minLength":1,"description":"Opaque identifier"},"cargo":{"type":"object","properties":{"reference":{"type":"string"},"title":{"type":["string","null"]},"route":{"type":["string","null"]},"window":{"type":["string","null"]}},"required":["reference","title","route","window"]},"tonnage":{"type":"object","properties":{"reference":{"type":"string"},"title":{"type":["string","null"]},"route":{"type":["string","null"]},"window":{"type":["string","null"]}},"required":["reference","title","route","window"]},"lastOffer":{"type":"object","properties":{"sequence":{"type":"integer"},"side":{"type":"string"},"summary":{"type":"string"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["sequence","side","summary","createdAt"]}},"required":["negotiationId","cargo","tonnage","lastOffer"]}},"tenders":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"closesAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"cargo":{"type":"object","properties":{"reference":{"type":"string"},"title":{"type":["string","null"]},"route":{"type":["string","null"]},"window":{"type":["string","null"]}},"required":["reference","title","route","window"]}},"required":["id","closesAt","cargo"]}}},"required":["organisation","circulars","newCargo","newTonnage","matches","awaiting","stale","tenders"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/assist/addon":{"post":{"operationId":"assist.addon","summary":"Ask Blue Sea Line to turn Freight Assist on","tags":["assist"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string","maxLength":1000},"locale":{"type":"string","enum":["en","fa"],"default":"en"}},"additionalProperties":false}}}},"responses":{"202":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"sent":{"type":"boolean"}},"required":["sent"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/plan":{"get":{"operationId":"plan.get","summary":"The package, its limits and how much of each is used; no prices (payment lives outside the desk)","tags":["organisations"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"plan":{"type":"string","enum":["deck","coaster","supramax","capesize","enterprise","assist"]},"limits":{"type":"object","properties":{"seats":{"type":["integer","null"]},"mailboxes":{"type":["integer","null"]},"circularsPerMonth":{"type":["integer","null"]},"liveNegotiations":{"type":["integer","null"]},"tendersPerMonth":{"type":["integer","null"]},"watchlists":{"type":["integer","null"]},"assistPerMonth":{"type":["integer","null"]},"apiCallsPerMonth":{"type":["integer","null"]}},"required":["seats","mailboxes","circularsPerMonth","liveNegotiations","tendersPerMonth","watchlists","assistPerMonth","apiCallsPerMonth"]},"features":{"type":"object","properties":{"api":{"type":"string","enum":["none","read","full"]},"matching":{"type":"string","enum":["view","top5","full","custom"]},"recapTemplates":{"type":"boolean"},"portal":{"type":["string","null"],"enum":["navigator","commodore"]},"support":{"type":"string","enum":["community","email","priority","named"]},"desk":{"type":"boolean","description":"The desk screens; false on the Assist plan (ADR-0015)"}},"required":["api","matching","recapTemplates","portal","support","desk"]},"usage":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["seats","mailboxes","circularsPerMonth","liveNegotiations","tendersPerMonth","watchlists","assistPerMonth","apiCallsPerMonth"]},"used":{"type":["integer","null"]},"limit":{"type":["integer","null"]}},"required":["key","used","limit"]}}},"required":["plan","limits","features","usage"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/assist/broker":{"post":{"operationId":"assist.broker","summary":"Ask a Blue Sea Line broker to step in on the screen that is open","tags":["assist"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"context":{"type":"object","properties":{"kind":{"type":"string","enum":["desk","cargo","tonnage","match","negotiation","tender","fixture"]},"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}},"required":["kind"],"additionalProperties":false},"note":{"type":"string","maxLength":1000},"locale":{"type":"string","enum":["en","fa"],"default":"en"}},"required":["context"],"additionalProperties":false}}}},"responses":{"202":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"sent":{"type":"boolean"}},"required":["sent"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/audit-log":{"get":{"operationId":"auditLog.list","summary":"Audit log","tags":["platform"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":200},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"action":{"type":"string"},"entityType":{"type":"string"},"entityId":{"type":"string"},"principalKind":{"type":"string"},"actorUserId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"ip":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","action","entityType","entityId","principalKind","actorUserId","ip","createdAt"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/ports":{"get":{"operationId":"ports.list","summary":"Search ports","tags":["reference"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"q","in":"query"},{"schema":{"type":"string","minLength":2,"maxLength":2},"required":false,"name":"country","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"unlocode":{"type":"string"},"name":{"type":"string"},"country":{"type":"string"},"lat":{"type":["number","null"]},"lon":{"type":["number","null"]},"aliases":{"type":"array","items":{"type":"string"}}},"required":["id","unlocode","name","country","lat","lon","aliases"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/vessels":{"get":{"operationId":"vessels.list","summary":"Search vessels","tags":["reference"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"q","in":"query"},{"schema":{"type":"string"},"required":false,"name":"imo","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"imo":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"dwt":{"type":["integer","null"]},"built":{"type":["integer","null"]},"flag":{"type":["string","null"]},"gear":{"type":["string","null"]}},"required":["id","imo","name","type","dwt","built","flag","gear"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/vessels/{imo}":{"get":{"operationId":"vessels.get","summary":"Vessel by IMO","tags":["reference"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","pattern":"^\\d{7}$"},"required":true,"name":"imo","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"imo":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"dwt":{"type":["integer","null"]},"built":{"type":["integer","null"]},"flag":{"type":["string","null"]},"gear":{"type":["string","null"]}},"required":["id","imo","name","type","dwt","built","flag","gear"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/dashboard":{"get":{"operationId":"dashboard.get","summary":"The owner's dashboard: circulars, live negotiations by stage, tenders closing, fixtures, freight booked, conversion and top lanes (owners and admins)","tags":["organisations"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"circulars":{"type":"object","properties":{"last7":{"type":"integer"},"last30":{"type":"integer"}},"required":["last7","last30"]},"negotiations":{"type":"object","properties":{"total":{"type":"integer"},"stages":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string"},"count":{"type":"integer"}},"required":["status","count"]}}},"required":["total","stages"]},"tenders":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"status":{"type":"string"},"closesAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"title":{"type":["string","null"]}},"required":["id","status","closesAt","title"]}},"fixtures":{"type":"object","properties":{"thisMonth":{"type":"integer"},"lastMonth":{"type":"integer"},"change":{"type":"integer"}},"required":["thisMonth","lastMonth","change"]},"freight":{"type":"object","properties":{"byCurrency":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"cents":{"type":"integer"}},"required":["currency","cents"]}},"unpriced":{"type":"integer"}},"required":["byCurrency","unpriced"]},"conversion":{"type":"object","properties":{"matchToOffer":{"type":"object","properties":{"from":{"type":"integer"},"to":{"type":"integer"},"pct":{"type":["integer","null"]}},"required":["from","to","pct"]},"offerToFixture":{"type":"object","properties":{"from":{"type":"integer"},"to":{"type":"integer"},"pct":{"type":["integer","null"]}},"required":["from","to","pct"]}},"required":["matchToOffer","offerToFixture"]},"lanes":{"type":"array","items":{"type":"object","properties":{"lane":{"type":"string"},"count":{"type":"integer"}},"required":["lane","count"]}}},"required":["circulars","negotiations","tenders","fixtures","freight","conversion","lanes"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/fixtures/{fixtureId}/documents":{"get":{"operationId":"fixtures.documents.list","summary":"Every drafted document version of a fixture, newest first","tags":["fixtures"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"fixtureId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"fixtureId":{"type":"string","minLength":1,"description":"Opaque identifier"},"kind":{"type":"string","enum":["bill_of_lading","notice_of_readiness","freight_invoice"]},"version":{"type":"integer"},"number":{"type":["string","null"],"description":"The invoice number; null on the other documents"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","fixtureId","kind","version","number","createdAt"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"post":{"operationId":"fixtures.documents.draft","summary":"Draft the bill of lading, notice of readiness and freight invoice from a recap that was sent or a clean fixture","tags":["fixtures"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"fixtureId","in":"path"}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"fixtureId":{"type":"string","minLength":1,"description":"Opaque identifier"},"kind":{"type":"string","enum":["bill_of_lading","notice_of_readiness","freight_invoice"]},"version":{"type":"integer"},"number":{"type":["string","null"],"description":"The invoice number; null on the other documents"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","fixtureId","kind","version","number","createdAt"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/documents/{documentId}":{"get":{"operationId":"documents.get","summary":"One drafted document with its content; contact details only on a clean fixture","tags":["fixtures"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"documentId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"fixtureId":{"type":"string","minLength":1,"description":"Opaque identifier"},"kind":{"type":"string","enum":["bill_of_lading","notice_of_readiness","freight_invoice"]},"version":{"type":"integer"},"number":{"type":["string","null"],"description":"The invoice number; null on the other documents"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"fixtureReference":{"type":"string"},"content":{"type":"object","properties":{"kind":{"type":"string","enum":["bill_of_lading","notice_of_readiness","freight_invoice"]},"status":{"type":"string","enum":["DRAFT"]},"reference":{"type":"string"},"number":{"type":["string","null"]},"date":{"type":"string"},"sections":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"rows":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}},"required":["key","value"]}}},"required":["key","rows"]}},"lines":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["freight","commission"]},"quantity":{"type":["number","null"]},"unitCents":{"type":["integer","null"]},"amountCents":{"type":"integer"}},"required":["key","quantity","unitCents","amountCents"]}},"totals":{"type":["object","null"],"properties":{"currency":{"type":"string"},"grossCents":{"type":"integer"},"commissionCents":{"type":"integer"},"netCents":{"type":"integer"}},"required":["currency","grossCents","commissionCents","netCents"]},"notes":{"type":"array","items":{"type":"string"}}},"required":["kind","status","reference","number","date","sections","lines","totals","notes"]}},"required":["id","fixtureId","kind","version","number","createdAt","fixtureReference","content"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/document-settings":{"get":{"operationId":"documentSettings.get","summary":"The organisation's invoice prefix","tags":["organisations"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"invoicePrefix":{"type":"string","pattern":"^[A-Z0-9]{1,8}$"}},"required":["invoicePrefix"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"post":{"operationId":"documentSettings.update","summary":"Set the invoice prefix (one to eight letters or digits)","tags":["organisations"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"invoicePrefix":{"type":"string","pattern":"^[A-Z0-9]{1,8}$"}},"required":["invoicePrefix"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"invoicePrefix":{"type":"string","pattern":"^[A-Z0-9]{1,8}$"}},"required":["invoicePrefix"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/vessels/{imo}":{"get":{"operationId":"vessels.profile","summary":"One ship as this organisation knows it: particulars, sanctions and port state, positions and employment","tags":["reference"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","pattern":"^\\d{7}$"},"required":true,"name":"imo","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"vessel":{"type":"object","additionalProperties":{},"description":"The reference particulars, as GET /vessels/{imo}"},"compliance":{"type":["object","null"],"properties":{"sanctionsStatus":{"type":"string","enum":["clear","flagged","unknown"]},"sanctionsNote":{"type":["string","null"]},"pscDetentions":{"type":"integer"},"lastDetentionAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"lastDetentionPort":{"type":["string","null"]},"pscNote":{"type":["string","null"]},"doNotFix":{"type":"boolean"},"source":{"type":"string"},"checkedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["sanctionsStatus","sanctionsNote","pscDetentions","lastDetentionAt","lastDetentionPort","pscNote","doNotFix","source","checkedAt"]},"verdict":{"type":"object","properties":{"level":{"type":"string","enum":["unknown","clear","caution","blocked"]},"reasons":{"type":"array","items":{"type":"string"}}},"required":["level","reasons"]},"source":{"type":"string","description":"Where compliance facts come from; manual until a provider is set"},"positions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"reference":{"type":"string"},"status":{"type":"string"},"visibility":{"type":"string"},"where":{"type":["string","null"]},"window":{"type":["string","null"]},"fromInbox":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","reference","status","visibility","where","window","fromInbox","createdAt"]}},"employment":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"reference":{"type":"string"},"status":{"type":"string"},"cargo":{"type":"string"},"route":{"type":"string"},"laycan":{"type":"string"},"freight":{"type":"string"},"fixedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","reference","status","cargo","route","laycan","freight","fixedAt","createdAt"]}}},"required":["vessel","compliance","verdict","source","positions","employment"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/vessels/{imo}/compliance":{"post":{"operationId":"vessels.compliance","summary":"Record the sanctions and port state check for a ship, by hand","tags":["reference"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","pattern":"^\\d{7}$"},"required":true,"name":"imo","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"sanctionsStatus":{"type":"string","enum":["clear","flagged","unknown"]},"sanctionsNote":{"type":"string","maxLength":1000},"pscDetentions":{"type":"integer","minimum":0,"maximum":99},"lastDetentionAt":{"type":["string","null"],"format":"date"},"lastDetentionPort":{"type":["string","null"],"maxLength":100},"pscNote":{"type":"string","maxLength":1000},"doNotFix":{"type":"boolean"}},"required":["sanctionsStatus"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"sanctionsStatus":{"type":"string","enum":["clear","flagged","unknown"]},"sanctionsNote":{"type":["string","null"]},"pscDetentions":{"type":"integer"},"lastDetentionAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"lastDetentionPort":{"type":["string","null"]},"pscNote":{"type":["string","null"]},"doNotFix":{"type":"boolean"},"source":{"type":"string"},"checkedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["sanctionsStatus","sanctionsNote","pscDetentions","lastDetentionAt","lastDetentionPort","pscNote","doNotFix","source","checkedAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/cargo-orders/{cargoOrderId}/visibility":{"post":{"operationId":"cargoOrders.visibility","summary":"Set who outside the organisation sees this cargo: market, whitelist or private","tags":["cargoOrders"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"cargoOrderId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"visibility":{"type":"string","enum":["market","whitelist","private"]}},"required":["visibility"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"reference":{"type":"string"},"status":{"type":"string","enum":["candidate","open","working","fixed","withdrawn","expired"]},"revision":{"type":"integer"},"confidence":{"type":"integer"},"visibility":{"type":"string","enum":["market","whitelist","private"],"description":"Who outside the organisation sees it (ADR-0013)"},"data":{"type":"object","properties":{"commodity":{"type":"string","maxLength":200},"quantityMt":{"type":["number","null"],"exclusiveMinimum":0},"tolerancePct":{"type":"number","minimum":0,"maximum":50},"loadPortIds":{"type":"array","items":{"type":"string","minLength":1,"description":"Opaque identifier"},"maxItems":20},"dischargePortIds":{"type":"array","items":{"type":"string","minLength":1,"description":"Opaque identifier"},"maxItems":20},"loadPortRaw":{"type":"string","maxLength":200},"dischargePortRaw":{"type":"string","maxLength":200},"laycanFrom":{"type":["string","null"],"format":"date"},"laycanTo":{"type":["string","null"],"format":"date"},"chartererCompanyId":{"type":"string","minLength":1,"description":"Opaque identifier"},"freightIdea":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":0,"maximum":1000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amountCents","currency"]},"terms":{"type":"string","maxLength":200},"loadRate":{"type":"string","maxLength":200},"dischargeRate":{"type":"string","maxLength":200},"demurrage":{"type":"string","maxLength":200},"commission":{"type":"number","minimum":0,"maximum":10},"notes":{"type":"string","maxLength":4000}},"required":["commodity","quantityMt","loadPortIds","dischargePortIds","laycanFrom","laycanTo"]},"sourceMessageId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"updatedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","reference","status","revision","confidence","visibility","data","sourceMessageId","createdAt","updatedAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/tonnage-positions/{tonnagePositionId}/visibility":{"post":{"operationId":"tonnagePositions.visibility","summary":"Set who outside the organisation sees this position: market, whitelist or private","tags":["tonnagePositions"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"tonnagePositionId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"visibility":{"type":"string","enum":["market","whitelist","private"]}},"required":["visibility"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"reference":{"type":"string"},"status":{"type":"string","enum":["candidate","open","fixed","withdrawn","expired"]},"revision":{"type":"integer"},"confidence":{"type":"integer"},"visibility":{"type":"string","enum":["market","whitelist","private"],"description":"Who outside the organisation sees it (ADR-0013)"},"data":{"type":"object","properties":{"vesselNameRaw":{"type":"string","maxLength":200},"imo":{"type":"string","pattern":"^\\d{7}$"},"openPortId":{"type":"string","minLength":1,"description":"Opaque identifier"},"openAreaRaw":{"type":"string","maxLength":200},"openFrom":{"type":["string","null"],"format":"date"},"openTo":{"type":["string","null"],"format":"date"},"dwt":{"type":["integer","null"],"exclusiveMinimum":0},"built":{"type":"integer"},"gear":{"type":"string","maxLength":200},"lastCargoes":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":20},"ownerCompanyId":{"type":"string","minLength":1,"description":"Opaque identifier"},"rateIdea":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":0,"maximum":1000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["amountCents","currency"]},"notes":{"type":"string","maxLength":4000}},"required":["vesselNameRaw","openFrom","openTo","dwt"]},"sourceMessageId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"updatedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","reference","status","revision","confidence","visibility","data","sourceMessageId","createdAt","updatedAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/counterparties":{"get":{"operationId":"counterparties.list","summary":"The white list and black list of other organisations","tags":["organisations"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"list":{"type":"string","enum":["white","black"]},"note":{"type":["string","null"]},"org":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"slug":{"type":"string"},"name":{"type":"string"}},"required":["id","slug","name"]},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","list","note","org","createdAt"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"post":{"operationId":"counterparties.put","summary":"Put an organisation on the white or black list (moves it if it is on the other)","tags":["organisations"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"orgSlug":{"type":"string"},"list":{"type":"string","enum":["white","black"]},"note":{"type":"string","maxLength":200}},"required":["orgSlug","list"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"list":{"type":"string","enum":["white","black"]},"note":{"type":["string","null"]},"org":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"slug":{"type":"string"},"name":{"type":"string"}},"required":["id","slug","name"]},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","list","note","org","createdAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/counterparties/{counterpartyId}":{"delete":{"operationId":"counterparties.remove","summary":"Take an organisation off the lists","tags":["organisations"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"counterpartyId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/trade/enquiries":{"post":{"operationId":"trade.enquiry","summary":"Ask Blue Sea Line to broker a pair with another desk's market position in it; nothing reaches the other desk","tags":["trade"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"cargoOrderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"tonnagePositionId":{"type":"string","minLength":1,"description":"Opaque identifier"},"note":{"type":"string","maxLength":1000}},"required":["cargoOrderId","tonnagePositionId"]}}}},"responses":{"202":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"sent":{"type":"boolean","enum":[true]}},"required":["sent"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/trade":{"get":{"operationId":"trade.board","summary":"The trading desk: live cargo and open tonnage side by side","tags":["trade"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"cargo":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"kind":{"type":"string","enum":["cargo","tonnage"]},"reference":{"type":"string"},"status":{"type":"string"},"source":{"type":"string","enum":["own","market"]},"visibility":{"type":"string","enum":["market","whitelist","private"]},"mine":{"type":"boolean"},"expired":{"type":["string","null"],"enum":["laycan_passed","open_passed","superseded"]},"fromInbox":{"type":"boolean"},"title":{"type":["string","null"]},"route":{"type":["string","null"]},"window":{"type":["string","null"]},"facts":{"type":"object","properties":{"commodity":{"type":["string","null"]},"quantityMt":{"type":["number","null"]},"loadPortId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"dischargePortId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"laycanFrom":{"type":["string","null"]},"laycanTo":{"type":["string","null"]},"freightIdeaCents":{"type":["integer","null"]},"vesselName":{"type":["string","null"]},"imo":{"type":["string","null"]},"vesselType":{"type":["string","null"]},"dwt":{"type":["number","null"]},"openPortId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"openFrom":{"type":["string","null"]},"openTo":{"type":["string","null"]},"gear":{"type":["string","null"]}},"required":["commodity","quantityMt","loadPortId","dischargePortId","laycanFrom","laycanTo","freightIdeaCents","vesselName","imo","vesselType","dwt","openPortId","openFrom","openTo","gear"]},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"updatedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","kind","reference","status","source","visibility","mine","expired","fromInbox","title","route","window","facts","createdAt","updatedAt"],"description":"One position on the board: the commercial facts only, never a company, sender or contact"}},"tonnage":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"kind":{"type":"string","enum":["cargo","tonnage"]},"reference":{"type":"string"},"status":{"type":"string"},"source":{"type":"string","enum":["own","market"]},"visibility":{"type":"string","enum":["market","whitelist","private"]},"mine":{"type":"boolean"},"expired":{"type":["string","null"],"enum":["laycan_passed","open_passed","superseded"]},"fromInbox":{"type":"boolean"},"title":{"type":["string","null"]},"route":{"type":["string","null"]},"window":{"type":["string","null"]},"facts":{"type":"object","properties":{"commodity":{"type":["string","null"]},"quantityMt":{"type":["number","null"]},"loadPortId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"dischargePortId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"laycanFrom":{"type":["string","null"]},"laycanTo":{"type":["string","null"]},"freightIdeaCents":{"type":["integer","null"]},"vesselName":{"type":["string","null"]},"imo":{"type":["string","null"]},"vesselType":{"type":["string","null"]},"dwt":{"type":["number","null"]},"openPortId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"openFrom":{"type":["string","null"]},"openTo":{"type":["string","null"]},"gear":{"type":["string","null"]}},"required":["commodity","quantityMt","loadPortId","dischargePortId","laycanFrom","laycanTo","freightIdeaCents","vesselName","imo","vesselType","dwt","openPortId","openFrom","openTo","gear"]},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"updatedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","kind","reference","status","source","visibility","mine","expired","fromInbox","title","route","window","facts","createdAt","updatedAt"],"description":"One position on the board: the commercial facts only, never a company, sender or contact"}},"ports":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"unlocode":{"type":"string"},"name":{"type":"string"},"region":{"type":"string"}},"required":["id","unlocode","name","region"]}}},"required":["cargo","tonnage","ports"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/trade/rank":{"get":{"operationId":"trade.rank","summary":"The other side ranked by fit to one cargo order or tonnage position, best first, hard fails last","tags":["trade"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":false,"description":"Opaque identifier","name":"cargoOrderId","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":false,"description":"Opaque identifier","name":"tonnagePositionId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"anchor":{"type":"object","properties":{"kind":{"type":"string","enum":["cargo","tonnage"]},"id":{"type":"string","minLength":1,"description":"Opaque identifier"}},"required":["kind","id"]},"rows":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"score":{"type":"integer","minimum":0,"maximum":100},"fails":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"score":{"type":"number"},"weight":{"type":"number"},"note":{"type":"string"},"noteKey":{"type":"string"},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}},"fail":{"type":"boolean"}},"required":["key","score","weight"],"description":"One element of a score: weight 0 elements are checks, fail true is a hard fail that makes the score 0"}},"chips":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"score":{"type":"number"},"weight":{"type":"number"},"note":{"type":"string"},"noteKey":{"type":"string"},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}},"fail":{"type":"boolean"}},"required":["key","score","weight"],"description":"One element of a score: weight 0 elements are checks, fail true is a hard fail that makes the score 0"},"description":"Ship type, size, laycan, ballast, gear and draft, in that order, where the facts allow"},"warnings":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"score":{"type":"number"},"weight":{"type":"number"},"note":{"type":"string"},"noteKey":{"type":"string"},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}},"fail":{"type":"boolean"}},"required":["key","score","weight"],"description":"One element of a score: weight 0 elements are checks, fail true is a hard fail that makes the score 0"}},"breakdown":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"score":{"type":"number"},"weight":{"type":"number"},"note":{"type":"string"},"noteKey":{"type":"string"},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}},"fail":{"type":"boolean"}},"required":["key","score","weight"],"description":"One element of a score: weight 0 elements are checks, fail true is a hard fail that makes the score 0"}},"ballastNm":{"type":["integer","null"]},"ladenNm":{"type":["integer","null"]}},"required":["id","score","fails","chips","warnings","breakdown","ballastNm","ladenNm"]}}},"required":["anchor","rows"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/admin/contact-violations":{"get":{"operationId":"admin.contactViolations.list","summary":"Staff: contact details caught before the fixture, open ones oldest first, and every hold in force","tags":["admin"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","enum":["open","decided"]},"required":false,"name":"status","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"violations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"status":{"type":"string","enum":["open","dismissed","warned","suspended"]},"channel":{"type":"string","enum":["market_position","deal_room_message","deal_room_offer"]},"field":{"type":["string","null"]},"kinds":{"type":"array","items":{"type":"string","enum":["email","phone","url","messenger"]}},"org":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"slug":{"type":"string"},"name":{"type":"string"}},"required":["id","slug","name"]},"counterparty":{"type":["object","null"],"properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"slug":{"type":"string"},"name":{"type":"string"}},"required":["id","slug","name"]},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"reviewedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"}},"required":["id","status","channel","field","kinds","org","counterparty","createdAt","reviewedAt"]}},"holds":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"kind":{"type":"string","enum":["block","pair"]},"orgId":{"type":"string","minLength":1,"description":"Opaque identifier"},"counterpartyOrgId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"violationId":{"type":"string","minLength":1,"description":"Opaque identifier"},"releasedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"org":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"slug":{"type":"string"},"name":{"type":"string"}},"required":["id","slug","name"]},"counterparty":{"type":["object","null"],"properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"slug":{"type":"string"},"name":{"type":"string"}},"required":["id","slug","name"]}},"required":["id","kind","orgId","counterpartyOrgId","violationId","releasedAt","createdAt","org","counterparty"]}}},"required":["violations","holds"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/admin/contact-violations/{violationId}":{"get":{"operationId":"admin.contactViolations.get","summary":"Staff: one caught contact detail with the history to decide on","tags":["admin"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"violationId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"status":{"type":"string","enum":["open","dismissed","warned","suspended"]},"channel":{"type":"string","enum":["market_position","deal_room_message","deal_room_offer"]},"field":{"type":["string","null"]},"kinds":{"type":"array","items":{"type":"string","enum":["email","phone","url","messenger"]}},"org":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"slug":{"type":"string"},"name":{"type":"string"}},"required":["id","slug","name"]},"counterparty":{"type":["object","null"],"properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"slug":{"type":"string"},"name":{"type":"string"}},"required":["id","slug","name"]},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"reviewedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"text":{"type":"string","description":"What was written; staff only"},"pieces":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"kind":{"type":["string","null"]}},"required":["text","kind"]},"description":"The text cut at the found parts"},"entityType":{"type":"string"},"entityId":{"type":"string","minLength":1,"description":"Opaque identifier"},"actor":{"type":"object","properties":{"userId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"name":{"type":["string","null"]},"email":{"type":["string","null"]},"apiKeyId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"}},"required":["userId","name","email","apiKeyId"]},"decisionNote":{"type":["string","null"]},"holds":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"kind":{"type":"string","enum":["block","pair"]},"orgId":{"type":"string","minLength":1,"description":"Opaque identifier"},"counterpartyOrgId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"violationId":{"type":"string","minLength":1,"description":"Opaque identifier"},"releasedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","kind","orgId","counterpartyOrgId","violationId","releasedAt","createdAt"]}},"earlier":{"type":"object","properties":{"total":{"type":"integer"},"upheld":{"type":"integer"}},"required":["total","upheld"]},"revisions":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"what":{"type":"string"},"detail":{"type":["string","null"]}},"required":["at","what","detail"]}},"activity":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"what":{"type":"string"},"detail":{"type":["string","null"]}},"required":["at","what","detail"]}}},"required":["id","status","channel","field","kinds","org","counterparty","createdAt","reviewedAt","text","pieces","entityType","entityId","actor","decisionNote","holds","earlier","revisions","activity"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/admin/contact-violations/{violationId}/decision":{"post":{"operationId":"admin.contactViolations.decide","summary":"Staff: dismiss or warn (the holds are lifted) or suspend (they stay)","tags":["admin"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"violationId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"type":"string","enum":["dismiss","warn","suspend"]},"note":{"type":"string","maxLength":1000}},"required":["decision"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"status":{"type":"string","enum":["open","dismissed","warned","suspended"]},"channel":{"type":"string","enum":["market_position","deal_room_message","deal_room_offer"]},"field":{"type":["string","null"]},"kinds":{"type":"array","items":{"type":"string","enum":["email","phone","url","messenger"]}},"org":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"slug":{"type":"string"},"name":{"type":"string"}},"required":["id","slug","name"]},"counterparty":{"type":["object","null"],"properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"slug":{"type":"string"},"name":{"type":"string"}},"required":["id","slug","name"]},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"reviewedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"text":{"type":"string","description":"What was written; staff only"},"pieces":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"kind":{"type":["string","null"]}},"required":["text","kind"]},"description":"The text cut at the found parts"},"entityType":{"type":"string"},"entityId":{"type":"string","minLength":1,"description":"Opaque identifier"},"actor":{"type":"object","properties":{"userId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"name":{"type":["string","null"]},"email":{"type":["string","null"]},"apiKeyId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"}},"required":["userId","name","email","apiKeyId"]},"decisionNote":{"type":["string","null"]},"holds":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"kind":{"type":"string","enum":["block","pair"]},"orgId":{"type":"string","minLength":1,"description":"Opaque identifier"},"counterpartyOrgId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"violationId":{"type":"string","minLength":1,"description":"Opaque identifier"},"releasedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","kind","orgId","counterpartyOrgId","violationId","releasedAt","createdAt"]}},"earlier":{"type":"object","properties":{"total":{"type":"integer"},"upheld":{"type":"integer"}},"required":["total","upheld"]},"revisions":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"what":{"type":"string"},"detail":{"type":["string","null"]}},"required":["at","what","detail"]}},"activity":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"what":{"type":"string"},"detail":{"type":["string","null"]}},"required":["at","what","detail"]}}},"required":["id","status","channel","field","kinds","org","counterparty","createdAt","reviewedAt","text","pieces","entityType","entityId","actor","decisionNote","holds","earlier","revisions","activity"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/admin/holds/{holdId}/lift":{"post":{"operationId":"admin.holds.lift","summary":"Staff: lift one hold, for a suspended desk that may work again","tags":["admin"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"holdId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"kind":{"type":"string","enum":["block","pair"]},"orgId":{"type":"string","minLength":1,"description":"Opaque identifier"},"counterpartyOrgId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"violationId":{"type":"string","minLength":1,"description":"Opaque identifier"},"releasedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","kind","orgId","counterpartyOrgId","violationId","releasedAt","createdAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/team":{"get":{"operationId":"team.get","summary":"The company by department: each department with its people, and the people in none","tags":["team"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"departments":{"type":"array","items":{"type":"object","properties":{"department":{"type":"string","enum":["sales","operations","support","administration","accounting"]},"members":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string","minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"role":{"type":"string"},"departments":{"type":"array","items":{"type":"string","enum":["sales","operations","support","administration","accounting"]}}},"required":["userId","name","role","departments"]}}},"required":["department","members"]}},"unassigned":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string","minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"role":{"type":"string"},"departments":{"type":"array","items":{"type":"string","enum":["sales","operations","support","administration","accounting"]}}},"required":["userId","name","role","departments"]}}},"required":["departments","unassigned"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/members/{userId}/departments":{"post":{"operationId":"members.departments","summary":"Set a member's departments to exactly this list (admins); the past stays dated","tags":["team"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"userId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"departments":{"type":"array","items":{"type":"string","enum":["sales","operations","support","administration","accounting"]}}},"required":["departments"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"departments":{"type":"array","items":{"type":"string","enum":["sales","operations","support","administration","accounting"]}}},"required":["departments"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/tasks":{"get":{"operationId":"tasks.list","summary":"Tasks by view (mine, department, created, triage, all), sorted as a day is worked: overdue first, then by due time; a key reads the company","tags":["tasks"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","enum":["mine","department","created","triage","all","record"]},"required":false,"name":"view","in":"query"},{"schema":{"type":"string"},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","enum":["sales","operations","support","administration","accounting"]},"required":false,"name":"department","in":"query"},{"schema":{"type":"string","enum":["cargo","tonnage","match","negotiation","tender","fixture","message","voyage"]},"required":false,"name":"entityType","in":"query"},{"schema":{"type":"string"},"required":false,"name":"entityId","in":"query"},{"schema":{"type":"string","enum":["1","0"]},"required":false,"name":"overdue","in":"query"},{"schema":{"type":"integer"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"title":{"type":"string"},"notes":{"type":["string","null"]},"department":{"type":["string","null"],"enum":["sales","operations","support","administration","accounting"]},"ownerId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"ownerName":{"type":["string","null"]},"createdById":{"type":"string","minLength":1,"description":"Opaque identifier"},"origin":{"type":"string"},"status":{"type":"string","enum":["proposed","open","done","cancelled"]},"priority":{"type":"string","enum":["normal","high"]},"entity":{"type":["object","null"],"properties":{"type":{"type":"string","enum":["cargo","tonnage","match","negotiation","tender","fixture","message","voyage"]},"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"label":{"type":["string","null"]}},"required":["type","id","label"]},"dueAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"originalDueAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"snoozedUntil":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"completedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"updatedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","title","notes","department","ownerId","ownerName","createdById","origin","status","priority","entity","dueAt","originalDueAt","snoozedUntil","completedAt","createdAt","updatedAt"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"post":{"operationId":"tasks.create","summary":"Add a task, optionally on a record of the company","tags":["tasks"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"notes":{"type":"string","maxLength":4000},"department":{"type":["string","null"],"enum":["sales","operations","support","administration","accounting"]},"ownerId":{"type":["string","null"],"minLength":1,"maxLength":64},"dueAt":{"type":["string","null"],"format":"date-time"},"priority":{"type":"string","enum":["normal","high"],"default":"normal"},"entity":{"type":"object","properties":{"type":{"type":"string","enum":["cargo","tonnage","match","negotiation","tender","fixture","message","voyage"]},"id":{"type":"string","minLength":1,"maxLength":64}},"required":["type","id"],"additionalProperties":false}},"required":["title"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"title":{"type":"string"},"notes":{"type":["string","null"]},"department":{"type":["string","null"],"enum":["sales","operations","support","administration","accounting"]},"ownerId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"ownerName":{"type":["string","null"]},"createdById":{"type":"string","minLength":1,"description":"Opaque identifier"},"origin":{"type":"string"},"status":{"type":"string","enum":["proposed","open","done","cancelled"]},"priority":{"type":"string","enum":["normal","high"]},"entity":{"type":["object","null"],"properties":{"type":{"type":"string","enum":["cargo","tonnage","match","negotiation","tender","fixture","message","voyage"]},"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"label":{"type":["string","null"]}},"required":["type","id","label"]},"dueAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"originalDueAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"snoozedUntil":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"completedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"updatedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","title","notes","department","ownerId","ownerName","createdById","origin","status","priority","entity","dueAt","originalDueAt","snoozedUntil","completedAt","createdAt","updatedAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/tasks/{taskId}":{"get":{"operationId":"tasks.get","summary":"A task with its history","tags":["tasks"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"taskId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"title":{"type":"string"},"notes":{"type":["string","null"]},"department":{"type":["string","null"],"enum":["sales","operations","support","administration","accounting"]},"ownerId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"ownerName":{"type":["string","null"]},"createdById":{"type":"string","minLength":1,"description":"Opaque identifier"},"origin":{"type":"string"},"status":{"type":"string","enum":["proposed","open","done","cancelled"]},"priority":{"type":"string","enum":["normal","high"]},"entity":{"type":["object","null"],"properties":{"type":{"type":"string","enum":["cargo","tonnage","match","negotiation","tender","fixture","message","voyage"]},"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"label":{"type":["string","null"]}},"required":["type","id","label"]},"dueAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"originalDueAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"snoozedUntil":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"completedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"updatedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"kind":{"type":"string"},"actorId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"actorName":{"type":["string","null"]},"data":{"type":["object","null"],"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","kind","actorId","actorName","data","createdAt"]}}},"required":["id","title","notes","department","ownerId","ownerName","createdById","origin","status","priority","entity","dueAt","originalDueAt","snoozedUntil","completedAt","createdAt","updatedAt","history"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"patch":{"operationId":"tasks.update","summary":"Change a task; every change is a history row, the first due time stays as the promise","tags":["tasks"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"taskId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"notes":{"type":"string","maxLength":4000},"department":{"type":["string","null"],"enum":["sales","operations","support","administration","accounting"]},"ownerId":{"type":["string","null"],"minLength":1,"maxLength":64},"dueAt":{"type":["string","null"],"format":"date-time"},"priority":{"type":"string","enum":["normal","high"]},"snoozedUntil":{"type":["string","null"],"format":"date-time"}},"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"title":{"type":"string"},"notes":{"type":["string","null"]},"department":{"type":["string","null"],"enum":["sales","operations","support","administration","accounting"]},"ownerId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"ownerName":{"type":["string","null"]},"createdById":{"type":"string","minLength":1,"description":"Opaque identifier"},"origin":{"type":"string"},"status":{"type":"string","enum":["proposed","open","done","cancelled"]},"priority":{"type":"string","enum":["normal","high"]},"entity":{"type":["object","null"],"properties":{"type":{"type":"string","enum":["cargo","tonnage","match","negotiation","tender","fixture","message","voyage"]},"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"label":{"type":["string","null"]}},"required":["type","id","label"]},"dueAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"originalDueAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"snoozedUntil":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"completedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"updatedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","title","notes","department","ownerId","ownerName","createdById","origin","status","priority","entity","dueAt","originalDueAt","snoozedUntil","completedAt","createdAt","updatedAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/tasks/{taskId}/status":{"post":{"operationId":"tasks.status","summary":"Done, cancelled, reopened, or a proposal accepted or rejected","tags":["tasks"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"taskId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["open","done","cancelled"]},"reason":{"type":"string","maxLength":500}},"required":["status"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"title":{"type":"string"},"notes":{"type":["string","null"]},"department":{"type":["string","null"],"enum":["sales","operations","support","administration","accounting"]},"ownerId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"ownerName":{"type":["string","null"]},"createdById":{"type":"string","minLength":1,"description":"Opaque identifier"},"origin":{"type":"string"},"status":{"type":"string","enum":["proposed","open","done","cancelled"]},"priority":{"type":"string","enum":["normal","high"]},"entity":{"type":["object","null"],"properties":{"type":{"type":"string","enum":["cargo","tonnage","match","negotiation","tender","fixture","message","voyage"]},"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"label":{"type":["string","null"]}},"required":["type","id","label"]},"dueAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"originalDueAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"snoozedUntil":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"completedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"updatedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","title","notes","department","ownerId","ownerName","createdById","origin","status","priority","entity","dueAt","originalDueAt","snoozedUntil","completedAt","createdAt","updatedAt"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/voyages":{"get":{"operationId":"voyages.list","summary":"Live voyages newest first with their port calls and risks (closed=1 for the closed); mine (a session only; a key reads the company), risk and stage filters","tags":["voyages"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"stage","in":"query"},{"schema":{"type":"string","enum":["1","0"]},"required":false,"name":"mine","in":"query"},{"schema":{"type":"string","enum":["1","0"]},"required":false,"name":"risk","in":"query"},{"schema":{"type":"string","enum":["1","0"]},"required":false,"name":"closed","in":"query"},{"schema":{"type":"integer"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"reference":{"type":"string"},"fixtureId":{"type":"string","minLength":1,"description":"Opaque identifier"},"fixtureReference":{"type":["string","null"]},"cargoOrderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"tonnagePositionId":{"type":"string","minLength":1,"description":"Opaque identifier"},"vesselName":{"type":"string"},"cargoWords":{"type":"string"},"stage":{"type":"string","enum":["nominated","ballast","at_load","loading","sailed","at_discharge","discharging","laytime","claims","closed"]},"laycanFrom":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"laycanTo":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"operatorId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"operatorName":{"type":["string","null"]},"lastEtaAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"closedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"updatedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"calls":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"seq":{"type":"integer"},"kind":{"type":"string","enum":["load","discharge"]},"portId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"unlocode":{"type":["string","null"]},"timezone":{"type":["string","null"]},"eta":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"arrivedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"berthedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"sailedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"}},"required":["id","seq","kind","portId","name","unlocode","timezone","eta","arrivedAt","berthedAt","sailedAt"]}},"nextCall":{"type":["object","null"],"properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"seq":{"type":"integer"},"kind":{"type":"string","enum":["load","discharge"]},"portId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"unlocode":{"type":["string","null"]},"timezone":{"type":["string","null"]},"eta":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"arrivedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"berthedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"sailedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"}},"required":["id","seq","kind","portId","name","unlocode","timezone","eta","arrivedAt","berthedAt","sailedAt"]},"risks":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["late_for_laycan","no_eta","eta_stale","overdue_tasks"]},"params":{"type":"object","additionalProperties":{"type":"number"}}},"required":["code","params"]},"description":"Voyage at risk, rules risk.v1"},"tasks":{"type":"object","properties":{"open":{"type":"integer"},"overdue":{"type":"integer"}},"required":["open","overdue"],"description":"Tasks on the voyage and on its fixture"}},"required":["id","reference","fixtureId","fixtureReference","cargoOrderId","tonnagePositionId","vesselName","cargoWords","stage","laycanFrom","laycanTo","operatorId","operatorName","lastEtaAt","closedAt","createdAt","updatedAt","calls","nextCall","risks","tasks"]}},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"post":{"operationId":"voyages.start","summary":"Start the voyage of a clean fixed fixture (201), or get the one it has (200)","tags":["voyages"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"fixtureId":{"type":"string","minLength":1,"description":"Opaque identifier"}},"required":["fixtureId"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"reference":{"type":"string"},"fixtureId":{"type":"string","minLength":1,"description":"Opaque identifier"},"fixtureReference":{"type":["string","null"]},"cargoOrderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"tonnagePositionId":{"type":"string","minLength":1,"description":"Opaque identifier"},"vesselName":{"type":"string"},"cargoWords":{"type":"string"},"stage":{"type":"string","enum":["nominated","ballast","at_load","loading","sailed","at_discharge","discharging","laytime","claims","closed"]},"laycanFrom":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"laycanTo":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"operatorId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"operatorName":{"type":["string","null"]},"lastEtaAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"closedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"updatedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"calls":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"seq":{"type":"integer"},"kind":{"type":"string","enum":["load","discharge"]},"portId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"unlocode":{"type":["string","null"]},"timezone":{"type":["string","null"]},"eta":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"arrivedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"berthedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"sailedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"}},"required":["id","seq","kind","portId","name","unlocode","timezone","eta","arrivedAt","berthedAt","sailedAt"]}},"nextCall":{"type":["object","null"],"properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"seq":{"type":"integer"},"kind":{"type":"string","enum":["load","discharge"]},"portId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"unlocode":{"type":["string","null"]},"timezone":{"type":["string","null"]},"eta":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"arrivedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"berthedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"sailedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"}},"required":["id","seq","kind","portId","name","unlocode","timezone","eta","arrivedAt","berthedAt","sailedAt"]},"risks":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["late_for_laycan","no_eta","eta_stale","overdue_tasks"]},"params":{"type":"object","additionalProperties":{"type":"number"}}},"required":["code","params"]},"description":"Voyage at risk, rules risk.v1"},"tasks":{"type":"object","properties":{"open":{"type":"integer"},"overdue":{"type":"integer"}},"required":["open","overdue"],"description":"Tasks on the voyage and on its fixture"},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"kind":{"type":"string"},"portCallId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"actorId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"actorName":{"type":["string","null"]},"data":{"type":["object","null"],"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","kind","portCallId","actorId","actorName","data","createdAt"]}}},"required":["id","reference","fixtureId","fixtureReference","cargoOrderId","tonnagePositionId","vesselName","cargoWords","stage","laycanFrom","laycanTo","operatorId","operatorName","lastEtaAt","closedAt","createdAt","updatedAt","calls","nextCall","risks","tasks","history"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/voyages/{voyageId}":{"get":{"operationId":"voyages.get","summary":"A voyage with its port calls, history and risks","tags":["voyages"],"security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"voyageId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"reference":{"type":"string"},"fixtureId":{"type":"string","minLength":1,"description":"Opaque identifier"},"fixtureReference":{"type":["string","null"]},"cargoOrderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"tonnagePositionId":{"type":"string","minLength":1,"description":"Opaque identifier"},"vesselName":{"type":"string"},"cargoWords":{"type":"string"},"stage":{"type":"string","enum":["nominated","ballast","at_load","loading","sailed","at_discharge","discharging","laytime","claims","closed"]},"laycanFrom":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"laycanTo":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"operatorId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"operatorName":{"type":["string","null"]},"lastEtaAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"closedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"updatedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"calls":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"seq":{"type":"integer"},"kind":{"type":"string","enum":["load","discharge"]},"portId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"unlocode":{"type":["string","null"]},"timezone":{"type":["string","null"]},"eta":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"arrivedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"berthedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"sailedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"}},"required":["id","seq","kind","portId","name","unlocode","timezone","eta","arrivedAt","berthedAt","sailedAt"]}},"nextCall":{"type":["object","null"],"properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"seq":{"type":"integer"},"kind":{"type":"string","enum":["load","discharge"]},"portId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"unlocode":{"type":["string","null"]},"timezone":{"type":["string","null"]},"eta":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"arrivedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"berthedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"sailedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"}},"required":["id","seq","kind","portId","name","unlocode","timezone","eta","arrivedAt","berthedAt","sailedAt"]},"risks":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["late_for_laycan","no_eta","eta_stale","overdue_tasks"]},"params":{"type":"object","additionalProperties":{"type":"number"}}},"required":["code","params"]},"description":"Voyage at risk, rules risk.v1"},"tasks":{"type":"object","properties":{"open":{"type":"integer"},"overdue":{"type":"integer"}},"required":["open","overdue"],"description":"Tasks on the voyage and on its fixture"},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"kind":{"type":"string"},"portCallId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"actorId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"actorName":{"type":["string","null"]},"data":{"type":["object","null"],"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","kind","portCallId","actorId","actorName","data","createdAt"]}}},"required":["id","reference","fixtureId","fixtureReference","cargoOrderId","tonnagePositionId","vesselName","cargoWords","stage","laycanFrom","laycanTo","operatorId","operatorName","lastEtaAt","closedAt","createdAt","updatedAt","calls","nextCall","risks","tasks","history"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}},"patch":{"operationId":"voyages.update","summary":"Set or clear the operator","tags":["voyages"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"voyageId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"operatorId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"}},"required":["operatorId"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"reference":{"type":"string"},"fixtureId":{"type":"string","minLength":1,"description":"Opaque identifier"},"fixtureReference":{"type":["string","null"]},"cargoOrderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"tonnagePositionId":{"type":"string","minLength":1,"description":"Opaque identifier"},"vesselName":{"type":"string"},"cargoWords":{"type":"string"},"stage":{"type":"string","enum":["nominated","ballast","at_load","loading","sailed","at_discharge","discharging","laytime","claims","closed"]},"laycanFrom":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"laycanTo":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"operatorId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"operatorName":{"type":["string","null"]},"lastEtaAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"closedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"updatedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"calls":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"seq":{"type":"integer"},"kind":{"type":"string","enum":["load","discharge"]},"portId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"unlocode":{"type":["string","null"]},"timezone":{"type":["string","null"]},"eta":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"arrivedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"berthedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"sailedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"}},"required":["id","seq","kind","portId","name","unlocode","timezone","eta","arrivedAt","berthedAt","sailedAt"]}},"nextCall":{"type":["object","null"],"properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"seq":{"type":"integer"},"kind":{"type":"string","enum":["load","discharge"]},"portId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"unlocode":{"type":["string","null"]},"timezone":{"type":["string","null"]},"eta":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"arrivedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"berthedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"sailedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"}},"required":["id","seq","kind","portId","name","unlocode","timezone","eta","arrivedAt","berthedAt","sailedAt"]},"risks":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["late_for_laycan","no_eta","eta_stale","overdue_tasks"]},"params":{"type":"object","additionalProperties":{"type":"number"}}},"required":["code","params"]},"description":"Voyage at risk, rules risk.v1"},"tasks":{"type":"object","properties":{"open":{"type":"integer"},"overdue":{"type":"integer"}},"required":["open","overdue"],"description":"Tasks on the voyage and on its fixture"},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"kind":{"type":"string"},"portCallId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"actorId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"actorName":{"type":["string","null"]},"data":{"type":["object","null"],"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","kind","portCallId","actorId","actorName","data","createdAt"]}}},"required":["id","reference","fixtureId","fixtureReference","cargoOrderId","tonnagePositionId","vesselName","cargoWords","stage","laycanFrom","laycanTo","operatorId","operatorName","lastEtaAt","closedAt","createdAt","updatedAt","calls","nextCall","risks","tasks","history"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/voyages/{voyageId}/stage":{"post":{"operationId":"voyages.stage","summary":"Move the stage: forward, back one with a reason, closed when nothing is open, reopened to claims with a reason","tags":["voyages"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"voyageId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"stage":{"type":"string","enum":["nominated","ballast","at_load","loading","sailed","at_discharge","discharging","laytime","claims","closed"]},"reason":{"type":"string","maxLength":500}},"required":["stage"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"reference":{"type":"string"},"fixtureId":{"type":"string","minLength":1,"description":"Opaque identifier"},"fixtureReference":{"type":["string","null"]},"cargoOrderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"tonnagePositionId":{"type":"string","minLength":1,"description":"Opaque identifier"},"vesselName":{"type":"string"},"cargoWords":{"type":"string"},"stage":{"type":"string","enum":["nominated","ballast","at_load","loading","sailed","at_discharge","discharging","laytime","claims","closed"]},"laycanFrom":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"laycanTo":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"operatorId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"operatorName":{"type":["string","null"]},"lastEtaAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"closedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"updatedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"calls":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"seq":{"type":"integer"},"kind":{"type":"string","enum":["load","discharge"]},"portId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"unlocode":{"type":["string","null"]},"timezone":{"type":["string","null"]},"eta":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"arrivedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"berthedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"sailedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"}},"required":["id","seq","kind","portId","name","unlocode","timezone","eta","arrivedAt","berthedAt","sailedAt"]}},"nextCall":{"type":["object","null"],"properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"seq":{"type":"integer"},"kind":{"type":"string","enum":["load","discharge"]},"portId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"unlocode":{"type":["string","null"]},"timezone":{"type":["string","null"]},"eta":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"arrivedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"berthedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"sailedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"}},"required":["id","seq","kind","portId","name","unlocode","timezone","eta","arrivedAt","berthedAt","sailedAt"]},"risks":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["late_for_laycan","no_eta","eta_stale","overdue_tasks"]},"params":{"type":"object","additionalProperties":{"type":"number"}}},"required":["code","params"]},"description":"Voyage at risk, rules risk.v1"},"tasks":{"type":"object","properties":{"open":{"type":"integer"},"overdue":{"type":"integer"}},"required":["open","overdue"],"description":"Tasks on the voyage and on its fixture"},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"kind":{"type":"string"},"portCallId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"actorId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"actorName":{"type":["string","null"]},"data":{"type":["object","null"],"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","kind","portCallId","actorId","actorName","data","createdAt"]}}},"required":["id","reference","fixtureId","fixtureReference","cargoOrderId","tonnagePositionId","vesselName","cargoWords","stage","laycanFrom","laycanTo","operatorId","operatorName","lastEtaAt","closedAt","createdAt","updatedAt","calls","nextCall","risks","tasks","history"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/voyages/{voyageId}/port-calls/{portCallId}/eta":{"post":{"operationId":"voyages.eta","summary":"Type an ETA for a port call; every ETA is kept in the history","tags":["voyages"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"voyageId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"portCallId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"eta":{"type":"string","format":"date-time"},"source":{"type":"string","enum":["master","agent","charterers","owners","us"],"default":"us"},"note":{"type":"string","maxLength":500}},"required":["eta"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"reference":{"type":"string"},"fixtureId":{"type":"string","minLength":1,"description":"Opaque identifier"},"fixtureReference":{"type":["string","null"]},"cargoOrderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"tonnagePositionId":{"type":"string","minLength":1,"description":"Opaque identifier"},"vesselName":{"type":"string"},"cargoWords":{"type":"string"},"stage":{"type":"string","enum":["nominated","ballast","at_load","loading","sailed","at_discharge","discharging","laytime","claims","closed"]},"laycanFrom":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"laycanTo":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"operatorId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"operatorName":{"type":["string","null"]},"lastEtaAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"closedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"updatedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"calls":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"seq":{"type":"integer"},"kind":{"type":"string","enum":["load","discharge"]},"portId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"unlocode":{"type":["string","null"]},"timezone":{"type":["string","null"]},"eta":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"arrivedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"berthedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"sailedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"}},"required":["id","seq","kind","portId","name","unlocode","timezone","eta","arrivedAt","berthedAt","sailedAt"]}},"nextCall":{"type":["object","null"],"properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"seq":{"type":"integer"},"kind":{"type":"string","enum":["load","discharge"]},"portId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"unlocode":{"type":["string","null"]},"timezone":{"type":["string","null"]},"eta":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"arrivedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"berthedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"sailedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"}},"required":["id","seq","kind","portId","name","unlocode","timezone","eta","arrivedAt","berthedAt","sailedAt"]},"risks":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["late_for_laycan","no_eta","eta_stale","overdue_tasks"]},"params":{"type":"object","additionalProperties":{"type":"number"}}},"required":["code","params"]},"description":"Voyage at risk, rules risk.v1"},"tasks":{"type":"object","properties":{"open":{"type":"integer"},"overdue":{"type":"integer"}},"required":["open","overdue"],"description":"Tasks on the voyage and on its fixture"},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"kind":{"type":"string"},"portCallId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"actorId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"actorName":{"type":["string","null"]},"data":{"type":["object","null"],"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","kind","portCallId","actorId","actorName","data","createdAt"]}}},"required":["id","reference","fixtureId","fixtureReference","cargoOrderId","tonnagePositionId","vesselName","cargoWords","stage","laycanFrom","laycanTo","operatorId","operatorName","lastEtaAt","closedAt","createdAt","updatedAt","calls","nextCall","risks","tasks","history"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}},"/orgs/{orgId}/voyages/{voyageId}/port-calls/{portCallId}/events":{"post":{"operationId":"voyages.portEvent","summary":"Stamp arrived, berthed or sailed (now by default); the stage moves forward on its own","tags":["voyages"],"security":[{"session":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"orgId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"voyageId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Opaque identifier"},"required":true,"description":"Opaque identifier","name":"portCallId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"event":{"type":"string","enum":["arrived","berthed","sailed"]},"at":{"type":"string","format":"date-time"}},"required":["event"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"reference":{"type":"string"},"fixtureId":{"type":"string","minLength":1,"description":"Opaque identifier"},"fixtureReference":{"type":["string","null"]},"cargoOrderId":{"type":"string","minLength":1,"description":"Opaque identifier"},"tonnagePositionId":{"type":"string","minLength":1,"description":"Opaque identifier"},"vesselName":{"type":"string"},"cargoWords":{"type":"string"},"stage":{"type":"string","enum":["nominated","ballast","at_load","loading","sailed","at_discharge","discharging","laytime","claims","closed"]},"laycanFrom":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"laycanTo":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"operatorId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"operatorName":{"type":["string","null"]},"lastEtaAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"closedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"updatedAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"},"calls":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"seq":{"type":"integer"},"kind":{"type":"string","enum":["load","discharge"]},"portId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"unlocode":{"type":["string","null"]},"timezone":{"type":["string","null"]},"eta":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"arrivedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"berthedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"sailedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"}},"required":["id","seq","kind","portId","name","unlocode","timezone","eta","arrivedAt","berthedAt","sailedAt"]}},"nextCall":{"type":["object","null"],"properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"seq":{"type":"integer"},"kind":{"type":"string","enum":["load","discharge"]},"portId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"name":{"type":"string"},"unlocode":{"type":["string","null"]},"timezone":{"type":["string","null"]},"eta":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"arrivedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"berthedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"},"sailedAt":{"type":["string","null"],"format":"date-time","description":"RFC 3339 UTC"}},"required":["id","seq","kind","portId","name","unlocode","timezone","eta","arrivedAt","berthedAt","sailedAt"]},"risks":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["late_for_laycan","no_eta","eta_stale","overdue_tasks"]},"params":{"type":"object","additionalProperties":{"type":"number"}}},"required":["code","params"]},"description":"Voyage at risk, rules risk.v1"},"tasks":{"type":"object","properties":{"open":{"type":"integer"},"overdue":{"type":"integer"}},"required":["open","overdue"],"description":"Tasks on the voyage and on its fixture"},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque identifier"},"kind":{"type":"string"},"portCallId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"actorId":{"type":["string","null"],"minLength":1,"description":"Opaque identifier"},"actorName":{"type":["string","null"]},"data":{"type":["object","null"],"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time","description":"RFC 3339 UTC"}},"required":["id","kind","portCallId","actorId","actorName","data","createdAt"]}}},"required":["id","reference","fixtureId","fixtureReference","cargoOrderId","tonnagePositionId","vesselName","cargoWords","stage","laycanFrom","laycanTo","operatorId","operatorName","lastEtaAt","closedAt","createdAt","updatedAt","calls","nextCall","risks","tasks","history"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"type":["string","null"]}},"required":["requestId","nextCursor"]}},"required":["data","meta"]}}}},"4XX":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["path","code"]}}},"required":["code","message","issues"]},"meta":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]}},"required":["error","meta"]}}}}}}}},"webhooks":{},"x-webhook-events":["cargo_order.created","cargo_order.revised","cargo_order.withdrawn","cargo_order.expired","tonnage_position.created","tonnage_position.revised","tonnage_position.withdrawn","tonnage_position.expired","match.suggested","match.shortlisted","negotiation.opened","tender.opened","tender.closed","tender.awarded","tender_bid.received","offer.appended","negotiation.fixed","negotiation.failed","fixture.recap_sent","fixture.clean_fixed","task.created","task.assigned","task.due_changed","task.accepted","task.completed","task.reopened","task.cancelled","voyage.created","voyage.stage_changed","voyage.eta_updated","voyage.port_event","message.received","message.parsed","member.joined","api_key.created","ping"]}