import requests
url = "https://api.diga.io/v1/project/{project_id}/member/{profile_id}/role"
payload = { "role": "admin" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"status": "error",
"error_code": "CANNOT_REMOVE_LAST_ADMIN",
"message": "Cannot demote the last admin in project 550e8400-e29b-41d4-a716-446655440000"
}Change a project member’s role (e.g., from member to admin or vice versa).
import requests
url = "https://api.diga.io/v1/project/{project_id}/member/{profile_id}/role"
payload = { "role": "admin" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"status": "error",
"error_code": "CANNOT_REMOVE_LAST_ADMIN",
"message": "Cannot demote the last admin in project 550e8400-e29b-41d4-a716-446655440000"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Request to update a member's role in the project.
New role for the member (admin or member)
admin, member Successful Response