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

# Update Budget thresholds or state

> Changes thresholds or the active/paused state by compare-and-swap: expected_version must equal the Budget's current version or the request conflicts.



## OpenAPI

````yaml /openapi.json patch /v1/budgets/{id}
openapi: 3.1.0
info:
  title: Checkfu API
  version: '2026-08-31'
  description: >-
    Authentication is declared per operation: API-key, runtime, or connector
    bearer; Automation signature; or credential-free pairing redemption. Every
    general Checkfu REST request requires the dated `Checkfu-Version` header
    (one of: 2026-08-31); the three MCP JSON-RPC transports use
    `MCP-Protocol-Version`, A2A uses `A2A-Version`, and the provider OAuth
    callback carries neither Checkfu header. API keys resolve one Workspace
    without a request selector; authenticated responses identify it with
    `Checkfu-Workspace-Id`.
servers:
  - url: https://api.checkfu.com
security:
  - bearerAuth: []
tags:
  - name: organizations
  - name: sourceRepositories
  - name: tenants
  - name: workspaces
  - name: principals
  - name: principalGroups
  - name: principalAccessCredentials
  - name: apiKeys
  - name: agents
  - name: harnessRuntime
  - name: permissionAssignments
  - name: actionPolicies
  - name: files
  - name: memoryStores
  - name: modelCredentials
  - name: modelRoutingProfiles
  - name: toolSources
  - name: skills
  - name: skillSources
  - name: agentBlueprints
  - name: skillProposals
  - name: instructionProposals
  - name: catalog
  - name: managedTools
  - name: concepts
  - name: support
  - name: connections
  - name: connectionVaults
  - name: connectionAssignments
  - name: connectedRuntimes
  - name: fileTrees
  - name: collaboration
  - name: automationGraphs
  - name: automations
  - name: actionApprovals
  - name: standingApprovals
  - name: workloadReviewPolicies
  - name: usage
  - name: models
  - name: outcomes
  - name: budgets
  - name: billing
  - name: sessions
  - name: audit
  - name: sessionExports
  - name: runs
  - name: runnerPools
  - name: transcripts
  - name: sessionWatches
  - name: sessionCapsules
  - name: sessionTrajectories
  - name: webhookEndpoints
  - name: integrationGateway
  - name: workEnvironments
  - name: computers
  - name: computerScreens
  - name: computerBrowserObservations
  - name: computerBrowserActions
  - name: environments
  - name: computerHeadlessOperations
  - name: vaults
  - name: apiMcp
  - name: a2a
paths:
  /v1/budgets/{id}:
    patch:
      tags:
        - budgets
      summary: Update Budget thresholds or state
      description: >-
        Changes thresholds or the `active`/`paused` state by compare-and-swap:
        `expected_version` must equal the Budget's current version or the
        request conflicts. Scope, metric, and window are immutable and cannot be
        patched. Budget configuration is snapshotted by each claim, so an edit
        governs later claims only and never retroactively changes an in-flight
        reservation. Send `Idempotency-Key` for safe retries.


        Checkfu support posture: alpha; hosted. Required evidence journey:
        governance-registry. Deployment-specific readiness and the latest proven
        release are available from GET /v1/support/capabilities.
      operationId: budgets.patchBudget
      parameters:
        - name: id
          in: path
          schema:
            $ref: '#/components/schemas/BudgetId'
          required: true
        - name: checkfu-version
          in: header
          schema:
            type: string
            enum:
              - '2026-08-31'
          required: true
        - name: idempotency-key
          in: header
          schema:
            type: string
            allOf:
              - maxLength: 255
          required: false
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                expected_version:
                  $ref: '#/components/schemas/BudgetPositiveSafeInteger'
                soft_threshold:
                  anyOf:
                    - $ref: '#/components/schemas/Objects_161'
                    - type: 'null'
                hard_threshold:
                  $ref: '#/components/schemas/Objects_162'
                state:
                  $ref: '#/components/schemas/Union_311'
              required:
                - expected_version
              additionalProperties: false
        required: true
      responses:
        '200':
          description: a session_lifetime window only on a session-scoped Budget
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BudgetSessionLifetimeWindowScope_3'
          headers:
            checkfu-workspace-id:
              description: The Workspace resolved from the authenticated bearer credential.
              required: true
              schema:
                $ref: '#/components/schemas/WorkspaceId'
        '400':
          description: Typed Checkfu wire error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationMalformedError'
        '401':
          description: Typed Checkfu wire error
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - type
                      - message
                      - more
                    properties:
                      type:
                        type: string
                        enum:
                          - auth.invalid_key
                      message:
                        type: string
                      more:
                        type: string
                        enum:
                          - >-
                            https://docs.checkfu.com/reference/errors#auth-invalid-key
                        description: >-
                          Stable public documentation and remedy for this error
                          type.
                    additionalProperties: false
                additionalProperties: false
        '403':
          description: >-
            The organization, tenant, or workspace backing this key is
            administratively disabled. | Deployment governance or retention
            policy denied the request.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - error
                    properties:
                      error:
                        type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - auth.disabled_tenancy
                          message:
                            type: string
                          more:
                            type: string
                            enum:
                              - >-
                                https://docs.checkfu.com/reference/errors#auth-disabled-tenancy
                            description: >-
                              Stable public documentation and remedy for this
                              error type.
                        required:
                          - type
                          - message
                          - more
                        additionalProperties: false
                    additionalProperties: false
                  - $ref: '#/components/schemas/PolicyDeniedError'
        '404':
          description: >-
            The requested resource does not exist in the resolved deployment
            boundary.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationNotFoundError'
        '409':
          description: >-
            The request conflicts with the resource's current state. | An
            idempotent mutation conflicts with a completed or in-progress
            request for the same key.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/ValidationConflictError'
                  - $ref: '#/components/schemas/IdempotencyConflictError'
        '429':
          description: Typed Checkfu wire error
          headers:
            retry-after:
              description: >-
                Delay in seconds for rate limits or deployment quotas with a
                known release or UTC reset boundary
              required: false
              schema:
                type: integer
                minimum: 1
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - type
                      - message
                      - more
                    properties:
                      type:
                        type: string
                        enum:
                          - budget.exceeded
                      message:
                        type: string
                      more:
                        type: string
                        enum:
                          - >-
                            https://docs.checkfu.com/reference/errors#budget-exceeded
                        description: >-
                          Stable public documentation and remedy for this error
                          type.
                    additionalProperties: false
                additionalProperties: false
        '500':
          description: >-
            An unexpected internal failure occurred; the message contains an
            opaque incident reference.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RuntimeInternalError'
      security:
        - bearerAuth: []
