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

# Update topup

> Update the automatic topup settings



## OpenAPI

````yaml https://api.getcargo.io/openapi.json put /billing/subscriptions/topup
openapi: 3.1.0
info:
  title: Cargo API
  version: 1.0.0
  description: Cargo Platform API v1
servers:
  - url: https://api.getcargo.io/v1
    description: Cargo API
security:
  - bearerAuth: []
paths:
  /billing/subscriptions/topup:
    put:
      tags:
        - Billing - Subscription
      summary: Update topup
      description: Update the automatic topup settings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                enabled:
                  type: boolean
                  title: Enabled
                  description: Whether top-ups are enabled.
                threshold:
                  type: number
                  title: Threshold
                  description: Credit threshold that triggers a top-up.
                creditsCount:
                  type: number
                  title: Credits count
                  description: Number of credits to top up.
              required:
                - enabled
                - threshold
                - creditsCount
              additionalProperties: false
              title: Request body
              description: Request body schema.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  subscription:
                    type: object
                    properties:
                      uuid:
                        type: string
                      workspaceUuid:
                        type: string
                      provider:
                        type: string
                        enum:
                          - stripe
                          - orb
                      customerOrbId:
                        type: string
                      customerStripeId:
                        type: string
                      subscriptionStatus:
                        anyOf:
                          - type: string
                          - type: 'null'
                      subscriptionStripeId:
                        anyOf:
                          - type: string
                          - type: 'null'
                      subscriptionAvailableCreditsCount:
                        type: number
                      subscriptionCreditsUsedCount:
                        type: number
                      additionalAvailableCreditsCount:
                        type: number
                      hasCredits:
                        type: boolean
                      creditsOverageBehaviors:
                        type: array
                        items:
                          type: object
                          properties:
                            unit:
                              type: string
                              enum:
                                - billing.credits
                                - storage.records
                                - orchestration.executions
                            action:
                              type: string
                              enum:
                                - deny
                                - allow
                          required:
                            - unit
                            - action
                          additionalProperties: false
                      creditsConsumptionBehaviors:
                        type: array
                        items:
                          type: object
                          properties:
                            unit:
                              type: string
                              enum:
                                - billing.credits
                                - storage.records
                                - orchestration.executions
                            action:
                              type: string
                              enum:
                                - deny
                                - allow
                          required:
                            - unit
                            - action
                          additionalProperties: false
                      createdAt:
                        type: string
                      updatedAt:
                        type: string
                      plan:
                        type: string
                        enum:
                          - self-serve
                          - enterprise
                      cadence:
                        type: string
                        enum:
                          - monthly
                          - annual
                          - one_time
                          - quarterly
                          - semi_annual
                          - custom
                      fixedPrice:
                        type: number
                      conversionRate:
                        type: number
                      startAt:
                        type: string
                      resetAt:
                        type: string
                      endAt:
                        anyOf:
                          - type: string
                          - type: 'null'
                      hasPendingChange:
                        type: boolean
                      futureChange:
                        anyOf:
                          - type: object
                            properties:
                              cadence:
                                type: string
                                enum:
                                  - monthly
                                  - annual
                                  - one_time
                                  - quarterly
                                  - semi_annual
                                  - custom
                              fixedPrice:
                                type: number
                              creditsCount:
                                type: number
                              conversionRate:
                                type: number
                              startAt:
                                type: string
                              endAt:
                                anyOf:
                                  - type: string
                                  - type: 'null'
                            required:
                              - cadence
                              - fixedPrice
                              - creditsCount
                              - conversionRate
                              - startAt
                              - endAt
                            additionalProperties: false
                          - type: 'null'
                      topup:
                        anyOf:
                          - type: object
                            properties:
                              creditsCount:
                                type: number
                              threshold:
                                type: number
                            required:
                              - creditsCount
                              - threshold
                            additionalProperties: false
                          - type: 'null'
                    required:
                      - uuid
                      - workspaceUuid
                      - provider
                      - customerOrbId
                      - customerStripeId
                      - subscriptionStatus
                      - subscriptionStripeId
                      - subscriptionAvailableCreditsCount
                      - subscriptionCreditsUsedCount
                      - additionalAvailableCreditsCount
                      - hasCredits
                      - creditsOverageBehaviors
                      - creditsConsumptionBehaviors
                      - createdAt
                      - updatedAt
                      - plan
                      - cadence
                      - fixedPrice
                      - conversionRate
                      - startAt
                      - resetAt
                      - endAt
                      - hasPendingChange
                      - futureChange
                      - topup
                    additionalProperties: false
                    title: Subscription
                    description: Updated subscription details.
                required:
                  - subscription
                additionalProperties: false
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '404':
          description: Not found
        '500':
          description: Internal server error
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````