Update roles of a company member
curl --request PUT \
--url https://api.lighton.ai/api/v2/users/{id}/roles/update/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"roles": [
123
]
}
'import requests
url = "https://api.lighton.ai/api/v2/users/{id}/roles/update/"
payload = { "roles": [123] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({roles: [123]})
};
fetch('https://api.lighton.ai/api/v2/users/{id}/roles/update/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": 123,
"username": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"is_active": true,
"date_joined": "2023-11-07T05:31:56Z",
"account_expiration_date": "2023-11-07T05:31:56Z",
"last_login": "2023-11-07T05:31:56Z",
"invitation_status": "<string>",
"language": "<string>",
"company": {
"id": 123,
"name": "<string>"
},
"roles": [
{
"id": 123,
"name": "<string>"
}
],
"groups": [
{
"id": 123,
"name": "<string>",
"description": "<string>",
"role": "<string>",
"category": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
]
}Users
Update roles of a company member
This endpoint allows you to update the roles of a company member.
Note that this will update all the roles of the member.
It is restricted to admin and company admin users.
PUT
/
api
/
v2
/
users
/
{id}
/
roles
/
update
/
Update roles of a company member
curl --request PUT \
--url https://api.lighton.ai/api/v2/users/{id}/roles/update/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"roles": [
123
]
}
'import requests
url = "https://api.lighton.ai/api/v2/users/{id}/roles/update/"
payload = { "roles": [123] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({roles: [123]})
};
fetch('https://api.lighton.ai/api/v2/users/{id}/roles/update/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": 123,
"username": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"is_active": true,
"date_joined": "2023-11-07T05:31:56Z",
"account_expiration_date": "2023-11-07T05:31:56Z",
"last_login": "2023-11-07T05:31:56Z",
"invitation_status": "<string>",
"language": "<string>",
"company": {
"id": 123,
"name": "<string>"
},
"roles": [
{
"id": 123,
"name": "<string>"
}
],
"groups": [
{
"id": 123,
"name": "<string>",
"description": "<string>",
"role": "<string>",
"category": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The unique identifier of the user.
Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data
Response
200 - application/json
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes