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

# Bulk Update Customer

> Update multiple customer records in a single request.

### Headers

<ParamField header="Authorization" type="string" required>
  Bearer token for authentication (e.g., `Bearer <your_token>`).
</ParamField>

### Body Parameters

<ParamField body="campaignId" type="string" required>
  The unique identifier of the campaign (e.g., `camp_abc123`).
</ParamField>

<ParamField body="records" type="array" required>
  Array of record objects to update (Max 10,000 items).

  <Expandable title="item properties">
    <ParamField body="id" type="string" required>
      The `loan_id` or `lead_id` identifying the record.
    </ParamField>

    <ParamField body="data" type="object" required>
      Key-value pairs of fields to update for this specific record.
    </ParamField>
  </Expandable>
</ParamField>

### Response

<ResponseField name="success" type="boolean">
  Indicates if the overall operation was successful.
</ResponseField>

<ResponseField name="message" type="string">
  A summary message (e.g., "Updated 500 of 500 records").
</ResponseField>

<ResponseField name="results" type="object">
  Detailed execution statistics.

  <Expandable title="properties">
    <ResponseField name="total" type="integer">Total records received.</ResponseField>
    <ResponseField name="valid" type="integer">Records passing initial validation.</ResponseField>
    <ResponseField name="invalid" type="integer">Records failing initial validation.</ResponseField>
    <ResponseField name="successful" type="integer">Successfully updated records.</ResponseField>
    <ResponseField name="failed" type="integer">Records that failed to update.</ResponseField>
    <ResponseField name="retried" type="integer">Records retried due to version conflicts.</ResponseField>
    <ResponseField name="errors" type="array">List of specific error details for failed records.</ResponseField>
    <ResponseField name="invalidRecords" type="array">List of records that failed validation.</ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "success": true,
    "message": "Updated 2 of 2 records",
    "results": {
      "total": 2,
      "valid": 2,
      "invalid": 0,
      "successful": 2,
      "failed": 0,
      "retried": 0,
      "batchesProcessed": 1,
      "errors": []
    }
  }

  ```

  ```json 207 Partial Success theme={null}
  {
    "success": false,
    "message": "Updated 1 of 2 records",
    "results": {
      "total": 2,
      "valid": 2,
      "invalid": 0,
      "successful": 1,
      "failed": 1,
      "retried": 1,
      "errors": [
        {
          "id": "loan_67890",
          "error": "document_missing_exception",
          "reason": "Document not found"
        }
      ]
    }
  }

  ```

  ```json 400 Bad Request theme={null}
  {
    "success": false,
    "message": "Validation failed",
    "errors": [
      "records cannot exceed 10000 items per request"
    ]
  }

  ```

  ```json 403 Forbidden theme={null}
  {
    "success": false,
    "message": "Campaign ID invalid or mismatch for your organization."
  }

  ```

  ```json 500 Server Error theme={null}
  {
    "success": false,
    "error": "InternalServerError",
    "message": "An unexpected error occurred"
  }

  ```
</ResponseExample>
