MsgCore icon

MsgCore

Universal messaging gateway - send messages across multiple platforms

Overview

This node operation updates the role of a member within a specified project. It is useful in scenarios where you need to change user permissions or roles dynamically, such as promoting a member to admin, demoting an admin to a viewer, or adjusting access levels based on project needs.

Practical examples:

  • Changing a team member's role from "member" to "admin" after they take on more responsibilities.
  • Restricting access by changing a user's role to "viewer".
  • Managing project members' roles programmatically during onboarding or offboarding processes.

Properties

Name Meaning
User ID of the member to update (userId) The unique identifier of the user whose role you want to update.
New role to assign (role) The new role to assign to the member. Options: admin, member, viewer.
Project The identifier of the project where the member belongs and the update will be applied.

Output

The output JSON contains the response from the API after updating the member's role. This typically includes confirmation of the update and the updated member details such as user ID, assigned role, and project association.

No binary data output is involved in this operation.

Dependencies

  • Requires an API key credential configured in n8n for authentication with the messaging gateway API.
  • The node sends a PATCH HTTP request to the endpoint /api/v1/projects/{project}/members/{userId} to perform the update.
  • The project and userId parameters must be correctly set to target the right member in the right project.

Troubleshooting

  • Common issues:

    • Incorrect or missing userId or project values will cause the API call to fail.
    • Assigning a role not in the allowed list (admin, member, viewer) will result in validation errors.
    • Insufficient permissions of the API key may prevent updating member roles.
  • Error messages:

    • 404 Not Found: The specified user or project does not exist. Verify the userId and project.
    • 403 Forbidden: The API key lacks permission to update member roles. Check API key scopes.
    • 400 Bad Request: Invalid role value or malformed request. Ensure role is one of the allowed options.

Links and References

Discussion