Change a user's role or active/suspended state
curl --request PATCH \
--url https://harness.example.com/admin/users/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://harness.example.com/admin/users/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://harness.example.com/admin/users/{id}"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"subject": "<string>",
"email": "developer@example.com",
"role": "admin",
"active": true,
"status": "active",
"protected": true,
"provisioning_source": "local",
"managed": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}User management
Change a user's role or active/suspended state
Role and status changes revoke existing browser and CLI credentials. Removed users must be invited again.
PATCH
/
admin
/
users
/
{id}
Change a user's role or active/suspended state
curl --request PATCH \
--url https://harness.example.com/admin/users/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://harness.example.com/admin/users/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://harness.example.com/admin/users/{id}"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"subject": "<string>",
"email": "developer@example.com",
"role": "admin",
"active": true,
"status": "active",
"protected": true,
"provisioning_source": "local",
"managed": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}Authorizations
oauthDevicedashboardSession
OAuth 2.0 access token obtained through RFC 8628 at /api/auth/device/code and /api/auth/oauth2/token. The API enforces governance:read, session:write, and client-status:write as appropriate.
Path Parameters
Body
application/json
Response
Updated user
Example:
"developer@example.com"
Available options:
admin, member Compatibility projection of status == active
Available options:
active, suspended, removed Deployment-managed identity that cannot be demoted, suspended, or deleted
Available options:
local, scim True when role and lifecycle are controlled through SCIM
