---
title: "Update credit spend policy"
method: PUT
path: "/billing/credits/spend-policies/{spend_policy_id}"
tags: ["credits"]
---

# Update credit spend policy

`PUT /billing/credits/spend-policies/{spend_policy_id}`

## Request

- Base URL: `https://api.schematichq.com`
- URL: `https://api.schematichq.com/billing/credits/spend-policies/{spend_policy_id}`
- Auth: API key in header `X-Schematic-Api-Key`

## Path parameters

- `spend_policy_id` string, required

## Request body

- UpdateCreditSpendPolicyRequestBody
  - `label` string, nullable
  - `max_per_draw` number, double, nullable
  - `window_amount` number, double, nullable
  - `window_unit` 'hour' | 'day' | 'week' | 'month' | 'billing_period'

## Response `200`

OK

- object
  - `data` CreditSpendPolicyResponseData, required
    - `billing_credit_id` string, required
    - `company_id` string, nullable: The company the policy applies in
    - `consumed` number, double, nullable: Credits spent in the current window. Set only by the usage route, and only for a window cap.
    - `created_at` string, date-time, required
    - `headroom` number, double, nullable: Credits left in the current window. Set only by the usage route, and only for a window cap.
    - `id` string, required
    - `label` string, nullable
    - `max_per_draw` number, double, nullable
    - `resets_at` string, date-time, nullable: When the current window ends. Set only by the usage route, and only for a window cap.
    - `scope_type` 'company' | 'user' | 'group', required
    - `updated_at` string, date-time, required
    - `user_id` string, nullable: For a user policy, the user whose spend in the company it limits
    - `window_amount` number, double, nullable
    - `window_count` integer, required
    - `window_unit` 'hour' | 'day' | 'week' | 'month' | 'billing_period'
  - `params` object, required: Input parameters

## Other responses

- `400`: Bad request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not found
- `500`: Server error

## Changes

> 230 revisions in range; 1 not diffed.

- **2026-10-19** `a021f209a793`: 2 warning, 2 info
  - added the new `month` enum value to the `data/window_unit/allOf[#/components/schemas/CreditSpendWindowUnit]/` response property for the response status `200`
  - added the new `week` enum value to the `data/window_unit/allOf[#/components/schemas/CreditSpendWindowUnit]/` response property for the response status `200`
  - added the new `month` enum value to the request property `window_unit/allOf[#/components/schemas/CreditSpendWindowUnit]/`
  - added the new `week` enum value to the request property `window_unit/allOf[#/components/schemas/CreditSpendWindowUnit]/`
- **2026-10-05** `bd39f70605e4`: 8 info
  - added the new optional request property `window_amount`
  - added the new optional request property `window_unit`
  - added the optional property `data/consumed` to the response with the `200` status
  - added the optional property `data/headroom` to the response with the `200` status
  - …4 more
- **2026-09-02** `3d18f4ee08ee`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/schematichq/apis/schematic-api/changes/billing/credits/spend-policies/:spend_policy_id/put.md)

---

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