Delete an organization
curl --request DELETE \
--url https://web-api.soxai.site/api/orgs/{org_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://web-api.soxai.site/api/orgs/{org_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://web-api.soxai.site/api/orgs/{org_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"message": "Org deleted successfully"
}{
"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": "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
Delete an organization
Delete an organization together with its member roster.
The roster is removed first and the organization document second, because Firestore keeps a subcollection alive when its parent document is deleted: an orphaned roster would leave the organization’s members passing every org-scoped permission check afterwards.
Clearing the orgId claim of each removed member happens after the response is sent. A
member may therefore still hold a claim naming this organization for a short time; no endpoint
grants access on that claim alone once the organization is gone.
Parameters
org_id(path, required) - organization identifier.
Response
200{"message": "Org deleted successfully"}. The roster is already gone; the members’ claims are cleared afterwards.
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 |
Authorization
- Scheme:
Authorization: Bearer <idToken>orsoxai-api-key: <api key>. - Accepted roles:
Admin,PartnerAdmin - Any other caller receives
403 Not enough permission.
DELETE
/
api
/
orgs
/
{org_id}
Delete an organization
curl --request DELETE \
--url https://web-api.soxai.site/api/orgs/{org_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://web-api.soxai.site/api/orgs/{org_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://web-api.soxai.site/api/orgs/{org_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"message": "Org deleted successfully"
}{
"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": "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
Response
The organization and its roster are gone. The members' claims are cleared afterwards.