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

# Update Customer

> Update a single customer record within a campaign.

### 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="loan_id" type="string">
  The Loan ID identifying the record. **Required** if `lead_id` is not provided.
</ParamField>

<ParamField body="lead_id" type="string">
  The Lead ID identifying the record. **Required** if `loan_id` is not provided.
</ParamField>

<ParamField body="data" type="object" required>
  An object containing the key-value pairs of the fields to update.

  <Expandable title="example properties">
    <ParamField body="payment_status" type="string">Updated payment status.</ParamField>
    <ParamField body="first_name" type="string">Corrected first name.</ParamField>
    <ParamField body="phone_number" type="string">New contact number.</ParamField>
  </Expandable>
</ParamField>

### Response

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

<ResponseField name="message" type="string">
  A confirmation message.
</ResponseField>

<ResponseField name="data" type="object">
  <Expandable title="properties">
    <ResponseField name="id" type="string">
      The ID of the updated record.
    </ResponseField>

    <ResponseField name="result" type="string">
      The result status (e.g., "updated").
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="error" type="string">
  The error type or code (Error responses only).
</ResponseField>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "success": true,
    "message": "Customer data updated successfully",
    "data": {
      "id": "loan_12345",
      "result": "updated"
    }
  }

  ```

  ```json 400 Bad Request theme={null}
  {
    "success": false,
    "message": "Validation failed",
    "errors": [
      "Either loan_id or lead_id is required"
    ]
  }

  ```

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

  ```

  ```json 404 Not Found theme={null}
  {
    "success": false,
    "message": "Customer record not found"
  }

  ```

  ```json 409 Conflict theme={null}
  {
    "success": false,
    "message": "Version conflict: Record was modified by another process. Please retry."
  }

  ```

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

  ```
</ResponseExample>
