---
title: "Ban and replace usernames"
method: POST
path: "/username/deny/"
tags: ["Profile"]
---

# Ban and replace usernames

`POST /username/deny/`

This endpoint adds the provided list of usernames to the (possibly already existing) denylist. If a username is already in use, it is replaced with the provided replacement username.
The request must contain a list of pairs of usernames: one to be added to the denylist, and the other to replace it if it is already in use.
If a username is already in the denylist, it is skipped.

This operation can be totally or partially successful. If some usernames could not be added to the denylist, the response will contain a list of those usernames.

None of the usernames in the request need to obey the restrictions regarding length and allowed characters.

Important note: denylists rely on unique usernames being enforced at the organization level.

## Headers

- `x-m2-organization-id` string, required

## Request body

- object — A record of usernames to add to the denylist, specifying replacements if they are already in use

## Response `204`

Default Response

- unknown

## Other responses

- `207` — The response of adding usernames to the denylist and replacing if needed, in case some couldn't be added

---

[API](https://skmtc.net/otherside/apis/user-profile.md) · [All operations](https://skmtc.net/otherside/apis/user-profile/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/otherside/user-profile/revisions/a38c15dd49ef/schema)
