---
title: "Bulk Create Users From Template"
method: POST
path: "/api/users/bulk/from_template"
tags: ["User"]
---

# Bulk Create Users From Template

`POST /api/users/bulk/from_template`

Bulk create users from a template using configurable username strategies.

- Includes the template creation fields plus `count`, `strategy`, and `start_number` (for sequences).
- **strategy**: Username generation strategy — `sequence` or `random`.
- **start_number**: Optional starting suffix for `sequence` strategy. Defaults to `1` and does not parse numbers from the base username.

Returns subscription URLs for created users.

## Request body

- BulkUsersFromTemplate
  - `user_template_id` integer, required
  - `note` string, nullable
  - `username` string, nullable
  - `count` integer, required
  - `strategy` 'random' | 'sequence'
  - `start_number` integer, nullable — Starting suffix for sequence strategy (defaults to 1; base username digits are ignored)

## Response `201`

Successful Response

- BulkUsersCreateResponse
  - `subscription_urls` string[]
  - `created` integer

## Other responses

- `400` — BadRequest Error
- `401` — Unauthorized Error
- `403` — Forbidden Error
- `404` — NotFound Error
- `409` — Conflict Error
- `422` — Validation Error

---

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