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

# Create upload session

> Create or retry a short-lived private S3 upload target for a CSV file. The same creditor, company, and `client_upload_id` returns the same unconsumed session with a refreshed presigned PUT URL.



## OpenAPI

````yaml /api/creditor.openapi.yaml post /import-consumers/uploads
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:
  /import-consumers/uploads:
    post:
      tags:
        - Import / Export
      summary: Create upload session
      description: >-
        Create or retry a short-lived private S3 upload target for a CSV file.
        The same creditor, company, and `client_upload_id` returns the same
        unconsumed session with a refreshed presigned PUT URL.
      operationId: creditorCreateImportUploadSession
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateImportUploadSessionRequest'
            example:
              client_upload_id: 2b0f5f25-2bf7-438c-9b09-98c2c6c77a7d
              filename: consumer-import.csv
              content_type: text/csv
              size_bytes: 1048576
      responses:
        '201':
          description: Upload session returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImportUploadSessionResponse'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '403':
          $ref: '#/components/responses/ActiveMembershipRequired'
        '409':
          $ref: '#/components/responses/Conflict'
        '422':
          $ref: '#/components/responses/ValidationError'
      security:
        - bearerAuth: []
components:
  schemas:
    CreateImportUploadSessionRequest:
      type: object
      required:
        - client_upload_id
        - filename
      properties:
        client_upload_id:
          type: string
          format: uuid
        filename:
          type: string
          maxLength: 300
          pattern: \.csv$
        content_type:
          type: string
          nullable: true
          example: text/csv
        size_bytes:
          type: integer
          nullable: true
          minimum: 1
    ImportUploadSessionResponse:
      type: object
      required:
        - message
        - data
        - upload
        - meta
      properties:
        message:
          type: string
          example: Import upload session created.
        data:
          $ref: '#/components/schemas/ImportUploadSession'
        upload:
          $ref: '#/components/schemas/ImportUploadTarget'
        meta:
          type: object
          properties:
            max_size_bytes:
              type: integer
    ImportUploadSession:
      type: object
      required:
        - id
        - client_upload_id
        - filename
        - disk
        - s3_key
        - expires_at
      properties:
        id:
          type: integer
        client_upload_id:
          type: string
          format: uuid
        filename:
          type: string
        disk:
          type: string
          example: s3
        s3_key:
          type: string
          example: >-
            import_consumers/staged/1/2/2b0f5f25-2bf7-438c-9b09-98c2c6c77a7d/consumer-import.csv
        content_type:
          type: string
          nullable: true
        size_bytes:
          type: integer
          nullable: true
        expires_at:
          type: string
          format: date-time
          nullable: true
        consumed_at:
          type: string
          format: date-time
          nullable: true
    ImportUploadTarget:
      type: object
      required:
        - url
        - headers
        - method
        - expires_at
      properties:
        url:
          type: string
          format: uri
        headers:
          type: object
          additionalProperties:
            type: string
        method:
          type: string
          enum:
            - PUT
        expires_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.
    Conflict:
      description: >-
        Resource state conflict, such as an expired or already consumed upload
        session.
      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

````