Rename a user
POST
/admin/users/{username}/rename
const url = 'https://gitea.com/api/v1/admin/users/example/rename';const options = { method: 'POST', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"new_username":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://gitea.com/api/v1/admin/users/example/rename \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "new_username": "example" }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”username
required
string
Current username of the user
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
RenameUserOption options when renaming a user
object
new_username
required
New username for this user. This name cannot be in use yet by any other user.
string
Examplegenerated
{ "new_username": "example"}Responses
Section titled “Responses”APIEmpty is an empty response
APIForbiddenError is a forbidden error response
Headers
Section titled “Headers”message
string
url
string
APIValidationError is error format response related to input validation
Headers
Section titled “Headers”message
string
url
string