---
title: "Bulk reallocate WireGuard peer IPs"
method: POST
path: "/api/users/bulk/wireguard/reallocate-peer-ips"
tags: ["User"]
---

# Bulk reallocate WireGuard peer IPs

`POST /api/users/bulk/wireguard/reallocate-peer-ips`

Same scoping as other bulk user actions (users, admins, group_ids, optional status filter). Non-sudo admins only affect their own users.

## Request body

- BulkWireGuardPeerIPs — Re-seat WireGuard peer IPs (same scoping as BulkUser: users, admins, group_ids, status).
  - `dry_run` boolean
  - `group_ids` integer[]
  - `admins` integer[]
  - `users` integer[]
  - `status` UserStatus[]
  - `expire_after` string, date-time, nullable
  - `expire_before` string, date-time, nullable
  - `confirm` boolean
  - `replace_all` boolean

## Response `200`

Successful Response

- WireGuardPeerIPsReallocateResponse
  - `wireguard_inbound_tags` integer, required
  - `candidates` integer, required
  - `updated` integer, required
  - `dry_run` boolean, required
  - `sample_usernames` string[], required
  - `affected_users` integer, 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)
