---
title: "Modify User With Template By Id"
method: PUT
path: "/api/user/from_template/by-id/{user_id}"
tags: ["User"]
---

# Modify User With Template By Id

`PUT /api/user/from_template/by-id/{user_id}`

## Path parameters

- `user_id` integer, required

## Request body

- ModifyUserByTemplate
  - `user_template_id` integer, required
  - `note` string, nullable

## Response `200`

Successful Response

- UserResponse
  - `proxy_settings` ProxyTable
    - `vmess` VMessSettings
      - `id` string, uuid
    - `vless` VlessSettings
      - `id` string, uuid
    - `trojan` TrojanSettings
      - `password` string
    - `shadowsocks` ShadowsocksSettings
      - `password` string
      - `method` 'aes-128-gcm' | 'aes-256-gcm' | 'chacha20-ietf-poly1305' | 'xchacha20-poly1305'
    - `wireguard` WireGuardSettings
      - `private_key` string, nullable
      - `public_key` string, nullable
      - `peer_ips` string[]
    - `hysteria` HysteriaSettings
      - `auth` string
  - `expire` union
    - string, date-time
    - integer
  - `data_limit` integer, nullable — data_limit can be 0 or greater
  - `data_limit_reset_strategy` 'no_reset' | 'day' | 'week' | 'month' | 'year'
  - `note` string, nullable
  - `on_hold_expire_duration` integer, nullable
  - `on_hold_timeout` union
    - string, date-time
    - integer
  - `group_ids` integer[], nullable
  - `auto_delete_in_days` integer, nullable
  - `hwid_limit` integer, nullable
  - `next_plan` NextPlanModel
    - `user_template_id` integer, nullable
    - `data_limit` integer, nullable
    - `expire` integer, nullable
    - `add_remaining_traffic` boolean
  - `id` integer, required
  - `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
  - `edit_at` string, date-time, nullable
  - `online_at` string, date-time, nullable
  - `subscription_url` string
  - `admin` AdminBase — Minimal admin model containing only the username.
    - `username` string, required

## Other responses

- `401` — Unauthorized Error
- `422` — Validation Error

---

[API](https://skmtc.dev/rain/apis/pasarguardapi.md) · [All operations](https://skmtc.dev/rain/apis/pasarguardapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/rain/pasarguardapi/revisions/b3bebca20611/schema)
