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

# 更新子用户

> 更新指定子用户的密码或流量限额



## OpenAPI

````yaml /cn/api-reference/cn-jero_public_api.yaml put /v2/sub-users/{sub_user_id}
openapi: 3.1.0
info:
  title: Smartproxy
  version: '1.2'
servers:
  - url: https://api.decodo.com
security:
  - sec0: []
tags:
  - name: 子用户
    description: 管理住宅代理订阅的子用户
  - name: 白名单 IP
    description: 管理住宅代理订阅的白名单 IP
  - name: 端点
    description: 管理和生成代理端点
  - name: 订阅
    description: 订阅信息
paths:
  /v2/sub-users/{sub_user_id}:
    put:
      tags:
        - 子用户
      summary: 更新子用户
      description: 更新指定子用户的密码或流量限额
      operationId: update-sub-user
      parameters:
        - name: sub_user_id
          in: path
          description: 通过"获取子用户列表"接口获取的子用户 ID
          schema:
            type: integer
            format: int32
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                traffic_limit:
                  type: number
                  description: 流量限额
                  format: float
                auto_disable:
                  type: boolean
                  description: 当流量限额用完时禁用子用户
                  default: false
                password:
                  type: string
                  description: >-
                    必须包含：12 个或更多字符；至少一个大写字母；一个小写字母；一个数字；以下符号之一 `_` `~` `+`
                    `=`（不允许使用 `@` 和 `:`）。
                  format: json
                traffic_count_from:
                  type: string
                  description: 从指定日期开始计算子用户订阅流量。使用日期格式 yyyy-mm-dd hh:mm:ss。
                  format: date
                status:
                  type: string
                  description: ''
                  enum:
                    - active
                    - disabled
      responses:
        '201':
          description: '201'
          content:
            application/json:
              examples:
                Result:
                  value: '{}'
              schema:
                type: object
                properties: {}
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Result:
                  value: |-
                    {
                      "error_code": "bad_request",
                      "message": "Can not process request",
                      "error": {
                        "password": "password must be between 9 and 64 characters and must contain at least one number. Symbols @ and : are invalid"
                      }
                    }
              schema:
                type: object
                properties:
                  error_code:
                    type: string
                    example: bad_request
                  message:
                    type: string
                    example: Can not process request
                  error:
                    type: object
                    properties:
                      password:
                        type: string
                        example: >-
                          password must be between 9 and 64 characters and must
                          contain at least one number. Symbols @ and : are
                          invalid
      deprecated: false
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

````