---
title: "Set Auto Apply"
method: PATCH
path: "/api/v1/admin/block/s3-invoices/auto-apply"
tags: ["Admin APIs", "block-s3-invoices"]
---

# Set Auto Apply

`PATCH /api/v1/admin/block/s3-invoices/auto-apply`

Turn automatic application on or off for a contract, or set its recurring amount.

A ``reason`` is required for the same reason ``/override`` needs one: this changes how much
a client is charged, and the row has to say who decided that and why.

The listing is returned with ``include_contract_id`` forced, so the contract just changed
comes back even when the browse rules would not have offered it — the lesson from the
override endpoint, where a successful write could look like nothing happened.

## Request body

- S3AdminAutoApplySettingRequest — The CAMS form of the same change. ``client_id`` because an operator acts on someone else's contract, and ``reason`` because changing a figure a client chose has to be explainable afterwards — the same rule the override endpoint follows.
  - `block_contract_id` string, uuid, required
  - `enabled` boolean, nullable
  - `recurring_tokens` union
    - number
    - string
  - `clear_recurring_tokens` boolean
  - `client_id` string, required
  - `reason` string, required

## Response `200`

Successful Response

- S3AdminUpcomingInvoicesResponse
  - `clients` S3AdminClientInvoices[], required
    - `client_id` string, uuid, required
    - `client_name` string, nullable
    - `available` string, required
    - `reserved` string, required
    - `remaining` string, required
    - `invoices` S3AdminInvoiceRow[], required
      - `block_contract_id` string, uuid, required
      - `block_request_id` string, uuid, nullable
      - `dataset_id` string, required
      - `dataset_label` string, nullable
      - `cut` string, nullable
      - `fee_type` string, nullable
      - `period_seq` integer, required
      - `period_start` string, date-time, nullable
      - `send_date` string, date-time, nullable
      - `edit_window_days` integer, nullable
      - `invoice_amount` string, required
      - `max_applicable_tokens` string, required
      - `applied_tokens` string, required
      - `net_due` string, required
      - `declined` boolean
      - `reservation_id` string, uuid, nullable
      - `applied_source` string, nullable
      - `applied_by` string, nullable
      - `editable` boolean
      - `auto_apply_enabled` boolean
      - `recurring_override_tokens` string, nullable
      - `auto_default_tokens` string
      - `block_invoice_draft_id` string, uuid, nullable
      - `review_state` string, nullable
      - `approval_overdue_at` string, date-time, nullable
  - `total_clients` integer, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/carbonarc/apis/carbon-arc-client-admin-api.md) · [All operations](https://skmtc.net/carbonarc/apis/carbon-arc-client-admin-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/carbonarc/carbon-arc-client-admin-api/revisions/a8ca30023371/schema)
