---
title: "Add User Template"
method: POST
path: "/api/user_template"
tags: ["User Template"]
---

# Add User Template

`POST /api/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

## Request body

- UserTemplateCreate
  - `name` string, nullable
  - `data_limit` integer, nullable — data_limit can be 0 or greater
  - `expire_duration` integer, nullable — expire_duration can be 0 or greater in seconds
  - `username_prefix` string, nullable
  - `username_suffix` string, nullable
  - `inbounds` object

## Response `200`

Successful Response

- UserTemplateResponse
  - `name` string, nullable
  - `data_limit` integer, nullable — data_limit can be 0 or greater
  - `expire_duration` integer, nullable — expire_duration can be 0 or greater in seconds
  - `username_prefix` string, nullable
  - `username_suffix` string, nullable
  - `inbounds` object
  - `id` integer, required

## Other responses

- `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)
