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

# Update header profile mapping

> Save header field mappings. Set `is_mapped` to false to finish later with a partial mapping, or true to require all required fields and complete the setup wizard header-profile step.



## OpenAPI

````yaml /api/creditor.openapi.yaml put /header-profiles/{csvHeader}
openapi: 3.1.0
info:
  title: YouNegotiate Creditor API
  version: '2.0'
  description: >-
    Stateless API endpoints for creditor portal authentication and account
    access.
servers:
  - url: https://api.creditor.younegotiate.com
    description: Production
security: []
tags:
  - name: System
    description: Public creditor domain system and health endpoints.
  - name: Authentication
    description: Creditor registration, login, password, and email verification endpoints.
  - name: Account Settings
    description: >-
      Authenticated creditor profile, contact, operating-hours, and
      profile-image endpoints.
  - name: Account Profile
    description: >-
      Creditor onboarding profile, membership, billing, and setup status
      endpoints.
  - name: Setup Wizard
    description: >-
      Creditor setup wizard status, required-step completion, and optional-step
      completion.
  - name: Dashboard
    description: Creditor dashboard work queues and performance widgets.
  - name: Import / Export
    description: >-
      Creditor consumer import upload sessions, queued imports, history,
      downloads, and failed-row files.
  - name: Membership Settings
    description: >-
      Creditor membership dashboard, plan changes, payment method, cancellation,
      special-plan inquiry, and over-limit retry endpoints.
  - name: Merchant Account
    description: >-
      Existing merchant processor credentials, Tilled onboarding, and merchant
      application endpoints.
  - name: Header Profiles
    description: >-
      CSV header profile upload, mapping, download, and setup wizard completion
      endpoints.
  - name: SFTP Connections
    description: >-
      Creditor-managed SFTP connection profiles for imports, exports, and setup
      wizard completion.
  - name: Sub Accounts
    description: >-
      Creditor-managed sub account list, export, create, update, and delete
      endpoints.
  - name: Pay Terms Offers
    description: >-
      Creditor-managed master, sub-account, group, and group-sub-account Pay
      Terms endpoints.
  - name: Individual Custom Offers
    description: Creditor individual custom offer list endpoints.
  - name: Negotiations
    description: >-
      Creditor negotiation work queues, including notice responses and offer
      review counts.
  - name: Communications / CFPB Validation Letter
    description: >-
      CFPB Validation Letter tables, secure EcoLetter send/resend, CSV export,
      and print/download actions.
  - name: Communications / EcoLetter Template
    description: >-
      Creditor EcoLetter template management for secure eLetter communications
      and campaigns.
  - name: Communications / Groups
    description: >-
      Creditor communication group management for dynamic consumer targeting and
      campaign selection.
  - name: Communications / Schedule Campaign
    description: >-
      Creditor EcoLetter campaign scheduling, quote, immediate send, and
      delivery queue endpoints.
  - name: Communications / Campaign Tracker
    description: >-
      Creditor campaign tracker reporting, refresh, and consumer export
      endpoints.
  - name: Consumer Profiles
    description: Creditor Consumer Profiles list, filter options, and CSV export endpoints.
  - name: Terms & Conditions
    description: Creditor-managed master and sub-account Terms & Conditions templates.
  - name: About Us & Contact
    description: Creditor-managed company About Us content shown to consumers.
  - name: Logo & Links
    description: >-
      Creditor-managed master and sub-account personalized logo colors, size,
      and consumer link metadata.
  - name: Users
    description: >-
      Master creditor user management, invitations, and account deletion
      endpoints.
paths:
  /header-profiles/{csvHeader}:
    put:
      tags:
        - Header Profiles
      summary: Update header profile mapping
      description: >-
        Save header field mappings. Set `is_mapped` to false to finish later
        with a partial mapping, or true to require all required fields and
        complete the setup wizard header-profile step.
      operationId: creditorUpdateHeaderProfileMapping
      parameters:
        - $ref: '#/components/parameters/CsvHeaderId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateHeaderProfileRequest'
            example:
              date_format: Y-m-d
              is_mapped: true
              mapped_headers:
                account_number: Account Number
                member_account_number: Member Account Number
                original_account_name: Original Account Name
                first_name: First Name
                last_name: Last Name
                dob: Date of Birth
                last4ssn: SSN
                current_balance: Balance
                email1: Email
                mobile1: Mobile
                address1: Address 1
                city: City
                state: State
                zip: Zip
      responses:
        '200':
          description: Header profile mapping saved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CsvHeaderProfileMutationResponse'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '403':
          $ref: '#/components/responses/ActiveMembershipRequired'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/ValidationError'
      security:
        - bearerAuth: []
components:
  parameters:
    CsvHeaderId:
      name: csvHeader
      in: path
      required: true
      description: CSV header profile ID.
      schema:
        type: integer
  schemas:
    UpdateHeaderProfileRequest:
      type: object
      required:
        - date_format
        - is_mapped
        - mapped_headers
      properties:
        date_format:
          type: string
          enum:
            - d/m/Y
            - m/d/Y
            - Y/m/d
            - d-m-Y
            - m-d-Y
            - Y-m-d
        is_mapped:
          type: boolean
          description: >-
            When true, all required fields must be mapped and the setup wizard
            header-profile step can complete.
        mapped_headers:
          type: object
          additionalProperties:
            type: string
          description: >-
            Object keyed by YouNegotiate consumer field value, with values
            matching uploaded CSV header names.
    CsvHeaderProfileMutationResponse:
      type: object
      required:
        - message
        - data
      properties:
        message:
          type: string
          example: Header profile saved.
        data:
          $ref: '#/components/schemas/CsvHeaderProfile'
    CsvHeaderProfile:
      type: object
      additionalProperties: true
      properties:
        id:
          type: integer
        company_id:
          type: integer
        subclient_id:
          type: integer
          nullable: true
        name:
          type: string
        headers:
          type: array
          items:
            type: string
          example:
            - Account Number
            - First Name
            - Last Name
        date_format:
          type: string
          nullable: true
          example: Y-m-d
        mapped_headers:
          type: object
          additionalProperties:
            type: string
          example:
            account_number: Account Number
            first_name: First Name
        required_fields:
          type: array
          items:
            type: string
          example:
            - account_number
            - first_name
            - last_name
        suggested_mapped_headers:
          type: object
          additionalProperties:
            type: string
          description: >-
            Auto-detected mapping suggestions when no mapping has been saved,
            otherwise the saved mapping.
        auto_detected_fields:
          type: array
          items:
            type: string
          description: >-
            Field values auto-detected from uploaded headers when no mapping has
            been saved.
        is_mapped:
          type: boolean
        sftp_connection_id:
          type: integer
          nullable: true
        sftp_connection:
          type: object
          nullable: true
          properties:
            id:
              type: integer
            name:
              type: string
        created_at:
          type: string
          format: date-time
          nullable: true
        updated_at:
          type: string
          format: date-time
          nullable: true
    MessageResponse:
      type: object
      required:
        - message
      properties:
        message:
          type: string
    ValidationErrorResponse:
      type: object
      required:
        - message
        - errors
      properties:
        message:
          type: string
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
  responses:
    Unauthenticated:
      description: Missing or invalid bearer token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MessageResponse'
    ActiveMembershipRequired:
      description: Authenticated creditor does not have an active membership.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MessageResponse'
          example:
            message: An active membership is required.
    NotFound:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MessageResponse'
    ValidationError:
      description: Request validation failed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Sanctum token

````