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

# Debtors Status in Workflow

> Returns per-debtor status (paused, next stage/time), SMS counts, and recent SMS for provided debtorIds within a workflow.

### Example Response

```json theme={null}
{
  "windowHours": 24,
  "limit": 20,
  "debtors": [
    {
      "debtorId": "24555f289-899c-4b3b-ba4a-b71a3664c671",
      "workflowId": "111c3300-bcd5-4c0b-a8ad-535b3abbdeb0",
      "paused": false,
      "nextExecutionDate": "2025-09-09T15:17:00.000Z",
      "nextStageId": "5eec7688-6721-4c52-8f8d-4d301d796b3b",
      "nextStageName": "SMS 2",
      "smsCounts": { "Delivered": 1 },
      "recentSms": [
        {
          "id": "msg_...",
          "phone_number": "+15552150663",
          "debtor_id": "24555f289-899c-4b3b-ba4a-b71a3664c671",
          "content": "templateId:48 message:Hello {debtorName}...",
          "created_at": "2025-09-08T20:11:03.676Z",
          "status": "Delivered"
        }
      ]
    }
  ]
}
```


## OpenAPI

````yaml POST /status/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:
  /status/debtors:
    post:
      summary: Per-debtor workflow status and recent SMS
      description: >-
        Returns per-debtor status (paused, next stage/time), SMS counts, and
        recent SMS for provided debtorIds within a workflow.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - workflowId
                - debtorIds
              properties:
                workflowId:
                  type: string
                  description: Workflow identifier
                debtorIds:
                  type: array
                  items:
                    type: string
                  minItems: 1
                hours:
                  type: integer
                  minimum: 1
                  maximum: 8760
                  default: 24
                limit:
                  type: integer
                  minimum: 1
                  maximum: 200
                  default: 20
      responses:
        '200':
          description: Per-debtor statuses returned
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Workflow or one or more debtors not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Upstream/internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    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

````