{
  "openapi": "3.1.0",
  "info": {
    "title": "CrewPass Partner API",
    "description": "Read the crew, vessel, document and compliance data CrewPass holds for the crew on your vessels, with each crew member's consent.",
    "version": "0.1.0"
  },
  "paths": {
    "/api/v2/partners/me": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Get your API account",
        "description": "Your API account: its id, name, key mode and the scopes your key has.\n\nAny valid API key can call this. Call it first to check your key works and\nto see which endpoints you can use.",
        "operationId": "get_partners_me_api_v2_partners_me_get",
        "parameters": [
          {
            "name": "X-Partner-API-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Your API key, as an alternative to the `Authorization: Bearer` header.",
              "title": "X-Partner-Api-Key"
            },
            "description": "Your API key, as an alternative to the `Authorization: Bearer` header."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerMe"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "PartnerApiKey": []
          }
        ]
      }
    },
    "/api/v2/employers/me/crew/lookup": {
      "post": {
        "tags": [
          "Crew"
        ],
        "summary": "Find a crew member by email",
        "description": "Find a crew member on your vessels by email address.\n\nReturns their `crew_unique_id`, which the other crew endpoints take, and their\nstatus. Returns `404` if no one with that email is on one of your vessels.\n\nRequires `crew:status:read`.",
        "operationId": "crew_lookup_api_v2_employers_me_crew_lookup_post",
        "parameters": [
          {
            "name": "X-Partner-API-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Your API key, as an alternative to the `Authorization: Bearer` header.",
              "title": "X-Partner-Api-Key"
            },
            "description": "Your API key, as an alternative to the `Authorization: Bearer` header."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrewLookupRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrewLookupResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "PartnerApiKey": []
          }
        ]
      }
    },
    "/api/v2/employers/me/fleet": {
      "get": {
        "tags": [
          "Fleet"
        ],
        "summary": "List the crew on your vessels",
        "description": "Every crew member on your vessels, a page at a time (`limit`, `cursor`).\n\n`status` and `background_check_status` are included only for crew members who\nhave agreed to share their status with you. `documents_expiring` counts\ntheir current documents that expire within\n`include_documents_expiring_within_days` (default 30).\n\nRequires `vessels:fleet:read`.",
        "operationId": "fleet_api_v2_employers_me_fleet_get",
        "parameters": [
          {
            "name": "include_documents_expiring_within_days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 730,
              "minimum": 0,
              "default": 30,
              "title": "Include Documents Expiring Within Days"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "X-Partner-API-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Your API key, as an alternative to the `Authorization: Bearer` header.",
              "title": "X-Partner-Api-Key"
            },
            "description": "Your API key, as an alternative to the `Authorization: Bearer` header."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FleetResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "PartnerApiKey": []
          }
        ]
      }
    },
    "/api/v2/employers/me/vessels": {
      "get": {
        "tags": [
          "Fleet"
        ],
        "summary": "List your vessels",
        "description": "The vessels on your CrewPass account, with their identifiers.\n\nCrew are listed by the fleet endpoint. The list is empty if there are no\nvessels on your account yet.\n\nRequires `vessels:fleet:read`.",
        "operationId": "list_vessels_api_v2_employers_me_vessels_get",
        "parameters": [
          {
            "name": "X-Partner-API-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Your API key, as an alternative to the `Authorization: Bearer` header.",
              "title": "X-Partner-Api-Key"
            },
            "description": "Your API key, as an alternative to the `Authorization: Bearer` header."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VesselsListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "PartnerApiKey": []
          }
        ]
      }
    },
    "/api/v2/employers/me/crew/{crew_unique_id}/compliance-checks": {
      "post": {
        "tags": [
          "Compliance"
        ],
        "summary": "Check a crew member's compliance",
        "description": "A crew member's compliance with the requirements of their role on your vessel.\n\nEach row in `requirements` is one requirement (medical, STCW, certificate or\nqualification) with its own `status` and the documents that satisfy it. A\nmedical requirement row's `satisfied_by` is empty unless `crew:medical:read`\nis effective \u2014 the row (and its `status`) still shows. `compliance_source`\nsays how the result was produced. If the crew member is on more than one of\nyour vessels, pass `vessel_id` to choose the vessel. Returns `404` if the\ncrew member is not on one of your vessels.\n\nRequires `crew:compliance:read`.",
        "operationId": "crew_compliance_checks_api_v2_employers_me_crew__crew_unique_id__compliance_checks_post",
        "parameters": [
          {
            "name": "crew_unique_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Crew Unique Id"
            }
          },
          {
            "name": "vessel_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Vessel Id"
            }
          },
          {
            "name": "X-Partner-API-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Your API key, as an alternative to the `Authorization: Bearer` header.",
              "title": "X-Partner-Api-Key"
            },
            "description": "Your API key, as an alternative to the `Authorization: Bearer` header."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ComplianceCheckRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComplianceCheckResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "PartnerApiKey": []
          }
        ]
      }
    },
    "/api/v2/employers/me/crew/{crew_unique_id}/documents": {
      "get": {
        "tags": [
          "Documents"
        ],
        "summary": "List a crew member's documents",
        "description": "A crew member's current certificates and other documents.\n\nEach document has its issuer, verification status, dates, and a\n`classification` you can map to your own document types. Only documents\nCrewPass has finished processing are listed. Medical-class documents are\nincluded only when `crew:medical:read` is effective. To fetch a file, use\nthe download endpoint. Returns `404` if the crew member is not on one of\nyour vessels.\n\nRequires `crew:documents:read`.",
        "operationId": "crew_documents_api_v2_employers_me_crew__crew_unique_id__documents_get",
        "parameters": [
          {
            "name": "crew_unique_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Crew Unique Id"
            }
          },
          {
            "name": "X-Partner-API-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Your API key, as an alternative to the `Authorization: Bearer` header.",
              "title": "X-Partner-Api-Key"
            },
            "description": "Your API key, as an alternative to the `Authorization: Bearer` header."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "PartnerApiKey": []
          }
        ]
      }
    },
    "/api/v2/employers/me/crew/{crew_unique_id}/documents/{document_id}/download": {
      "get": {
        "tags": [
          "Documents"
        ],
        "summary": "Get a document download link",
        "description": "A short-lived link to download one of a crew member's documents.\n\nThe link is hosted by CrewPass and expires after about 15 minutes, so follow\nit straight away rather than storing it. Returns `404` if the document isn't\none the documents endpoint lists (including a medical-class document when\n`crew:medical:read` isn't effective), or the crew member is not on one of\nyour vessels.\n\nRequires `crew:documents:download`.",
        "operationId": "crew_document_download_api_v2_employers_me_crew__crew_unique_id__documents__document_id__download_get",
        "parameters": [
          {
            "name": "crew_unique_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Crew Unique Id"
            }
          },
          {
            "name": "document_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Document Id"
            }
          },
          {
            "name": "X-Partner-API-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Your API key, as an alternative to the `Authorization: Bearer` header.",
              "title": "X-Partner-Api-Key"
            },
            "description": "Your API key, as an alternative to the `Authorization: Bearer` header."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDownloadResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "PartnerApiKey": []
          }
        ]
      }
    },
    "/api/v2/employers/me/crew/{crew_unique_id}/profile": {
      "get": {
        "tags": [
          "Crew"
        ],
        "summary": "Get a crew member's profile",
        "description": "A crew member's profile, with a link to their photo.\n\nThe contact block (email, phone, country code) needs `crew:contact:read`.\nThe professional block (nationality, languages, skills, bio, years of\nexperience, the photo link) needs `crew:professional:read`.\n`employment_history` needs `crew:experience:read`. The personal block (date\nof birth, address, passport, visas) needs `crew:personal:read`. Each needs\nthe crew member's consent too. Returns `404` if the crew member is not on\none of your vessels.\n\nRequires `crew:profile:read`.",
        "operationId": "crew_profile_api_v2_employers_me_crew__crew_unique_id__profile_get",
        "parameters": [
          {
            "name": "crew_unique_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Crew Unique Id"
            }
          },
          {
            "name": "X-Partner-API-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Your API key, as an alternative to the `Authorization: Bearer` header.",
              "title": "X-Partner-Api-Key"
            },
            "description": "Your API key, as an alternative to the `Authorization: Bearer` header."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrewProfileResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "PartnerApiKey": []
          }
        ]
      }
    },
    "/api/v2/employers/me/crew/{crew_unique_id}/photo": {
      "get": {
        "tags": [
          "Crew"
        ],
        "summary": "Get a crew member's photo",
        "description": "A crew member's profile photo, as an image.\n\nThe photo is part of the professional block, so it also needs\n`crew:professional:read` to be effective. Returns `404` if that isn't\neffective, the crew member has no photo, or they are not on one of your\nvessels, and `503` if the photo can't be fetched right now (try again\nshortly).\n\nRequires `crew:profile:read`.",
        "operationId": "crew_photo_api_v2_employers_me_crew__crew_unique_id__photo_get",
        "parameters": [
          {
            "name": "crew_unique_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Crew Unique Id"
            }
          },
          {
            "name": "X-Partner-API-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Your API key, as an alternative to the `Authorization: Bearer` header.",
              "title": "X-Partner-Api-Key"
            },
            "description": "Your API key, as an alternative to the `Authorization: Bearer` header."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "image/*": {}
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "PartnerApiKey": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "AddressBlock": {
        "properties": {
          "line1": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Line1"
          },
          "line2": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Line2"
          },
          "city": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "City"
          },
          "state": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "State"
          },
          "country": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Country"
          },
          "postcode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Postcode"
          },
          "full_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Full Address"
          }
        },
        "type": "object",
        "title": "AddressBlock"
      },
      "CatalogueTitle": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          }
        },
        "type": "object",
        "required": [
          "id"
        ],
        "title": "CatalogueTitle",
        "description": "The CrewPass certificate type the document was matched to."
      },
      "CocCapacity": {
        "properties": {
          "stcw_regulation": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stcw Regulation",
            "examples": [
              "II/2"
            ]
          },
          "role": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Role",
            "examples": [
              "Chief Mate"
            ]
          },
          "level": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "management",
                  "operational",
                  "support"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Level"
          },
          "gt_max": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gt Max",
            "examples": [
              3000
            ]
          },
          "kw_max": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Kw Max"
          },
          "power_unrestricted": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Power Unrestricted"
          },
          "area": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Area",
            "examples": [
              "unlimited"
            ]
          },
          "vessel_types": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Vessel Types",
            "examples": [
              [
                "yacht"
              ]
            ]
          }
        },
        "type": "object",
        "title": "CocCapacity",
        "description": "One capacity a certificate of competency grants, with its limits."
      },
      "ComplianceCheckRequest": {
        "properties": {},
        "type": "object",
        "title": "ComplianceCheckRequest",
        "description": "No fields yet: send an empty JSON object (`{}`)."
      },
      "ComplianceCheckResponse": {
        "properties": {
          "crew_unique_id": {
            "type": "string",
            "title": "Crew Unique Id"
          },
          "vessel_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vessel Id"
          },
          "position_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Position Name"
          },
          "as_of": {
            "type": "string",
            "format": "date-time",
            "title": "As Of"
          },
          "overall_status": {
            "type": "string",
            "title": "Overall Status"
          },
          "compliance_source": {
            "type": "string",
            "title": "Compliance Source"
          },
          "summary": {
            "$ref": "#/components/schemas/ComplianceSummary"
          },
          "requirements": {
            "items": {
              "$ref": "#/components/schemas/RequirementRow"
            },
            "type": "array",
            "title": "Requirements"
          }
        },
        "type": "object",
        "required": [
          "crew_unique_id",
          "as_of",
          "overall_status",
          "compliance_source"
        ],
        "title": "ComplianceCheckResponse",
        "description": "A crew member's compliance with the requirements of their role.\n\n`overall_status` is `compliant`, `at_risk`, `non_compliant` or `no_role`.\n`compliance_source` is `live_evaluator` when the result was worked out for\nthis request, or `crewCompliance_fallback` when CrewPass returned its most\nrecent stored result instead. `summary` counts the rows in `requirements`."
      },
      "ComplianceSummary": {
        "properties": {
          "total": {
            "type": "integer",
            "title": "Total",
            "default": 0
          },
          "met": {
            "type": "integer",
            "title": "Met",
            "default": 0
          },
          "expiring": {
            "type": "integer",
            "title": "Expiring",
            "default": 0
          },
          "expired": {
            "type": "integer",
            "title": "Expired",
            "default": 0
          },
          "missing": {
            "type": "integer",
            "title": "Missing",
            "default": 0
          },
          "pending": {
            "type": "integer",
            "title": "Pending",
            "default": 0
          }
        },
        "type": "object",
        "title": "ComplianceSummary",
        "description": "How many requirements are in each status. The counts add up to `total`,\nwhich equals the number of rows in `requirements`."
      },
      "CrewLookupRequest": {
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "title": "Email"
          }
        },
        "type": "object",
        "required": [
          "email"
        ],
        "title": "CrewLookupRequest"
      },
      "CrewLookupResponse": {
        "properties": {
          "crew_unique_id": {
            "type": "string",
            "title": "Crew Unique Id"
          },
          "status": {
            "type": "string",
            "title": "Status"
          }
        },
        "type": "object",
        "required": [
          "crew_unique_id",
          "status"
        ],
        "title": "CrewLookupResponse",
        "description": "The crew member found for the email address."
      },
      "CrewProfileResponse": {
        "properties": {
          "crew_unique_id": {
            "type": "string",
            "title": "Crew Unique Id"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "rank": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rank"
          },
          "nationality": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Nationality"
          },
          "languages": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/LanguageItem"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Languages"
          },
          "skills": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Skills"
          },
          "years_experience": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Years Experience"
          },
          "bio": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bio"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          },
          "country_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Country Code"
          },
          "profile_photo_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Profile Photo Url"
          },
          "employment_history": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/EmploymentHistoryItem"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Employment History"
          },
          "full_profile": {
            "type": "boolean",
            "title": "Full Profile",
            "default": false
          },
          "date_of_birth": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date Of Birth"
          },
          "address": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AddressBlock"
              },
              {
                "type": "null"
              }
            ]
          },
          "passport": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PassportBlock"
              },
              {
                "type": "null"
              }
            ]
          },
          "visas": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/VisaItem"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Visas"
          }
        },
        "type": "object",
        "required": [
          "crew_unique_id"
        ],
        "title": "CrewProfileResponse",
        "description": "A crew member's profile.\n\n`name` and `rank` need only `crew:profile:read`. Four further blocks are\neach filled only when their own scope is effective for the crew member\n(Connect \u00a73): the contact block (`email`, `phone`, `country_code`) needs\n`crew:contact:read`; the professional block (`nationality`, `languages`,\n`skills`, `years_experience`, `bio`, `profile_photo_url`) needs\n`crew:professional:read`; `employment_history` needs `crew:experience:read`;\nthe personal block (`date_of_birth`, `address`, `passport`, `visas`) needs\n`crew:personal:read`. `full_profile` is `true` only when both\n`crew:experience:read` and `crew:personal:read` are effective (the old\n`crew:profile:full:read` bundle). A `null` field in an ungated block means\nit wasn't shared; in a gated block it means CrewPass doesn't hold that\ndetail."
      },
      "DocumentClassification": {
        "properties": {
          "taxonomy_version": {
            "type": "string",
            "title": "Taxonomy Version",
            "description": "The version of the document code list these values come from.",
            "examples": [
              "2026-09-17.230e599f"
            ]
          },
          "document_class": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "training",
                  "competency",
                  "endorsement",
                  "medical",
                  "identity",
                  "travel",
                  "other"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Document Class",
            "description": "The broad kind of document. Separates certificates from paperwork."
          },
          "category_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Category Code",
            "description": "A finer grouping of the document, from the code list.",
            "examples": [
              "stcw_training"
            ]
          },
          "catalogue_title": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CatalogueTitle"
              },
              {
                "type": "null"
              }
            ],
            "description": "The CrewPass certificate type the document was matched to. Every document of the same type has the same `id`."
          },
          "stcw_regulation": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stcw Regulation",
            "description": "The STCW regulation the document relates to.",
            "examples": [
              "VI/1"
            ]
          },
          "stcw_codes": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Stcw Codes",
            "description": "The specific STCW units the document covers. A combined basic training certificate lists `VI/1-1` to `VI/1-4`.",
            "examples": [
              [
                "VI/1-1"
              ]
            ]
          },
          "level": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "management",
                  "operational",
                  "support"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Level",
            "description": "The STCW level, where the certificate has one."
          },
          "is_refresher": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Refresher",
            "description": "`true` for an updated proficiency (refresher) certificate."
          },
          "flag_state": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Flag State",
            "description": "ISO 3166 alpha-2 code of the state that issued the document.",
            "examples": [
              "GB"
            ]
          },
          "coc_capacities": {
            "items": {
              "$ref": "#/components/schemas/CocCapacity"
            },
            "type": "array",
            "title": "Coc Capacities",
            "description": "For a certificate of competency, each capacity it grants."
          },
          "sources": {
            "items": {
              "type": "string",
              "enum": [
                "document_type",
                "title_override",
                "competence_profile",
                "medical_record",
                "stcw_record",
                "document_category",
                "catalogue",
                "structured_data"
              ]
            },
            "type": "array",
            "title": "Sources",
            "description": "What the classification was built from, in order."
          }
        },
        "type": "object",
        "required": [
          "taxonomy_version"
        ],
        "title": "DocumentClassification",
        "description": "What the document is, as codes you can map to your own document types.\n\nEvery value comes from the published document code list\n(https://docs.crewpass.co.uk/reference/document-codes). `null` or an empty\nlist means CrewPass doesn't hold that fact; it never means \"no\"."
      },
      "DocumentDownloadResponse": {
        "properties": {
          "document_id": {
            "type": "string",
            "title": "Document Id"
          },
          "download_url": {
            "type": "string",
            "title": "Download Url"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expires At"
          },
          "content_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Content Type"
          },
          "file_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "File Name"
          }
        },
        "type": "object",
        "required": [
          "document_id",
          "download_url",
          "expires_at"
        ],
        "title": "DocumentDownloadResponse",
        "description": "A short-lived link to download the document's file.\n\n`download_url` is hosted by CrewPass and works until `expires_at`; it needs\nno API key."
      },
      "DocumentItem": {
        "properties": {
          "document_id": {
            "type": "string",
            "title": "Document Id"
          },
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Type"
          },
          "category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Category",
            "description": "The category the document is filed under on CrewPass."
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "issuer": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Issuer",
            "description": "The authority that issued the document. `null` when it isn't known."
          },
          "verification_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Verification Status",
            "description": "CrewPass's check on the document, taking expiry into account: `verified`, `pending` or `expired`."
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "issue_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Issue Date"
          },
          "expiry_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expiry Date"
          },
          "document_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Document Number",
            "description": "The document's own reference number."
          },
          "review_status": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "verified",
                  "pending",
                  "pending_manual_review",
                  "rejected"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Review Status",
            "description": "The result of CrewPass's review, without expiry: an expired certificate that was verified stays `verified`."
          },
          "is_expired": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Expired",
            "description": "`true` once `expiry_date` has passed. `null` when there is no expiry date."
          },
          "no_expiry": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "No Expiry",
            "description": "`true` for a document that does not expire, `false` when it has an expiry date, and `null` when CrewPass doesn't know. A missing `expiry_date` without `no_expiry: true` means the date wasn't recorded."
          },
          "is_current": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Current",
            "description": "`false` once a newer edition of the same certificate is on file. `null` when CrewPass doesn't know."
          },
          "superseded_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Superseded By",
            "description": "The `document_id` of the newer edition, if there is one."
          },
          "classification": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DocumentClassification"
              },
              {
                "type": "null"
              }
            ],
            "description": "What the document is, as codes you can map. `null` when the document can't be classified at the moment."
          }
        },
        "type": "object",
        "required": [
          "document_id"
        ],
        "title": "DocumentItem",
        "description": "A certificate or other document on a crew member's CrewPass profile."
      },
      "DocumentsResponse": {
        "properties": {
          "crew_unique_id": {
            "type": "string",
            "title": "Crew Unique Id"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/DocumentItem"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "type": "object",
        "required": [
          "crew_unique_id",
          "items"
        ],
        "title": "DocumentsResponse",
        "description": "A crew member's current documents."
      },
      "EmploymentHistoryItem": {
        "properties": {
          "vessel_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vessel Name"
          },
          "role": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Role"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "ended_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ended At"
          },
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source"
          }
        },
        "type": "object",
        "title": "EmploymentHistoryItem"
      },
      "FleetCrewItem": {
        "properties": {
          "crew_unique_id": {
            "type": "string",
            "title": "Crew Unique Id",
            "description": "The crew member's id. Pass it to the other crew endpoints."
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "vessel_id": {
            "type": "string",
            "title": "Vessel Id"
          },
          "vessel_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vessel Name"
          },
          "vessel_imo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vessel Imo",
            "description": "The vessel's IMO number, for matching vessels without relying on names. `null` when CrewPass doesn't hold one."
          },
          "role": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Role",
            "description": "Their position on this vessel."
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status",
            "description": "Their placement on this vessel, e.g. `active` or `invited`. Included only if the crew member shares their status with you."
          },
          "background_check_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Background Check Status"
          },
          "documents_expiring": {
            "type": "integer",
            "title": "Documents Expiring",
            "default": 0
          },
          "as_of": {
            "type": "string",
            "format": "date-time",
            "title": "As Of"
          }
        },
        "type": "object",
        "required": [
          "crew_unique_id",
          "vessel_id",
          "as_of"
        ],
        "title": "FleetCrewItem",
        "description": "A crew member on one of your vessels."
      },
      "FleetResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/FleetCrewItem"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "expiring_within_days": {
            "type": "integer",
            "title": "Expiring Within Days"
          }
        },
        "type": "object",
        "required": [
          "items",
          "expiring_within_days"
        ],
        "title": "FleetResponse",
        "description": "One page of the crew on your vessels. Pass `next_cursor` back as `cursor` for the next page."
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "LanguageItem": {
        "properties": {
          "language": {
            "type": "string",
            "title": "Language"
          },
          "proficiency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Proficiency"
          }
        },
        "type": "object",
        "required": [
          "language"
        ],
        "title": "LanguageItem"
      },
      "PartnerMe": {
        "properties": {
          "partner_id": {
            "type": "string",
            "title": "Partner Id",
            "examples": [
              "prt_123"
            ]
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name",
            "examples": [
              "Example Fleet Management"
            ]
          },
          "partner_type": {
            "type": "string",
            "enum": [
              "customer",
              "external"
            ],
            "title": "Partner Type"
          },
          "status": {
            "type": "string",
            "title": "Status",
            "default": "active"
          },
          "mode": {
            "type": "string",
            "enum": [
              "live",
              "test"
            ],
            "title": "Mode"
          },
          "subscription_plan": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subscription Plan",
            "examples": [
              "management"
            ]
          },
          "granted_scopes": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Granted Scopes",
            "examples": [
              [
                "crew:status:read",
                "crew:profile:read",
                "vessels:fleet:read"
              ]
            ]
          }
        },
        "type": "object",
        "required": [
          "partner_id",
          "partner_type",
          "mode"
        ],
        "title": "PartnerMe",
        "description": "Your API account and the scopes your key has been granted."
      },
      "PassportBlock": {
        "properties": {
          "nationality": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Nationality"
          },
          "number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Number"
          },
          "expiry": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expiry"
          }
        },
        "type": "object",
        "title": "PassportBlock"
      },
      "RequirementRow": {
        "properties": {
          "key": {
            "type": "string",
            "title": "Key"
          },
          "group": {
            "type": "string",
            "title": "Group"
          },
          "category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Category"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Code"
          },
          "constraint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Constraint"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "expiry_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expiry Date"
          },
          "days_until_expiry": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Days Until Expiry"
          },
          "required": {
            "type": "boolean",
            "title": "Required",
            "default": true
          },
          "satisfied_by": {
            "items": {
              "$ref": "#/components/schemas/SatisfyingDocument"
            },
            "type": "array",
            "title": "Satisfied By"
          },
          "modules": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/StcwModuleRow"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Modules"
          }
        },
        "type": "object",
        "required": [
          "key",
          "group",
          "status"
        ],
        "title": "RequirementRow",
        "description": "One requirement of the role, its status, and the documents that satisfy it.\n\n`group` is `medical`, `stcw`, `certificate` or `qualification`. `status` is\n`met`, `expiring`, `expired`, `missing` or `pending`. `satisfied_by` lists the\ndocuments that meet the requirement, and is empty when it is missing."
      },
      "SatisfyingDocument": {
        "properties": {
          "document_id": {
            "type": "string",
            "title": "Document Id"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "expiry_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expiry Date"
          },
          "download_path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Download Path"
          }
        },
        "type": "object",
        "required": [
          "document_id"
        ],
        "title": "SatisfyingDocument",
        "description": "A document that satisfies a requirement (with a ready download link)."
      },
      "StcwModuleRow": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "days_until_expiry": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Days Until Expiry"
          },
          "document_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Document Id"
          }
        },
        "type": "object",
        "required": [
          "code"
        ],
        "title": "StcwModuleRow",
        "description": "A single STCW basic-safety module within the STCW requirement row."
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "VesselListItem": {
        "properties": {
          "vessel_id": {
            "type": "string",
            "title": "Vessel Id"
          },
          "vessel_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vessel Name"
          },
          "imo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Imo"
          },
          "mmsi": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mmsi"
          },
          "flag_state": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Flag State"
          },
          "vessel_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vessel Type"
          }
        },
        "type": "object",
        "required": [
          "vessel_id"
        ],
        "title": "VesselListItem",
        "description": "A vessel on your account."
      },
      "VesselsListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/VesselListItem"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "VesselsListResponse",
        "description": "The vessels on your account."
      },
      "VisaItem": {
        "properties": {
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Type"
          },
          "country": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Country"
          },
          "expiry": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expiry"
          }
        },
        "type": "object",
        "title": "VisaItem"
      }
    },
    "securitySchemes": {
      "PartnerApiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Partner API key (`cpk_live_*` / `cpk_test_*`) as a Bearer token."
      }
    }
  }
}
