curl --request PUT \
--url https://web-api.dev.soxai.site/api/orgs/{org_id}/orgUsers/{uid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"username": "Jane Doe",
"teams": [
"engineering"
],
"isAdmin": false
}
'import requests
url = "https://web-api.dev.soxai.site/api/orgs/{org_id}/orgUsers/{uid}"
payload = {
"username": "Jane Doe",
"teams": ["engineering"],
"isAdmin": False
}
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({username: 'Jane Doe', teams: ['engineering'], isAdmin: false})
};
fetch('https://web-api.dev.soxai.site/api/orgs/{org_id}/orgUsers/{uid}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"message": "OrgUser updated successfully",
"updatedInfo": {
"username": "Member One",
"teams": [
"Team A",
"Team B"
]
}
}{
"error": "bad-request",
"error_msg": "Invalid input: <reason>"
}{
"error": "http-error",
"error_msg": "Invalid authentication credentials. <reason>"
}{
"error": "forbidden",
"error_msg": "Not enough permission"
}{
"error": "not-found",
"error_msg": "OrgUser '<uid>' not found"
}{
"error": "unprocessable-entity",
"error_msg": "body.<field>: <validation message>"
}{
"error": "rate-limited",
"error_msg": "Rate limit exceeded. Retry after <n> seconds."
}{
"error": "internal-server-error",
"error_msg": "Failed to fetch data: <error_message>"
}Update an organization member
A request authenticated with a Sandbox soxai-api-key is answered 403 This endpoint is not available in the sandbox., because it changes state that every Sandbox caller shares. It is published here because the Sandbox runs the same build; use it in Production. See Sandbox.
Update a member’s roster entry: their username, teams, organization admin flag, and data-sharing status.
Only the fields the request actually carries are written. Omitting isAdmin leaves the
member’s admin flag alone, and omitting teams leaves their teams alone.
Parameters
org_id(path, required) - organization identifier.uid(path, required) - the member to update.- Body (
OrgUserEdit): send only the fields to change.teamsaccepts a list, or a string holding one. allowDataSharing(query, optional) -truesets the member’s status toActivated,falsetoClosed, and the value is also written to the member’sOrgUsersrecord asallowDataSharing. AnOrgAdmincannot read the data of a member whose status isInvitation PendingorClosed. A member may change their own; changing somebody else’s requiresAdminorPartnerAdmin.
The member’s email is refreshed from SOXAI Authentication on every successful update, so
the roster does not keep an address the account no longer uses.
Response
200{"message", "updatedInfo"}.updatedInfoholds exactly what was written.
Errors
| Status | Condition |
|---|---|
| 403 | An OrgUser editing another member, an attempt to grant isAdmin to oneself, a demotion that would leave the organization with no admin, an organization admin demoting itself, or changing another member’s allowDataSharing without Admin / PartnerAdmin |
| 404 | uid is not on this organization’s roster |
| 500 | The member’s SOXAI Authentication account no longer exists, so the email could not be refreshed |
Authorization
- Scheme:
Authorization: Bearer <idToken>orsoxai-api-key: <api key>. - Accepted roles:
PartnerAdmin,OrgAdmin,OrgUser Adminis accepted regardless of the roles above.PartnerAdminreaches only an org owned by its own company; any other caller must carry anorgIdclaim naming exactly{org_id}.- Denials: a
PartnerAdminnaming another company’s org receives403 PartnerAdmin can change only the org that belongs to your company; a caller whoseorgIdclaim does not name{org_id}receives403 orgId not match; anyone else receives403 Not enough permission.
curl --request PUT \
--url https://web-api.dev.soxai.site/api/orgs/{org_id}/orgUsers/{uid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"username": "Jane Doe",
"teams": [
"engineering"
],
"isAdmin": false
}
'import requests
url = "https://web-api.dev.soxai.site/api/orgs/{org_id}/orgUsers/{uid}"
payload = {
"username": "Jane Doe",
"teams": ["engineering"],
"isAdmin": False
}
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({username: 'Jane Doe', teams: ['engineering'], isAdmin: false})
};
fetch('https://web-api.dev.soxai.site/api/orgs/{org_id}/orgUsers/{uid}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"message": "OrgUser updated successfully",
"updatedInfo": {
"username": "Member One",
"teams": [
"Team A",
"Team B"
]
}
}{
"error": "bad-request",
"error_msg": "Invalid input: <reason>"
}{
"error": "http-error",
"error_msg": "Invalid authentication credentials. <reason>"
}{
"error": "forbidden",
"error_msg": "Not enough permission"
}{
"error": "not-found",
"error_msg": "OrgUser '<uid>' not found"
}{
"error": "unprocessable-entity",
"error_msg": "body.<field>: <validation message>"
}{
"error": "rate-limited",
"error_msg": "Rate limit exceeded. Retry after <n> seconds."
}{
"error": "internal-server-error",
"error_msg": "Failed to fetch data: <error_message>"
}Authorizations
Path Parameters
Query Parameters
Body
Response
updatedInfo holds exactly what was written.