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

# Edit an existing user

`PATCH /admin/users/{username}`

Requires the authenticated user to be a site administrator.

## Path parameters

- `username` string, required

## Request body

- object
  - `source_id` integer
  - `login_name` string
  - `full_name` string
  - `email` string, email, required
  - `password` string
  - `website` string
  - `location` string
  - `active` boolean
  - `admin` boolean
  - `allow_git_hook` boolean
  - `allow_import_local` boolean
  - `max_repo_creation` integer — Maximum number of repositories the user can create. -1 means no limit.

## Response `200`

Success

- User
  - `id` integer
  - `username` string
  - `login` string — Alias of username for GitHub API compatibility
  - `full_name` string
  - `email` string, email
  - `avatar_url` string

## Other responses

- `404` — Resource not found.
- `422` — Validation error.

---

[API](https://skmtc.net/gogs/apis/gogs-api.md) · [All operations](https://skmtc.net/gogs/apis/gogs-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gogs/gogs-api/revisions/87e2da32266c/schema)
