/users/update v1.0.0
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
Base URLs:
Users
postUsersUpdate
Code samples
const inputBody = '{
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The new name of the user"
},
"email": {
"type": "string",
"description": "The new email address of the user"
},
"role": {
"type": "string",
"description": "The new role of the user"
}
}
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://goldleaf.app/api/v1/users/update',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
POST /users/update
Updates user information
This endpoint updates the information of the currently authenticated user with the new data provided in the request.
Body parameter
{
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The new name of the user"
},
"email": {
"type": "string",
"description": "The new email address of the user"
},
"role": {
"type": "string",
"description": "The new role of the user"
}
}
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | object | true | none |
| » name | body | string | false | The new name of the user |
| body | string | false | The new email address of the user | |
| » role | body | string | false | The new role of the user |
Example responses
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successfully updated user details | None |
| 400 | Bad Request | Bad request, invalid input data | None |
| 401 | Unauthorized | Unauthorized, user is not authenticated | None |
| 403 | Forbidden | Forbidden, user does not have the necessary permissions | None |
