Skip to main content

Patch a Specific User

This endpoint patches a specific user identified by {id}

info

A user can only update their personal data.

username field must be unique and valid (valid characters are: a-z A-Z 0-9 _-).

info

You can use this endpoint to edit a single field passing only the id and the needed field (without mandatory fields).

info

If the request will update the avatar or the cover, the 'Content-Type' request header must be set as 'multipart/form-data', otherwise it can be 'application/x-www-form-urlencoded'.

info

This operation requires authentication.

HTTP Request

PATCH /api/v2/user/{id}/

Parameters

NameInTypeRequiredDescription
idpathstringtrueA unique integer value identifying this user
bodybodyUserfalseThe request body(user params)

Example Request

const inputBody = {
"username": "string",
"real_name": "string",
"bio": "string",
"location": "string",
"location_lat_lng": "string",
"position_lat_lng": "string",
"date_of_birth": "string",
"description": "string",
"avatar": "string",
"cover": "string",
"gender": "string",
"website": "string"
};
const headers = {
'Content-Type': 'multipart/form-data',
'Accept': 'application/json',
'Authorization: Bearer <token>'
};
fetch('/api/v2/user/{id}/',
{
method: 'PATCH',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});

Responses

StatusMeaningDescriptionSchema
200OKResponse status codeUser

Example responses

{
"id": "integer",
"username": "string",
"real_name": "string",
"avatar": "string",
"ext_id": "integer",
"followings_counter": "integer",
"followers_counter": "integer",
"posts_counter": "integer",
"discussions_counter": "integer",
"polls_counter": "integer",
"connection_status": "string",
"categories_counter": "integer",
"date_joined": "string",
"bio": "string",
"location": "string",
"location_lat_lng": "string",
"position_lat_lng": "string",
"date_of_birth": "string",
"description": "string",
"gender": "string",
"website": "string",
"cover": "string",
"tags": [{Tag}],
"reputation": "integer",
"community_badge": "boolean",
"reg_approved": "boolean",
"deleted" : "boolean",
"company_name": "string",
"company_role": "string"
}