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

# Bulk Create Debtors

> Creates multiple debtor records in bulk



## OpenAPI

````yaml POST /debtors
openapi: 3.0.1
info:
  title: CollectWise API
  description: >-
    An API for managing debtors, tracking statuses, and automating debt
    collection processes
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://collectwiseapi.com
security:
  - apiKey: []
paths:
  /debtors:
    post:
      summary: Create multiple debtors
      description: Creates multiple debtor records in bulk
      requestBody:
        description: Array of debtor information to add
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/NewDebtor'
              minItems: 1
      responses:
        '200':
          description: Bulk debtor creation response
          content:
            application/json:
              schema:
                type: object
                properties:
                  createdDebtors:
                    type: array
                    items:
                      $ref: '#/components/schemas/DebtorResponse'
                  failedDebtors:
                    type: array
                    items:
                      type: object
                      properties:
                        index:
                          type: integer
                          description: Index of the failed debtor in the input array
                        error:
                          $ref: '#/components/schemas/Error'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    NewDebtor:
      type: object
      required:
        - debtorName
        - totalUnpaidDebt
        - delinquencyDate
        - phoneNumber
        - email
        - productOrService
        - creditorName
      properties:
        debtorName:
          type: string
          description: Full name of the debtor
        totalUnpaidDebt:
          type: number
          format: float
          description: Total amount of unpaid debt
        delinquencyDate:
          type: string
          format: date
          description: Date when the debt became delinquent
        phoneNumber:
          type: string
          description: Contact phone number of the debtor
        email:
          type: string
          format: email
          description: Email address of the debtor
        callbackNumber:
          type: string
          description: Callback phone number
        productOrService:
          type: string
          description: Name of the product or service delivered to the debtor
        creditorName:
          type: string
          description: Name of the creditor
        creditorEmail:
          type: string
          format: email
          description: Email address of the creditor
        accountNumber:
          type: string
          description: Account number associated with the debt
        address:
          type: string
          description: Street address of the debtor
        city:
          type: string
          description: City of the debtor
        state:
          type: string
          description: State of the debtor
        zipCode:
          type: string
          description: ZIP code of the debtor
        county:
          type: string
          description: County of the debtor
        ssn:
          type: string
          description: Social Security Number of the debtor
        lastPayDate:
          type: string
          format: date
          description: Date of the last payment made by the debtor
        chargeOffDate:
          type: string
          format: date
          description: Date when the debt was charged off, if applicable
        interestDue:
          type: number
          format: float
          description: Amount of interest due on the debt
        principalDue:
          type: number
          format: float
          description: Amount of principal due on the debt
        otherFees:
          type: number
          format: float
          description: Other fees associated with the debt
        amountPaid:
          type: number
          format: float
          description: Total amount paid by the debtor so far
        paymentLink:
          type: string
          description: >-
            Link where the debtor can pay their balance, included in outreach.
            Accepts a full URL or a domain (e.g., https://example.com/pay or
            www.example.com).
        customWorkflowID:
          type: string
          description: Custom workflow identifier for the debtor
        agentName:
          type: string
          description: Name of the agent to attribute workflow enrollment to
        customization:
          type: string
          description: >-
            Custom instructions for AI collection workflow (e.g., tone, channel
            preferences, frequency). If not provided, the system will generate
            an optimal collection flow.
    DebtorResponse:
      type: object
      properties:
        debtorId:
          type: string
          description: Unique identifier of the debtor
        debtorName:
          type: string
          description: Full name of the debtor
        totalUnpaidDebt:
          type: number
          format: float
          description: Total amount of unpaid debt
        delinquencyDate:
          type: string
          format: date
          description: Date when the debt became delinquent
        phoneNumber:
          type: string
          description: Contact phone number of the debtor
        email:
          type: string
          format: email
          description: Email address of the debtor
        callbackNumber:
          type: string
          description: Callback phone number
        productOrService:
          type: string
          description: Name of the product or service delivered to the debtor
        creditorName:
          type: string
          description: Name of the creditor
        creditorEmail:
          type: string
          format: email
          description: Creditor email if provided
        lastUpdated:
          type: string
          format: date-time
          description: Timestamp of the last update to this record
        accountNumber:
          type: string
          description: Account number associated with the debt
        address:
          type: string
          description: Street address of the debtor
        city:
          type: string
          description: City of the debtor
        state:
          type: string
          description: State of the debtor
        zipCode:
          type: string
          description: ZIP code of the debtor
        county:
          type: string
          description: County of the debtor
        ssn:
          type: string
          description: Social Security Number of the debtor
        lastPayDate:
          type: string
          format: date
          description: Date of the last payment made by the debtor
        chargeOffDate:
          type: string
          format: date
          description: Date when the debt was charged off, if applicable
        interestDue:
          type: number
          format: float
          description: Amount of interest due on the debt
        principalDue:
          type: number
          format: float
          description: Amount of principal due on the debt
        otherFees:
          type: number
          format: float
          description: Other fees associated with the debt
        amountPaid:
          type: number
          format: float
          description: Total amount paid by the debtor so far
        paymentLink:
          type: string
          nullable: true
          description: Payment link associated with the debtor
        customWorkflowID:
          type: string
          description: Custom workflow identifier for the debtor
        enrollment:
          type: object
          description: Present only when customWorkflowID is provided
          properties:
            attempted:
              type: boolean
            success:
              type: boolean
            message:
              type: string
            workflowId:
              type: string
            agentName:
              type: string
              description: >-
                Agent name passed in the request. This is echoed back; if not
                provided, the service falls back internally to
                merchantName/email, but only the raw agentName is returned here.
        customization:
          type: string
          description: >-
            Custom instructions for AI collection workflow (e.g., tone, channel
            preferences, frequency). If not provided, the system will generate
            an optimal collection flow.
      required:
        - debtorId
        - debtorName
        - totalUnpaidDebt
        - delinquencyDate
        - creditorName
        - lastUpdated
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: integer
          format: int32
          description: Error code
        message:
          type: string
          description: Error message
      example:
        code: 400
        message: 'Invalid input: debtorName is required'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: collectwise_key

````