> ## 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.

# Check a crew member's compliance

> A crew member's compliance with the requirements of their role on your vessel.

Each row in `requirements` is one requirement (medical, STCW, certificate or
qualification) with its own `status` and the documents that satisfy it.
`compliance_source` says how the result was produced. If the crew member is
on more than one of your vessels, pass `vessel_id` to choose the vessel.
Returns `404` if the crew member is not on one of your vessels.

Requires `crew:compliance:read`.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v2/employers/me/crew/{crew_unique_id}/compliance-checks
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
servers: []
security: []
paths:
  /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.


        Each row in `requirements` is one requirement (medical, STCW,
        certificate or

        qualification) with its own `status` and the documents that satisfy it.

        `compliance_source` says how the result was produced. If the crew member
        is

        on more than one of your vessels, pass `vessel_id` to choose the vessel.

        Returns `404` if the crew member is not on one of your vessels.


        Requires `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: []
components:
  schemas:
    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.


        `overall_status` is `compliant`, `at_risk`, `non_compliant` or
        `no_role`.

        `compliance_source` is `live_evaluator` when the result was worked out
        for

        this request, or `crewCompliance_fallback` when CrewPass returned its
        most

        recent stored result instead. `summary` counts the rows in
        `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: |-
        How many requirements are in each status. The counts add up to `total`,
        which 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 requirement of the role, its status, and the documents that satisfy
        it.


        `group` is `medical`, `stcw`, `certificate` or `qualification`. `status`
        is

        `met`, `expiring`, `expired`, `missing` or `pending`. `satisfied_by`
        lists the

        documents that meet the requirement, and is empty when it 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.

````