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

# Upsert Crew Profile

> Create or update a user's crew profile (partial). All fields on
the payload are optional; only those provided are written.

Authz: self OR staff (admin/office-admin/office-employee) in the same org.

Field authority: the Employment block (employee #, position, ship type,
contract group, payscale) is office-editable only. A self-PATCH that tries
to change those fields is rejected with 403 ``field_forbidden`` — the
frontend renders them read-only, so this only fires on a tampered or buggy
client.



## OpenAPI

````yaml /openapi.json patch /api/v1/crew/users/{user_id}/profile
openapi: 3.1.0
info:
  title: Seamind Backend
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/crew/users/{user_id}/profile:
    patch:
      tags:
        - crew-profile
      summary: Upsert Crew Profile
      description: >-
        Create or update a user's crew profile (partial). All fields on

        the payload are optional; only those provided are written.


        Authz: self OR staff (admin/office-admin/office-employee) in the same
        org.


        Field authority: the Employment block (employee #, position, ship type,

        contract group, payscale) is office-editable only. A self-PATCH that
        tries

        to change those fields is rejected with 403 ``field_forbidden`` — the

        frontend renders them read-only, so this only fires on a tampered or
        buggy

        client.
      operationId: upsert_crew_profile_api_v1_crew_users__user_id__profile_patch
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: User Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CrewProfileUpsertDTO'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CrewProfileResponseDTO'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    CrewProfileUpsertDTO:
      properties:
        dateOfBirth:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Dateofbirth
        placeOfBirth:
          anyOf:
            - type: string
            - type: 'null'
          title: Placeofbirth
        nationality:
          anyOf:
            - type: string
            - type: 'null'
          title: Nationality
        gender:
          anyOf:
            - type: string
            - type: 'null'
          title: Gender
        religion:
          anyOf:
            - type: string
            - type: 'null'
          title: Religion
        maritalStatus:
          anyOf:
            - type: string
            - type: 'null'
          title: Maritalstatus
        weddingDate:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Weddingdate
        employeeId:
          anyOf:
            - type: string
            - type: 'null'
          title: Employeeid
        position:
          anyOf:
            - type: string
            - type: 'null'
          title: Position
        shipType:
          anyOf:
            - type: string
            - type: 'null'
          title: Shiptype
        contractGroup:
          anyOf:
            - type: string
            - type: 'null'
          title: Contractgroup
        payscale:
          anyOf:
            - type: string
            - type: 'null'
          title: Payscale
        internationalAirport:
          anyOf:
            - type: string
            - type: 'null'
          title: Internationalairport
        domesticAirport:
          anyOf:
            - type: string
            - type: 'null'
          title: Domesticairport
        homeAddress:
          anyOf:
            - type: string
            - type: 'null'
          title: Homeaddress
        phone:
          anyOf:
            - type: string
            - type: 'null'
          title: Phone
        linkedinUrl:
          anyOf:
            - type: string
            - type: 'null'
          title: Linkedinurl
        facebookUrl:
          anyOf:
            - type: string
            - type: 'null'
          title: Facebookurl
        instagramUrl:
          anyOf:
            - type: string
            - type: 'null'
          title: Instagramurl
        languages:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Languages
        drivingLicense:
          anyOf:
            - type: string
            - type: 'null'
          title: Drivinglicense
      type: object
      title: CrewProfileUpsertDTO
      description: |-
        Fields the API accepts for create-or-update. Lazy provisioning:
        the first PATCH for a user creates the row; subsequent PATCHes update
        in place. All fields are optional partial updates.
    CrewProfileResponseDTO:
      properties:
        userId:
          type: string
          format: uuid
          title: Userid
        dateOfBirth:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Dateofbirth
        placeOfBirth:
          anyOf:
            - type: string
            - type: 'null'
          title: Placeofbirth
        nationality:
          anyOf:
            - type: string
            - type: 'null'
          title: Nationality
        gender:
          anyOf:
            - type: string
            - type: 'null'
          title: Gender
        religion:
          anyOf:
            - type: string
            - type: 'null'
          title: Religion
        maritalStatus:
          anyOf:
            - type: string
            - type: 'null'
          title: Maritalstatus
        weddingDate:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Weddingdate
        employeeId:
          anyOf:
            - type: string
            - type: 'null'
          title: Employeeid
        position:
          anyOf:
            - type: string
            - type: 'null'
          title: Position
        shipType:
          anyOf:
            - type: string
            - type: 'null'
          title: Shiptype
        contractGroup:
          anyOf:
            - type: string
            - type: 'null'
          title: Contractgroup
        payscale:
          anyOf:
            - type: string
            - type: 'null'
          title: Payscale
        internationalAirport:
          anyOf:
            - type: string
            - type: 'null'
          title: Internationalairport
        domesticAirport:
          anyOf:
            - type: string
            - type: 'null'
          title: Domesticairport
        homeAddress:
          anyOf:
            - type: string
            - type: 'null'
          title: Homeaddress
        phone:
          anyOf:
            - type: string
            - type: 'null'
          title: Phone
        linkedinUrl:
          anyOf:
            - type: string
            - type: 'null'
          title: Linkedinurl
        facebookUrl:
          anyOf:
            - type: string
            - type: 'null'
          title: Facebookurl
        instagramUrl:
          anyOf:
            - type: string
            - type: 'null'
          title: Instagramurl
        languages:
          items:
            type: string
          type: array
          title: Languages
          default: []
        drivingLicense:
          anyOf:
            - type: string
            - type: 'null'
          title: Drivinglicense
        createdAt:
          type: string
          format: date-time
          title: Createdat
        updatedAt:
          type: string
          format: date-time
          title: Updatedat
      type: object
      required:
        - userId
        - createdAt
        - updatedAt
      title: CrewProfileResponseDTO
      description: |-
        API response shape (camelCase). Same fields as the DB DTO; the
        response form keeps the surface stable even if internal naming
        evolves.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````