Skip to content

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

NameInTypeRequiredDescription
offsetqueryintegerno
limitqueryintegerno

Response 200 Successful Response · UserTemplateResponse[]

Response fields
FieldTypeDescription
namestring
data_limitintegerdata_limit can be 0 or greater
expire_durationintegerexpire_duration can be 0 or greater in seconds
username_prefixstring
username_suffixstring
inboundsobject
idinteger
json
[
  {
    "name": "string",
    "data_limit": 0,
    "expire_duration": 0,
    "username_prefix": "string",
    "username_suffix": "string",
    "inbounds": {},
    "id": 0
  }
]
bash
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

FieldTypeRequiredDescription
namestringno
data_limitintegernodata_limit can be 0 or greater
expire_durationintegernoexpire_duration can be 0 or greater in seconds
username_prefixstringno
username_suffixstringno
inboundsobjectnoDefault: {}.
json
{
  "data_limit": 0,
  "expire_duration": 0,
  "inbounds": {
    "vless": [
      "VLESS_INBOUND"
    ],
    "vmess": [
      "VMESS_INBOUND"
    ]
  },
  "name": "my template 1"
}

Response 200 Successful Response · UserTemplateResponse

Response fields
FieldTypeDescription
namestring
data_limitintegerdata_limit can be 0 or greater
expire_durationintegerexpire_duration can be 0 or greater in seconds
username_prefixstring
username_suffixstring
inboundsobject
idinteger
json
{
  "name": "string",
  "data_limit": 0,
  "expire_duration": 0,
  "username_prefix": "string",
  "username_suffix": "string",
  "inbounds": {},
  "id": 0
}
bash
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

NameInTypeRequiredDescription
template_idpathintegeryes

Response 200 Successful Response · UserTemplateResponse

Response fields
FieldTypeDescription
namestring
data_limitintegerdata_limit can be 0 or greater
expire_durationintegerexpire_duration can be 0 or greater in seconds
username_prefixstring
username_suffixstring
inboundsobject
idinteger
json
{
  "name": "string",
  "data_limit": 0,
  "expire_duration": 0,
  "username_prefix": "string",
  "username_suffix": "string",
  "inbounds": {},
  "id": 0
}
bash
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

NameInTypeRequiredDescription
template_idpathintegeryes

Request body application/json · UserTemplateModify

FieldTypeRequiredDescription
namestringno
data_limitintegernodata_limit can be 0 or greater
expire_durationintegernoexpire_duration can be 0 or greater in seconds
username_prefixstringno
username_suffixstringno
inboundsobjectnoDefault: {}.
json
{
  "data_limit": 0,
  "expire_duration": 0,
  "inbounds": {
    "vless": [
      "VLESS_INBOUND"
    ],
    "vmess": [
      "VMESS_INBOUND"
    ]
  },
  "name": "my template 1"
}

Response 200 Successful Response · UserTemplateResponse

Response fields
FieldTypeDescription
namestring
data_limitintegerdata_limit can be 0 or greater
expire_durationintegerexpire_duration can be 0 or greater in seconds
username_prefixstring
username_suffixstring
inboundsobject
idinteger
json
{
  "name": "string",
  "data_limit": 0,
  "expire_duration": 0,
  "username_prefix": "string",
  "username_suffix": "string",
  "inbounds": {},
  "id": 0
}
bash
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

NameInTypeRequiredDescription
template_idpathintegeryes

Response 200 Successful Response

bash
curl -X DELETE 'https://YOUR-PANEL/api/user_template/<template_id>' \
  -H 'Authorization: Bearer $TOKEN'

Alexen v2.3.14 · 204 API endpoints