Change a company user's email with a certificate
curl --request POST \
--url https://web-api.soxai.site/api/companies/users/changeEmail \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data ex_uid=external_123 \
--data 'signed_cer=<signed-certificate>' \
--data new_email=developer@example.comimport requests
url = "https://web-api.soxai.site/api/companies/users/changeEmail"
payload = {
"ex_uid": "external_123",
"signed_cer": "<signed-certificate>",
"new_email": "developer@example.com"
}
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({
ex_uid: 'external_123',
signed_cer: '<signed-certificate>',
new_email: 'developer@example.com'
})
};
fetch('https://web-api.soxai.site/api/companies/users/changeEmail', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"uid": "user123",
"email": "new@example.com"
}{
"error": "bad-request",
"error_msg": "Invalid email format"
}{
"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>"
}Partner Companies
Change a company user's email with a certificate
Change the email address of a user the partner company registered.
Parameters
ex_uid(form, required) - the company’s identifier for the user.new_email(form, required) - the new address; it must be well formed.signed_cer(form, required) - the signing certificate, described below.
Response
200reports the change. The address is updated in SOXAI Authentication as well as in the company’s own record, so the user signs in with the new one.
Errors
| Status | Condition |
|---|---|
| 400 | The certificate is invalid, or new_email is malformed |
| 404 | ex_uid names no user of this company |
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. - A certificate that is unknown, revoked, expired, wrongly signed or issued for a different
purpose is refused with
400.
POST
/
api
/
companies
/
users
/
changeEmail
Change a company user's email with a certificate
curl --request POST \
--url https://web-api.soxai.site/api/companies/users/changeEmail \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data ex_uid=external_123 \
--data 'signed_cer=<signed-certificate>' \
--data new_email=developer@example.comimport requests
url = "https://web-api.soxai.site/api/companies/users/changeEmail"
payload = {
"ex_uid": "external_123",
"signed_cer": "<signed-certificate>",
"new_email": "developer@example.com"
}
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({
ex_uid: 'external_123',
signed_cer: '<signed-certificate>',
new_email: 'developer@example.com'
})
};
fetch('https://web-api.soxai.site/api/companies/users/changeEmail', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"uid": "user123",
"email": "new@example.com"
}{
"error": "bad-request",
"error_msg": "Invalid email format"
}{
"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>"
}Body
application/x-www-form-urlencoded
Response
The address is updated in SOXAI Authentication as well as in the company's own record, so the user signs in with the new one.