POST
TeamMembers.Add
Add a team member to the organization. Only the owner or a manager can call this method. The new user is created as a team member under the current organization, optional permissions can be assigned in the same call, and open UIs receive a socket event to refresh User.Basic.
Permissions
- On a company subdomain (e.g. https://{user_domain}.bull36.com) the user must match that Host — Login and protected APIs reject another company with success=0, error user_not_in_company. On a main brand host (bull36.com, biz1.co.il, mastrocrm.com, …) the company domain gate is skipped.
- Only the organization owner or a manager can call this route.
Action
- Creates a TeamMembers record or sends the requested data after validation.
Push Service
Pushes event teammembers.add.created to users who should see this change.
Automation
No automation is run for this function.
Special Instructions
- Send the bearer token on protected calls with Authorization: Bearer YOUR TOKEN.
- On a company subdomain (e.g. https://{user_domain}.bull36.com) the user must match that Host — Login and protected APIs reject another company with success=0, error user_not_in_company. On a main brand host (bull36.com, biz1.co.il, mastrocrm.com, …) the company domain gate is skipped.
- Send parameters as POST body fields exactly as documented.
- Send date/time values in UTC Y-m-d H:i:s format when a date or datetime field is used.
Required Parameters
| Name | Type | Sample | Explanation |
|---|---|---|---|
namepost | string | Dana Cohen | Team member full name. |
emailpost | [email protected] | Team member login email. Must be unique. | |
passwordpost | string | StrongPassword123 | Initial password for the team member. |
Optional Parameters
| Name | Type | Sample | What it gives |
|---|---|---|---|
user_namepost | string | [email protected] | Optional login username. Defaults to email. |
phonepost | string | 0500000000 | Office phone. |
mobilepost | string | 0500000001 | Mobile phone. |
titlepost | string | Sales manager | Job title shown in team lists. |
statuspost | int | 1 | 1 active, 0 inactive. |
member_adminpost | int | 0 | Set 1 to make this member a manager. |
timezonepost | string | Asia/Jerusalem | Default timezone. |
default_langpost | string | he | Default UI language. |
default_folderpost | int | 1 | Default customer folder. |
roles_modulespost | json | {"customer_add":"1"} | Permission flags saved on the member. |
shared_with_folderpost | json | ["1","2"] | Folders this member can see. Always stored as unique strings, e.g. ["1","2","3"]. |
folder_permissionspost | json | {"1":{"edit":"1"}} | Per-folder permissions. |
Authentication
Send the bearer token returned by Login in the request header. The user must be from the same company domain as this Host — a token from another company is rejected (user_not_in_company).
Authorization: Bearer YOUR TOKEN
Sample Request
{
"url": "\/app\/TeamMembers.Add",
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR TOKEN"
},
"body": {
"name": "Dana Cohen",
"email": "[email protected]",
"password": "StrongPassword123",
"shared_with_folder": "[\"1\",\"2\"]"
},
"url_user": "https:\/\/{user}.bull36.com\/app\/TeamMembers.Add",
"url_domain": "https:\/\/{domain}\/app\/TeamMembers.Add"
}Endpoint
POST /app/TeamMembers.Add
POST https://{user}.bull36.com/app/TeamMembers.Add
POST https://{domain}/app/TeamMembers.AddSample Output
{
"success": 1,
"message": "Team member created",
"team_member_id": "321",
"socket_event": "teammembers.add.created",
"automation_event": null
}JavaScript Example
const token = 'YOUR TOKEN';
const body = new URLSearchParams({ name: 'Dana Cohen', email: '[email protected]', password: 'StrongPassword123' });
const res = await fetch('/app/TeamMembers.Add', { method: 'POST', headers: { Authorization: `Bearer ${token}` }, body });
const data = await res.json();
console.log(data);Error Example
{
"success": "0",
"error": "permission_denied",
"message": "Permission denied to manage this resource"
}