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

# Update user preferences

> Update the current user's preferences including email notifications, autopay settings, and balance thresholds. Accepts partial updates.

To enable autopay, you must:
1. Have a default payment method saved (add at /dashboard/balance)
2. Set autopay_reload_threshold to at least $20
3. Ensure autopay_reload_threshold < balance_warning_threshold (if both set)

When your balance drops below autopay_reload_threshold, automatically charges your saved default payment method.



## OpenAPI

````yaml https://engine.tensorpool.dev/openapi.json patch /user/preferences
openapi: 3.1.0
info:
  title: TensorPool API
  description: >
    TensorPool API


    All API endpoints (except `/healthz`) require authentication using your
    TensorPool API key.


    ### For REST Endpoints


    Include your API key in the `Authorization` header as a Bearer token:


    ```bash

    Authorization: Bearer YOUR_TENSORPOOL_KEY

    ```

    ### For WebSocket Endpoints


    Send your API key as the first message in JSON format:


    ```json

    {"TENSORPOOL_KEY": "YOUR_TENSORPOOL_KEY"}

    ```
  version: 0.1.0
servers: []
security: []
tags:
  - name: job
    description: >-
      GPU job execution and management. Run workloads on ephemeral clusters with
      automatic cleanup.
  - name: cluster
    description: >-
      GPU cluster provisioning and lifecycle management. Create persistent
      compute resources.
  - name: storage
    description: >-
      Shared storage volume management. Persistent storage that can be attached
      to eligible clusters.
  - name: object-storage
    description: S3-compatible object storage management.
  - name: ssh
    description: SSH key management for secure cluster access.
  - name: user
    description: >-
      User account management including balance, billing, and organization
      operations.
  - name: requests
    description: Cloud resource provisioning request tracking and status monitoring.
paths:
  /user/preferences:
    patch:
      tags:
        - user
      summary: Update user preferences
      description: >-
        Update the current user's preferences including email notifications,
        autopay settings, and balance thresholds. Accepts partial updates.


        To enable autopay, you must:

        1. Have a default payment method saved (add at /dashboard/balance)

        2. Set autopay_reload_threshold to at least $20

        3. Ensure autopay_reload_threshold < balance_warning_threshold (if both
        set)


        When your balance drops below autopay_reload_threshold, automatically
        charges your saved default payment method.
      operationId: update_preferences_user_preferences_patch
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserPreferencesUpdateRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserPreferencesResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    UserPreferencesUpdateRequest:
      properties:
        notify_email_cluster_create:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Notify Email Cluster Create
          description: Whether to send email notifications when clusters are created
        notify_email_cluster_destroy:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Notify Email Cluster Destroy
          description: Whether to send email notifications when clusters are destroyed
        autopay_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Autopay Enabled
          description: >-
            Enable or disable autopay. When enabled, automatically charges saved
            payment method when balance drops below autopay_reload_threshold.
            Requires default payment method and autopay_reload_threshold to be
            set.
        balance_warning_threshold:
          anyOf:
            - type: number
              exclusiveMinimum: 0
            - type: 'null'
          title: Balance Warning Threshold
          description: >-
            Balance threshold (in USD) at which to send warning email. Must be
            positive and higher than autopay_reload_threshold if both are set.
        autopay_reload_threshold:
          anyOf:
            - type: number
              minimum: 20
            - type: 'null'
          title: Autopay Reload Threshold
          description: >-
            Balance threshold (in USD) at which autopay triggers. Must be at
            least $20 and less than balance_warning_threshold.
      type: object
      title: UserPreferencesUpdateRequest
      description: Request model for PATCH /user/preferences endpoint.
    UserPreferencesResponse:
      properties:
        notify_email_cluster_create:
          type: boolean
          title: Notify Email Cluster Create
          description: Whether to send email notifications when clusters are created
        notify_email_cluster_destroy:
          type: boolean
          title: Notify Email Cluster Destroy
          description: Whether to send email notifications when clusters are destroyed
        autopay_enabled:
          type: boolean
          title: Autopay Enabled
          description: >-
            Whether autopay is enabled. When enabled, TensorPool automatically
            charges your saved payment method when your balance falls below
            autopay_reload_threshold.


            **Requirements to enable:**

            - Must have a default payment method saved (add at
            /dashboard/balance)

            - Must set autopay_reload_threshold


            **How it works:**

            - When balance drops below autopay_reload_threshold, automatically
            charges saved payment method

            - Requires saved payment method on file

            - Can be disabled at any time
        balance_warning_threshold:
          anyOf:
            - type: number
            - type: 'null'
          title: Balance Warning Threshold
          description: >-
            Balance threshold (in USD) at which to send warning email
            notifications. Must be positive if set. Should be higher than
            autopay_reload_threshold if both are set.
        autopay_reload_threshold:
          anyOf:
            - type: number
            - type: 'null'
          title: Autopay Reload Threshold
          description: >-
            Balance threshold (in USD) at which autopay automatically reloads
            balance. Must be at least $20 and less than
            balance_warning_threshold if both are set.
      type: object
      required:
        - notify_email_cluster_create
        - notify_email_cluster_destroy
        - autopay_enabled
      title: UserPreferencesResponse
      description: Response model for GET /user/preferences endpoint.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````