---
title: "Edit an existing user"
method: PATCH
path: "/admin/users/{username}"
tags: ["admin"]
---

# Edit an existing user

`PATCH /admin/users/{username}`

## Path parameters

- `username` string, required

## Request body

- EditUserOption — EditUserOption edit user options
  - `active` boolean — Whether the user account is active
  - `admin` boolean — Whether the user has administrator privileges
  - `allow_create_organization` boolean — Whether the user can create organizations
  - `allow_git_hook` boolean — Whether the user can use Git hooks
  - `allow_import_local` boolean — Whether the user can import local repositories
  - `description` string — The user's personal description or bio
  - `email` string, email — The email address of the user
  - `full_name` string — The full display name of the user
  - `location` string — The user's location or address
  - `login_name` string, required — identifier of the user, provided by the external authenticator (if configured)
  - `max_repo_creation` integer — Maximum number of repositories the user can create
  - `must_change_password` boolean — Whether the user must change password on next login
  - `password` string — The plain text password for the user
  - `prohibit_login` boolean — Whether the user is prohibited from logging in
  - `restricted` boolean — Whether the user has restricted access privileges
  - `source_id` integer, required — The authentication source ID to associate with the user
  - `visibility` 'public' | 'limited' | 'private' — User visibility level: public, limited, or private
  - `website` string — The user's personal website URL

## Response `200`

User

- User — User represents a user
  - `active` boolean — Is user active
  - `avatar_url` string — URL to the user's avatar
  - `created` string, date-time
  - `description` string — the user's description
  - `email` string, email
  - `followers_count` integer — user counts
  - `following_count` integer
  - `full_name` string — the user's full name
  - `html_url` string — URL to the user's gitea page
  - `id` integer — the user's id
  - `is_admin` boolean — Is the user an administrator
  - `language` string — User locale
  - `last_login` string, date-time
  - `location` string — the user's location
  - `login` string — login of the user, same as `username`
  - `login_name` string — identifier of the user, provided by the external authenticator (if configured)
  - `prohibit_login` boolean — Is user login prohibited
  - `restricted` boolean — Is user restricted
  - `source_id` integer — The ID of the user's Authentication Source
  - `starred_repos_count` integer
  - `visibility` 'public' | 'limited' | 'private' — User visibility level option: public, limited, private
  - `website` string — the user's website

## Other responses

- `400` — APIError is error format response
- `403` — APIForbiddenError is a forbidden error response
- `422` — APIValidationError is error format response related to input validation

---

[API](https://skmtc.net/gitea/apis/gitea-api.md) · [All operations](https://skmtc.net/gitea/apis/gitea-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gitea/gitea-api/versions/350de506cefa/schema)
