Delete all of a company user's data
curl --request POST \
--url https://web-api.dev.soxai.site/api/companies/users/deleteUserData \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data uid=user_123 \
--data 'signed_cer=<signed-certificate>'import requests
url = "https://web-api.dev.soxai.site/api/companies/users/deleteUserData"
payload = {
"uid": "user_123",
"signed_cer": "<signed-certificate>"
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({uid: 'user_123', signed_cer: '<signed-certificate>'})
};
fetch('https://web-api.dev.soxai.site/api/companies/users/deleteUserData', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"message": "All data deleted for uid: user123"
}{
"error": "bad-request",
"error_msg": "Invalid certificate"
}{
"error": "not-found",
"error_msg": "User does not exist"
}{
"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>"
}{
"error": "service-unavailable",
"error_msg": "Failed to delete user data"
}Partner Companies
Delete all of a company user's data
Not part of the Sandbox
A Sandbox key does not authenticate this endpoint and a Sandbox identity cannot complete it, because it changes state that every Sandbox caller shares. It is published here because the Sandbox runs the same build. See Sandbox.
Delete every record SOXAI holds for one of the partner company’s users.
The account itself is left in place; this removes the data under it. The deletion is not
reversible. To take a user off the company’s roster without destroying their data, use
POST /api/companies/users/removeUser.
Parameters
uid(form, required) - the SOXAI user whose data is deleted.signed_cer(form, required) - the signing certificate, described below.
Response
200{"message"}naming what was deleted. The account itself is still there.
Errors
| Status | Condition |
|---|---|
| 400 | The certificate is malformed, unknown, revoked, expired, or wrongly signed |
| 503 | The deletion could not be carried out |
| 404 | The ex_uid names nobody in that company, or the resolved uid has no user record. Nothing is deleted |
Authorization
- No SOXAI user token. The caller authenticates with
signed_cer, a payload signed with the partner company’s private key and verified against the certificate SOXAI issued to that company. The certificate also fixes which company the request may act on, so a company cannot reach another company’s users. - A certificate that is unknown, revoked, expired, wrongly signed, or issued for a
different purpose is refused with
400.
POST
/
api
/
companies
/
users
/
deleteUserData
Delete all of a company user's data
curl --request POST \
--url https://web-api.dev.soxai.site/api/companies/users/deleteUserData \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data uid=user_123 \
--data 'signed_cer=<signed-certificate>'import requests
url = "https://web-api.dev.soxai.site/api/companies/users/deleteUserData"
payload = {
"uid": "user_123",
"signed_cer": "<signed-certificate>"
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({uid: 'user_123', signed_cer: '<signed-certificate>'})
};
fetch('https://web-api.dev.soxai.site/api/companies/users/deleteUserData', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"message": "All data deleted for uid: user123"
}{
"error": "bad-request",
"error_msg": "Invalid certificate"
}{
"error": "not-found",
"error_msg": "User does not exist"
}{
"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>"
}{
"error": "service-unavailable",
"error_msg": "Failed to delete user data"
}