---
title: "POST /contracts/bulk-edit"
method: POST
path: "/contracts/bulk-edit"
tags: ["Contracts"]
---

# POST /contracts/bulk-edit

`POST /contracts/bulk-edit`

## Request

- Base URL: `https://api.kolek.com.br` (the document declares no server; this is the origin it was published from)
- URL: `https://api.kolek.com.br/contracts/bulk-edit`
- Auth: HTTP bearer

## Request body

- BulkEditContractsDto
  - `contract_uuids` string[], required: Array of contract UUIDs to edit
  - `receivable_scope` 'open_to_be_due' | 'all_open' | 'specific_month', required: Scope for applying changes to receivables: open_to_be_due (open and not yet due), all_open (all open including overdue), specific_month (specific month)
  - `specific_month` string: Specific month to apply changes (YYYY-MM format). Required when receivable_scope is SPECIFIC_MONTH.
  - `first_bill_date` string: First bill date (contract start date) in ISO format
  - `issue_day` number: Day of the month for issue date (1-31)
  - `billing_day` number: Day of the month for billing/due date (1-31)
  - `total_bill_cycles` number, nullable: Total number of bill cycles (contract duration). Use null for indeterminate/unlimited cycles.
  - `discount` number: Discount value (percentage or absolute based on discount_code)
  - `discount_code` number: Discount type: 0 = percentage, 1 = absolute value
  - `late_fee` number: Late fee value (percentage or absolute based on late_fee_code)
  - `late_fee_code` number: Late fee type: 0 = percentage, 1 = absolute value
  - `interest` number: Interest value (percentage per month or absolute per day based on interest_code)
  - `interest_code` number: Interest type: 0 = percentage per month, 1 = absolute value per day
  - `line_items` LineItemDto[]: Line items (services) to update
    - `description` string, required: Description of the service
    - `quantity` number, required: Quantity
    - `price` number, required: Price per unit
  - `replace_line_items` boolean: If true, replaces all line items. If false, appends to existing.
  - `regenerate_bankslips` boolean: If true, cancels existing bankslips and regenerates them with updated values
  - `edited_by` string, required: User ID who is making the edit

## Response `200`

Successfully edited multiple contracts and their receivables in bulk.

- BulkEditContractsResponseDto
  - `status` boolean, required: Overall status of the bulk operation
  - `message` string, required: Summary message
  - `bulk_operation_id` string, required: Unique identifier for this bulk operation
  - `total_contracts` number, required: Total number of contracts processed
  - `successful_contracts` number, required: Number of contracts successfully updated
  - `failed_contracts` number, required: Number of contracts that failed to update
  - `results` BulkEditContractResultDto[], required: Individual results for each contract
    - `contract_uuid` string, required: Contract UUID
    - `status` 'success' | 'failed' | 'partial', required: Status of the edit operation
    - `message` string, required: Descriptive message about the result
    - `receivables_updated` number, required: Number of receivables updated
    - `receivables_deleted` number, required: Number of receivables deleted (excess invoices removed)
    - `receivables_created` number, required: Number of receivables created (new invoices)
    - `bankslips_cancelled` number, required: Number of bankslips cancelled
    - `bankslips_regenerated` number, required: Number of bankslips regenerated
    - `skipped_reasons` string[]: Reasons for skipped receivables

## Other responses

- `401`: Unauthorized - User not authorized to edit contracts.
- `500`: Internal server error.

---

[API](https://skmtc.dev/kolek/apis/kolek-api.md) - [All operations](https://skmtc.dev/kolek/apis/kolek-api/llms.txt) - [OpenAPI document](https://skmtc.dev/kolek/apis/kolek-api/revisions/b10a60bfcfa4?raw)
