---
title: "Modify User"
method: PUT
path: "/api/user/{username}"
tags: ["User"]
---

# Modify User

`PUT /api/user/{username}`

Modify an existing user

- **username**: Cannot be changed. Used to identify the user.
- **status**: User's new status. Can be 'active', 'disabled', 'on_hold', 'limited', or 'expired'.
- **expire**: UTC timestamp for new account expiration. Set to `0` for unlimited, `null` for no change.
- **data_limit**: New max data usage in bytes (e.g., `1073741824` for 1GB). Set to `0` for unlimited, `null` for no change.
- **data_limit_reset_strategy**: New strategy for data limit reset. Options include 'daily', 'weekly', 'monthly', or 'no_reset'.
- **proxies**: Dictionary of new protocol settings (e.g., `vmess`, `vless`). Empty dictionary means no change.
- **inbounds**: Dictionary of new protocol tags to specify inbound connections. Empty dictionary means no change.
- **note**: New optional text for additional user information or notes. `null` means no change.
- **on_hold_timeout**: New UTC timestamp for when `on_hold` status should start or end. Only applicable if status is changed to 'on_hold'.
- **on_hold_expire_duration**: New duration (in seconds) for how long the user should stay in `on_hold` status. Only applicable if status is changed to 'on_hold'.
- **next_plan**: Next user plan (resets after use).

Note: Fields set to `null` or omitted will not be modified.

## Path parameters

- `username` string, required

## Request body

- UserModify
  - `proxies` object
  - `expire` integer, nullable
  - `data_limit` integer, nullable — data_limit can be 0 or greater
  - `data_limit_reset_strategy` 'no_reset' | 'day' | 'week' | 'month' | 'year'
  - `inbounds` object
  - `note` string, nullable
  - `sub_updated_at` string, date-time, nullable
  - `sub_last_user_agent` string, nullable
  - `online_at` string, date-time, nullable
  - `on_hold_expire_duration` integer, nullable
  - `on_hold_timeout` string, date-time, nullable
  - `auto_delete_in_days` integer, nullable
  - `next_plan` NextPlanModel
    - `data_limit` integer, nullable
    - `expire` integer, nullable
    - `add_remaining_traffic` boolean
    - `fire_on_either` boolean
  - `status` 'active' | 'disabled' | 'on_hold'

## Response `200`

Successful Response

- UserResponse
  - `proxies` object, required
  - `expire` integer, nullable
  - `data_limit` integer, nullable — data_limit can be 0 or greater
  - `data_limit_reset_strategy` 'no_reset' | 'day' | 'week' | 'month' | 'year'
  - `inbounds` object
  - `note` string, nullable
  - `sub_updated_at` string, date-time, nullable
  - `sub_last_user_agent` string, nullable
  - `online_at` string, date-time, nullable
  - `on_hold_expire_duration` integer, nullable
  - `on_hold_timeout` string, date-time, nullable
  - `auto_delete_in_days` integer, nullable
  - `next_plan` NextPlanModel
    - `data_limit` integer, nullable
    - `expire` integer, nullable
    - `add_remaining_traffic` boolean
    - `fire_on_either` boolean
  - `username` string, required
  - `status` 'active' | 'disabled' | 'limited' | 'expired' | 'on_hold', required
  - `used_traffic` integer, required
  - `lifetime_used_traffic` integer
  - `created_at` string, date-time, required
  - `links` string[]
  - `subscription_url` string
  - `excluded_inbounds` object
  - `admin` Admin
    - `username` string, required
    - `is_sudo` boolean, required
    - `telegram_id` integer, nullable
    - `discord_webhook` string, nullable
    - `users_usage` integer, nullable

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not found
- `422` — Validation Error

---

[API](https://skmtc.dev/atrvatam/apis/marzbanapi.md) · [All operations](https://skmtc.dev/atrvatam/apis/marzbanapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/atrvatam/marzbanapi/revisions/0aa31d6bd001/schema)
