ChatWoot icon

ChatWoot

Interact with ChatWoot API

Actions100

Overview

This node allows you to add one or more agents (users) to a specific team within a ChatWoot account. It is useful for automating team management tasks, such as onboarding new support agents or reorganizing teams in bulk. For example, you could use this node in an n8n workflow to automatically assign new hires to their respective support teams based on HR system triggers.

Properties

Display Name Type Description
Account Id Number The numeric ID of the ChatWoot account.
Team Id Number The ID of the team to be updated.
User Ids JSON IDs of users to be added to the team. Should be a JSON array of user IDs.

Details:

  • Account Id: Required. Identifies which ChatWoot account the team belongs to.
  • Team Id: Required. Specifies the target team for adding agents.
  • User Ids: Required. A JSON array containing the user IDs to add (e.g., [123, 456]).

Output

The output will be a json object reflecting the result of the operation. Typically, this includes:

  • Confirmation that the specified users have been added to the team.
  • Details about the updated team, such as its ID and current members.
  • Any error messages if the operation failed.

Example Output:

{
  "team_id": 42,
  "added_user_ids": [123, 456],
  "status": "success",
  "message": "Users added to team successfully."
}

Note: The exact structure may vary depending on the ChatWoot API response.

Dependencies

  • External Service: Requires access to a ChatWoot instance with API enabled.
  • API Credentials: You must configure the chatwootApi credentials in n8n, including the base URL and authentication token.
  • Environment Variables: None required by default, but your n8n instance must be able to reach the ChatWoot API endpoint.

Troubleshooting

Common Issues:

  • Invalid Account or Team ID: If the provided IDs do not exist, the API will return an error.
  • Malformed User Ids: Ensure User Ids is a valid JSON array of numbers (e.g., [1,2,3]). Invalid JSON will cause parsing errors.
  • Authentication Errors: If credentials are missing or incorrect, you may see errors like "401 Unauthorized" or "403 Forbidden".
  • Insufficient Permissions: The API key used must have permission to manage teams and users.

Error Messages & Resolutions:

  • "Invalid JSON in 'User Ids'": Double-check the input format; it must be a valid JSON array.
  • "Team not found": Verify the Team Id exists in your ChatWoot account.
  • "User(s) not found": Make sure all user IDs are correct and active in ChatWoot.
  • "Unauthorized": Check your API credentials and permissions.

Links and References

Discussion