components:
  schemas:
    BudgetId:
      type: string
      pattern: ^bgt_[0-9a-f]{32}$
    BudgetPositiveSafeInteger:
      type: integer
      exclusiveMinimum: 0
    Objects_161:
      type: object
      properties:
        limit:
          $ref: '#/components/schemas/BudgetPositiveSafeInteger'
        action:
          type: string
          enum:
            - notify
      required:
        - limit
        - action
      additionalProperties: false
    Objects_162:
      type: object
      properties:
        limit:
          $ref: '#/components/schemas/BudgetPositiveSafeInteger'
        breach_action:
          $ref: '#/components/schemas/BudgetBreachAction'
      required:
        - limit
        - breach_action
      additionalProperties: false
    Union_311:
      type: string
      enum:
        - active
        - paused
    BudgetSessionLifetimeWindowScope_3:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/BudgetId'
        workspace_id:
          $ref: '#/components/schemas/WorkspaceId'
        scope:
          $ref: '#/components/schemas/Union_308'
        metric:
          $ref: '#/components/schemas/Union_207'
        window:
          $ref: '#/components/schemas/Union_309'
        soft_threshold:
          $ref: '#/components/schemas/Union_310'
        hard_threshold:
          $ref: '#/components/schemas/Objects_162'
        state:
          $ref: '#/components/schemas/Union_311'
        version:
          $ref: '#/components/schemas/BudgetPositiveSafeInteger'
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - id
        - workspace_id
        - scope
        - metric
        - window
        - soft_threshold
        - hard_threshold
        - state
        - version
        - created_at
        - updated_at
      additionalProperties: false
    WorkspaceId:
      type: string
      pattern: ^wrkspc_[0-9a-f]{32}$
    ValidationMalformedError:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - validation.malformed
            message:
              type: string
            more:
              type: string
              enum:
                - https://docs.checkfu.com/reference/errors#validation-malformed
              description: Stable public documentation and remedy for this error type.
          required:
            - type
            - message
            - more
          additionalProperties: false
      required:
        - error
      additionalProperties: false
      description: >-
        The request could not be decoded or violated a declared input
        constraint.
    PolicyDeniedError:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - policy.denied
            message:
              type: string
            more:
              type: string
              enum:
                - https://docs.checkfu.com/reference/errors#policy-denied
              description: Stable public documentation and remedy for this error type.
          required:
            - type
            - message
            - more
          additionalProperties: false
      required:
        - error
      additionalProperties: false
      description: Deployment governance or retention policy denied the request.
    ValidationNotFoundError:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - validation.not_found
            message:
              type: string
            more:
              type: string
              enum:
                - https://docs.checkfu.com/reference/errors#validation-not-found
              description: Stable public documentation and remedy for this error type.
          required:
            - type
            - message
            - more
          additionalProperties: false
      required:
        - error
      additionalProperties: false
      description: >-
        The requested resource does not exist in the resolved deployment
        boundary.
    ValidationConflictError:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - validation.conflict
            message:
              type: string
            more:
              type: string
              enum:
                - https://docs.checkfu.com/reference/errors#validation-conflict
              description: Stable public documentation and remedy for this error type.
          required:
            - type
            - message
            - more
          additionalProperties: false
      required:
        - error
      additionalProperties: false
      description: The request conflicts with the resource's current state.
    IdempotencyConflictError:
      anyOf:
        - $ref: '#/components/schemas/ValidationIdempotencyConflictError'
        - $ref: '#/components/schemas/ValidationIdempotencyInProgressError'
      description: >-
        An idempotent mutation conflicts with a completed or in-progress request
        for the same key.
    RuntimeInternalError:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - runtime.internal
            message:
              type: string
            more:
              type: string
              enum:
                - https://docs.checkfu.com/reference/errors#runtime-internal
              description: Stable public documentation and remedy for this error type.
          required:
            - type
            - message
            - more
          additionalProperties: false
      required:
        - error
      additionalProperties: false
      description: >-
        An unexpected internal failure occurred; the message contains an opaque
        incident reference.
    BudgetBreachAction:
      type: string
      enum:
        - block_admission
        - interrupt_turn
        - pause_session
      description: The decided hard-threshold action for one reached Budget cap.
    Union_308:
      anyOf:
        - type: object
          properties:
            kind:
              type: string
              enum:
                - workspace
            agent_id: false
            principal_id: false
            collaboration_space_id: false
            automation_id: false
            session_id: false
          required:
            - kind
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - agent_definition
            agent_id:
              $ref: '#/components/schemas/AgentId'
            principal_id: false
            collaboration_space_id: false
            automation_id: false
            session_id: false
          required:
            - kind
            - agent_id
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - principal
            principal_id:
              $ref: '#/components/schemas/PrincipalId'
            agent_id: false
            collaboration_space_id: false
            automation_id: false
            session_id: false
          required:
            - kind
            - principal_id
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - collaboration_space
            collaboration_space_id:
              $ref: '#/components/schemas/CollaborationSpaceId'
            agent_id: false
            principal_id: false
            automation_id: false
            session_id: false
          required:
            - kind
            - collaboration_space_id
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - automation
            automation_id:
              $ref: '#/components/schemas/AutomationId'
            agent_id: false
            principal_id: false
            collaboration_space_id: false
            session_id: false
          required:
            - kind
            - automation_id
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - session
            session_id:
              $ref: '#/components/schemas/SessionId'
            agent_id: false
            principal_id: false
            collaboration_space_id: false
            automation_id: false
          required:
            - kind
            - session_id
          additionalProperties: false
    Union_207:
      type: string
      enum:
        - model_tokens
        - model_spend
        - session_runtime_ms
        - web_search_requests
        - total_spend
    Union_309:
      anyOf:
        - type: object
          properties:
            kind:
              type: string
              enum:
                - rolling
            duration_seconds:
              $ref: '#/components/schemas/BudgetPositiveSafeInteger'
          required:
            - kind
            - duration_seconds
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - calendar_month
            duration_seconds: false
          required:
            - kind
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - session_lifetime
            duration_seconds: false
          required:
            - kind
          additionalProperties: false
    Union_310:
      anyOf:
        - $ref: '#/components/schemas/Objects_161'
        - type: 'null'
    ValidationIdempotencyConflictError:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - validation.idempotency_conflict
            message:
              type: string
            more:
              type: string
              enum:
                - >-
                  https://docs.checkfu.com/reference/errors#validation-idempotency-conflict
              description: Stable public documentation and remedy for this error type.
          required:
            - type
            - message
            - more
          additionalProperties: false
      required:
        - error
      additionalProperties: false
      description: The Idempotency-Key is already bound to a different request.
    ValidationIdempotencyInProgressError:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - validation.idempotency_in_progress
            message:
              type: string
            more:
              type: string
              enum:
                - >-
                  https://docs.checkfu.com/reference/errors#validation-idempotency-in-progress
              description: Stable public documentation and remedy for this error type.
          required:
            - type
            - message
            - more
          additionalProperties: false
      required:
        - error
      additionalProperties: false
      description: >-
        An identical idempotent request is still in progress and may be retried
        later.
    AgentId:
      type: string
      pattern: ^agent_[0-9a-f]{32}$
    PrincipalId:
      type: string
      pattern: ^prin_[0-9a-f]{32}$
    CollaborationSpaceId:
      type: string
      pattern: ^cspace_[0-9a-f]{32}$
    AutomationId:
      type: string
      pattern: ^auto_[0-9a-f]{32}$
    SessionId:
      type: string
      pattern: ^sess_[0-9a-f]{32}$
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.