Add a member to an organization
curl --request POST \
--url https://web-api.soxai.site/api/orgs/{org_id}/orgUsers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "developer@example.com",
"username": "Jane Doe",
"teams": [
"engineering"
],
"isAdmin": false
}
'import requests
url = "https://web-api.soxai.site/api/orgs/{org_id}/orgUsers"
payload = {
"email": "developer@example.com",
"username": "Jane Doe",
"teams": ["engineering"],
"isAdmin": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'developer@example.com',
username: 'Jane Doe',
teams: ['engineering'],
isAdmin: false
})
};
fetch('https://web-api.soxai.site/api/orgs/{org_id}/orgUsers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"message": "orgUser added successfully",
"orgUser": {
"uid": "user123",
"orgId": "org_ab12cd34",
"email": "member@example.com",
"username": "Member One",
"teams": [
"Team A"
],
"isAdmin": false,
"status": "Activated"
},
"email_message": "Invitation email sent"
}{
"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": "User 'member@example.com' not found"
}{
"error": "conflict",
"error_msg": "OrgUser already exists in this org"
}{
"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>"
}Organization Members
Add a member to an organization
Enrol an existing SOXAI account on an organization’s roster by email.
The account must already exist in SOXAI Authentication; this endpoint enrols a user, it does not create one.
Whether the new member has to accept an invitation depends on the organization:
- An organization owned by a company enrols the member as
Activatedimmediately, and no invitation email is sent. The same holds when the caller is aPartnerAdmin. - Any other organization enrols the member as
Invitation Pendingand sends an invitation email. The member becomesActivatedwhen they accept it.
The member’s orgId claim is set as part of this call, which is what lets them reach the
org-scoped endpoints.
Parameters
org_id(path, required) - organization to enrol into.- Body (
OrgUserCreate):emailis required.username,teamsandisAdminare optional;teamsaccepts a list, or a string holding one.
Response
200returns{"message", "orgUser", "email_message"}.email_messageisnullwhen no invitation was sent.
Errors
| Status | Condition |
|---|---|
| 403 | The target may not be enrolled on this organization: a company-owned organization accepts only users registered under that company |
| 404 | No SOXAI account exists for email |
| 409 | The user is already on this organization’s roster. Nothing is written |
Authorization
- Scheme:
Authorization: Bearer <idToken>orsoxai-api-key: <api key>. - Accepted roles:
PartnerAdmin,OrgAdmin 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.
POST
/
api
/
orgs
/
{org_id}
/
orgUsers
Add a member to an organization
curl --request POST \
--url https://web-api.soxai.site/api/orgs/{org_id}/orgUsers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "developer@example.com",
"username": "Jane Doe",
"teams": [
"engineering"
],
"isAdmin": false
}
'import requests
url = "https://web-api.soxai.site/api/orgs/{org_id}/orgUsers"
payload = {
"email": "developer@example.com",
"username": "Jane Doe",
"teams": ["engineering"],
"isAdmin": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'developer@example.com',
username: 'Jane Doe',
teams: ['engineering'],
isAdmin: false
})
};
fetch('https://web-api.soxai.site/api/orgs/{org_id}/orgUsers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"message": "orgUser added successfully",
"orgUser": {
"uid": "user123",
"orgId": "org_ab12cd34",
"email": "member@example.com",
"username": "Member One",
"teams": [
"Team A"
],
"isAdmin": false,
"status": "Activated"
},
"email_message": "Invitation email sent"
}{
"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": "User 'member@example.com' not found"
}{
"error": "conflict",
"error_msg": "OrgUser already exists in this org"
}{
"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
The roster entry as enrolled. email_message reports the invitation mail, and is null when none was sent.