ChatWoot icon

ChatWoot

Interact with ChatWoot API

Actions100

Overview

The Update Agents In Team operation for the Teams resource in this custom n8n node allows you to update the list of agents (users) assigned to a specific team within your ChatWoot account. This is useful for managing team memberships dynamically, such as when onboarding new agents, restructuring teams, or automating user assignments based on workflow logic.

Practical examples:

  • Automatically add new support agents to a default team when they join.
  • Reassign users to different teams based on workload or shift changes.
  • Sync team membership with an external HR or scheduling system.

Properties

Display Name Type Description
Account Id Number The numeric ID of the ChatWoot account. Required to specify which account's team is being updated.
Team Id Number The ID of the team whose agent list will be updated.
User Ids JSON IDs of users to be added to the team. Should be provided as a JSON array of user IDs. Example: [123, 456, 789]

Output

The node outputs a json field containing the response from the ChatWoot API after updating the team's agents. The structure typically includes:

  • Confirmation of the update.
  • Details about the team and its current members.
  • Any error messages if the update fails.

Example output:

{
  "id": 42,
  "name": "Support Team",
  "user_ids": [123, 456, 789],
  "updated_at": "2024-06-01T12:34:56Z"
}

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 Key/Credentials: You must configure the chatwootApi credentials in n8n, including the base URL (url) and authentication details.
  • n8n Configuration: Ensure the node has network access to your ChatWoot server.

Troubleshooting

Common issues:

  • Invalid Account or Team ID: If the provided Account Id or Team Id does not exist, the API will return an error.
  • Malformed User Ids: The User Ids property must be a valid JSON array of numbers. Supplying invalid JSON or non-numeric values will cause errors.
  • Authentication Errors: Missing or incorrect API credentials will result in authorization failures.

Common error messages:

  • "Team not found": Check that the Team Id is correct and exists in the specified account.
  • "Invalid user_ids format": Ensure User Ids is a JSON array, e.g., [1,2,3].
  • "Unauthorized": Verify that your API credentials are set up correctly in n8n.

Links and References

Discussion