> ## Documentation Index
> Fetch the complete documentation index at: https://docs.crewpass.co.uk/llms.txt
> Use this file to discover all available pages before exploring further.

# Crew compliance snapshot (scope: crew:compliance:read)

> Compliance for a crew member on a vessel, as a unified requirement matrix.

Each ``requirements[]`` row is one role requirement (Medical / STCW /
certificate / qualification) with its own ``status`` and the ``satisfied_by``
document(s). Verdicts come from the dashboard compliance engine (single
source of truth); this service never re-derives compliance. Falls back to the
``crewCompliance`` projection (STCW + Medical) if the engine is unavailable.
404 if the crew is not on an attached vessel. Pass ``vessel_id`` when the crew
has placements on multiple attached vessels.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v2/employers/me/crew/{crew_unique_id}/compliance-checks
openapi: 3.1.0
info:
  title: crewpass-api-v2
  description: >-
    CrewPass V2 Partner API — a scope-gated, consent-intersected, multi-tenant
    front door onto existing CrewPass crew/vessel/compliance data.
  version: 0.1.0
servers: []
security: []
paths:
  /api/v2/employers/me/crew/{crew_unique_id}/compliance-checks:
    post:
      tags:
        - employers
      summary: 'Crew compliance snapshot (scope: crew:compliance:read)'
      description: >-
        Compliance for a crew member on a vessel, as a unified requirement
        matrix.


        Each ``requirements[]`` row is one role requirement (Medical / STCW /

        certificate / qualification) with its own ``status`` and the
        ``satisfied_by``

        document(s). Verdicts come from the dashboard compliance engine (single

        source of truth); this service never re-derives compliance. Falls back
        to the

        ``crewCompliance`` projection (STCW + Medical) if the engine is
        unavailable.

        404 if the crew is not on an attached vessel. Pass ``vessel_id`` when
        the crew

        has placements on multiple attached vessels.
      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: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
        - name: X-Partner-API-Key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Partner-Api-Key
      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: []
components:
  schemas:
    ComplianceCheckRequest:
      properties: {}
      type: object
      title: ComplianceCheckRequest
      description: >-
        `POST /employers/me/crew/{id}/compliance-checks` request body.


        Currently empty: the endpoint returns the crew member's current
        compliance

        projection as-is. Point-in-time (`as_of`) and required-cert filtering
        are

        intentionally not exposed yet — honouring them would mean re-deriving

        compliance here, which is forbidden (CLAUDE.md). They will return when
        the

        underlying snapshot supports them.
    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: >-
        Compliance for a crew member on a vessel, as a unified requirement
        matrix.


        Each ``requirements[]`` row is one role requirement carrying its own

        ``status`` and the ``satisfied_by`` document(s). Verdicts come from the

        dashboard compliance engine (single source of truth); this service only

        reshapes them and never re-derives compliance. ``compliance_source``
        says

        whether the live engine or the ``crewCompliance`` fallback produced the

        result. ``summary`` always reconciles with ``requirements``.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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: |-
        Requirement counts. Always reconciles: the parts sum to ``total`` and
        ``total`` equals the number of rows in ``requirements``.
    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 role requirement, with its verdict and the document(s) that satisfy
        it.


        ``group`` buckets the requirement: ``medical`` · ``stcw`` ·
        ``certificate`` ·

        ``qualification``. ``status`` is the evaluated verdict (from the
        dashboard's

        compliance engine — never computed here). ``satisfied_by`` links the
        actual

        document(s) that meet it so the partner can fetch them; empty when the

        requirement is missing.
    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
    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.
  securitySchemes:
    PartnerApiKey:
      type: http
      scheme: bearer
      description: Partner API key (`cpk_live_*` / `cpk_test_*`) as a Bearer token.

````