POST

Permissions.AddTeamMember

Assign permissions to an existing team member after creating or selecting that user. Only the owner or a manager can call this method. This is the recommended route when a UI has a separate team-member creation step and then applies permissions.

Permissions

  • Only the organization owner or a manager can call this route.

Action

  • Runs the Permissions.AddTeamMember function and returns JSON.

Push Service

Pushes event permissions.addteammember.updated 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.
  • Send parameters as POST body fields exactly as documented.

Required Parameters

NameTypeSampleExplanation
team_member_id
post
int321Team member id. Aliases: member_id, user_id, id.

Optional Parameters

NameTypeSampleWhat it gives
roles_modules
post
json{"customer_add":"1"}Permission flags for app/business modules.
shared_with_folder
post
json["1","2"]Folders this member can see. Alias: folders. Always stored as unique strings, e.g. ["1","2","3"].
folder_permissions
post
json{"1":{"edit":"1"}}Per-folder permission object.
member_admin
post
int0Set 1 to make this member a manager.
show_all_user_tickets
post
int0Set 1 to allow seeing all team tickets.

Authentication

Send the bearer token returned by Login in the request header.

Authorization: Bearer YOUR TOKEN

Sample Request

{
    "url": "\/app\/Permissions.AddTeamMember",
    "method": "POST",
    "headers": {
        "Authorization": "Bearer YOUR TOKEN"
    },
    "body": {
        "team_member_id": "321",
        "roles_modules": "{\"customer_add\":\"1\"}",
        "shared_with_folder": "[\"1\",\"2\"]"
    },
    "url_user": "https:\/\/{user}.bull36.com\/app\/Permissions.AddTeamMember",
    "url_domain": "https:\/\/{domain}\/app\/Permissions.AddTeamMember"
}

Endpoint

POST /app/Permissions.AddTeamMember
POST https://{user}.bull36.com/app/Permissions.AddTeamMember
POST https://{domain}/app/Permissions.AddTeamMember

Sample Output

{
    "success": 1,
    "message": "Permissions updated",
    "team_member_id": "321",
    "socket_event": "permissions.addteammember.updated",
    "automation_event": null
}

JavaScript Example

const token = 'YOUR TOKEN';
const body = new URLSearchParams({ team_member_id: '321', roles_modules: JSON.stringify({ customer_add: '1' }), shared_with_folder: JSON.stringify(['1', '2']) });

const res = await fetch('/app/Permissions.AddTeamMember', { 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"
}