User templates
Reusable presets for new users.
5 endpoints
GET /api/user_template
Get User Templates
Get a list of User Templates with optional pagination
Any admin
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
offset | query | integer | no | |
limit | query | integer | no |
Response 200 Successful Response · UserTemplateResponse[]
Response fields
| Field | Type | Description |
|---|---|---|
name | string | |
data_limit | integer | data_limit can be 0 or greater |
expire_duration | integer | expire_duration can be 0 or greater in seconds |
username_prefix | string | |
username_suffix | string | |
inbounds | object | |
id | integer |
[
{
"name": "string",
"data_limit": 0,
"expire_duration": 0,
"username_prefix": "string",
"username_suffix": "string",
"inbounds": {},
"id": 0
}
]curl -X GET 'https://YOUR-PANEL/api/user_template' \
-H 'Authorization: Bearer $TOKEN'POST /api/user_template
Add User Template
Add a new user template
- name can be up to 64 characters
- data_limit must be in bytes and larger or equal to 0
- expire_duration must be in seconds and larger or equat to 0
- inbounds dictionary of protocol:inbound_tags, empty means all inbounds
Sudo admin only
Request body application/json · UserTemplateCreate
| Field | Type | Required | Description |
|---|---|---|---|
name | string | no | |
data_limit | integer | no | data_limit can be 0 or greater |
expire_duration | integer | no | expire_duration can be 0 or greater in seconds |
username_prefix | string | no | |
username_suffix | string | no | |
inbounds | object | no | Default: {}. |
{
"data_limit": 0,
"expire_duration": 0,
"inbounds": {
"vless": [
"VLESS_INBOUND"
],
"vmess": [
"VMESS_INBOUND"
]
},
"name": "my template 1"
}Response 200 Successful Response · UserTemplateResponse
Response fields
| Field | Type | Description |
|---|---|---|
name | string | |
data_limit | integer | data_limit can be 0 or greater |
expire_duration | integer | expire_duration can be 0 or greater in seconds |
username_prefix | string | |
username_suffix | string | |
inbounds | object | |
id | integer |
{
"name": "string",
"data_limit": 0,
"expire_duration": 0,
"username_prefix": "string",
"username_suffix": "string",
"inbounds": {},
"id": 0
}curl -X POST 'https://YOUR-PANEL/api/user_template' \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{"data_limit": 0, "expire_duration": 0, "inbounds": {"vless": ["VLESS_INBOUND"], "vmess": ["VMESS_INBOUND"]}, "name": "my template 1"}'GET /api/user_template/{template_id}
Get User Template Endpoint
Get User Template information with id
Any admin
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
template_id | path | integer | yes |
Response 200 Successful Response · UserTemplateResponse
Response fields
| Field | Type | Description |
|---|---|---|
name | string | |
data_limit | integer | data_limit can be 0 or greater |
expire_duration | integer | expire_duration can be 0 or greater in seconds |
username_prefix | string | |
username_suffix | string | |
inbounds | object | |
id | integer |
{
"name": "string",
"data_limit": 0,
"expire_duration": 0,
"username_prefix": "string",
"username_suffix": "string",
"inbounds": {},
"id": 0
}curl -X GET 'https://YOUR-PANEL/api/user_template/<template_id>' \
-H 'Authorization: Bearer $TOKEN'PUT /api/user_template/{template_id}
Modify User Template
Modify User Template
- name can be up to 64 characters
- data_limit must be in bytes and larger or equal to 0
- expire_duration must be in seconds and larger or equat to 0
- inbounds dictionary of protocol:inbound_tags, empty means all inbounds
Sudo admin only
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
template_id | path | integer | yes |
Request body application/json · UserTemplateModify
| Field | Type | Required | Description |
|---|---|---|---|
name | string | no | |
data_limit | integer | no | data_limit can be 0 or greater |
expire_duration | integer | no | expire_duration can be 0 or greater in seconds |
username_prefix | string | no | |
username_suffix | string | no | |
inbounds | object | no | Default: {}. |
{
"data_limit": 0,
"expire_duration": 0,
"inbounds": {
"vless": [
"VLESS_INBOUND"
],
"vmess": [
"VMESS_INBOUND"
]
},
"name": "my template 1"
}Response 200 Successful Response · UserTemplateResponse
Response fields
| Field | Type | Description |
|---|---|---|
name | string | |
data_limit | integer | data_limit can be 0 or greater |
expire_duration | integer | expire_duration can be 0 or greater in seconds |
username_prefix | string | |
username_suffix | string | |
inbounds | object | |
id | integer |
{
"name": "string",
"data_limit": 0,
"expire_duration": 0,
"username_prefix": "string",
"username_suffix": "string",
"inbounds": {},
"id": 0
}curl -X PUT 'https://YOUR-PANEL/api/user_template/<template_id>' \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{"data_limit": 0, "expire_duration": 0, "inbounds": {"vless": ["VLESS_INBOUND"], "vmess": ["VMESS_INBOUND"]}, "name": "my template 1"}'DELETE /api/user_template/{template_id}
Remove User Template
Remove a User Template by its ID
Sudo admin only
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
template_id | path | integer | yes |
Response 200 Successful Response
curl -X DELETE 'https://YOUR-PANEL/api/user_template/<template_id>' \
-H 'Authorization: Bearer $TOKEN'