Update an organization
curl --request PUT \
--url https://web-api.dev.soxai.site/api/orgs/{org_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"orgName": "Example Clinic",
"orgPhone": "+81-3-1234-5678",
"orgAddress": "1-2-3 Chiyoda, Tokyo",
"orgEmail": "contact@example.com"
}
'import requests
url = "https://web-api.dev.soxai.site/api/orgs/{org_id}"
payload = {
"orgName": "Example Clinic",
"orgPhone": "+81-3-1234-5678",
"orgAddress": "1-2-3 Chiyoda, Tokyo",
"orgEmail": "contact@example.com"
}
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({
orgName: 'Example Clinic',
orgPhone: '+81-3-1234-5678',
orgAddress: '1-2-3 Chiyoda, Tokyo',
orgEmail: 'contact@example.com'
})
};
fetch('https://web-api.dev.soxai.site/api/orgs/{org_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"message": "Org updated successfully",
"org": {
"orgName": "SOXAI Research Lab"
}
}{
"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": "Org '<org_id>' not found"
}{
"error": "conflict",
"error_msg": "Org 'SOXAI Research' already exists in this company"
}{
"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>"
}Organizations
Update an organization
Not callable with a Sandbox key
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 an organization. Only the fields the request actually
carries are written, so naming orgName alone renames the organization and leaves
everything else, companyId included, untouched.
Parameters
org_id(path, required) - organization identifier.- Body (
Org): send only the fields to change.orgIdis ignored. companyIdmoves the organization to another company and is honoured for anAdminonly. APartnerAdmincannot move an organization: the field is overwritten with the caller’s own company. To detach an organization, anAdminsendscompanyIdexplicitly asnull.
Response
200{"message", "org"}, whereorgis the set of fields that were written - not the whole document.
Errors
| Status | Condition |
|---|---|
| 403 | A PartnerAdmin naming an organization that belongs to another company or does not exist |
| 404 | The organization does not exist. Only an Admin receives this |
| 409 | The new orgName is already used by another organization in the same company |
| 409 | The request moves the organization into a company, and some of its members are not registered under that company. The body names up to ten of them. Moving an organization hands its whole roster to that company’s PartnerAdmin, so every member has to belong there first. Detaching (companyId: null) is not checked |
Authorization
- Scheme:
Authorization: Bearer <idToken>orsoxai-api-key: <api key>. - Accepted roles:
Admin,PartnerAdmin - Any other caller receives
403 Not enough permission.
PUT
/
api
/
orgs
/
{org_id}
Update an organization
curl --request PUT \
--url https://web-api.dev.soxai.site/api/orgs/{org_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"orgName": "Example Clinic",
"orgPhone": "+81-3-1234-5678",
"orgAddress": "1-2-3 Chiyoda, Tokyo",
"orgEmail": "contact@example.com"
}
'import requests
url = "https://web-api.dev.soxai.site/api/orgs/{org_id}"
payload = {
"orgName": "Example Clinic",
"orgPhone": "+81-3-1234-5678",
"orgAddress": "1-2-3 Chiyoda, Tokyo",
"orgEmail": "contact@example.com"
}
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({
orgName: 'Example Clinic',
orgPhone: '+81-3-1234-5678',
orgAddress: '1-2-3 Chiyoda, Tokyo',
orgEmail: 'contact@example.com'
})
};
fetch('https://web-api.dev.soxai.site/api/orgs/{org_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"message": "Org updated successfully",
"org": {
"orgName": "SOXAI Research Lab"
}
}{
"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": "Org '<org_id>' not found"
}{
"error": "conflict",
"error_msg": "Org 'SOXAI Research' already exists in this company"
}{
"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
HTTPBearerSoxaiApiKey
Body
application/json
Response
org holds exactly the fields that were written, not the whole document.