Actions148
- Chats Actions
- Chat Contacts Actions
- Chat Messages Actions
- Chat Files Actions
- Files Actions
- Team Actions
- Labels Actions
- Departments Actions
- Quick replies Actions
- Queue Actions
- WhatsApp session Actions
- WhatsApp profile Actions
- Business catalog Actions
- Campaigns Actions
- Meeting Links Actions
- User Status Actions
- Webhooks Actions
- Other Actions
- Send messages Actions
- Outbound Messages Actions
- WhatsApp Numbers Actions
- Groups Actions
- Channels Actions
Overview
The "Update Department" operation in the Departments resource allows users to modify existing department details within a WhatsApp-based team management system. This node is useful for administrators who want to keep their department information current, such as changing the department's name, color, icon, description, or updating the list of agents assigned to that department.
Practical examples include:
- Renaming a department to reflect organizational changes.
- Changing the department's color or icon for better visual identification in the user interface.
- Updating the description to provide more context about the department's role.
- Adding or removing agents from the department to manage team composition dynamically.
Properties
| Name | Meaning |
|---|---|
| WhatsApp Number | The ID of the WhatsApp number associated with the department. |
| Department ID | The unique identifier of the department to update. |
| Name | New department name (2-25 characters). |
| Color | New department color for quick identification. Options: Ruby, Tomato, Orange, Sunflower, Bubble, Rose, Poppy, Rouge, Raspberry, Purple, Lavender, Violet, Pool, Emerald, Kelly, Apple, Turquoise, Aqua, Gold, Latte, Cocoa, Iron. |
| Icon | New department icon identifier. Options include: Briefcase, Users, User Tie, Chart Bar, Clipboard List, Comments, Headset, User Cog, User Edit, User Friends, Laptop Code, Network Wired, Building, Handshake, Address Book, Layer Group, Project Diagram, Calendar Check, Clipboard Check, Tasks, Chart Pie, Hands Helping, Shield Alt, User Lock, User Shield, Bullhorn, Comments Dollar, Comment Dots, Fingerprint, Check Circle, Chalkboard Teacher, Cogs, Rocket, Drafting Compass, Lightbulb, Envelope, Inbox, People Carry, Code Branch, Globe, Hand Holding USD, Money Bill Wave, Phone, Wrench, Balance Scale, Thumbs Up, User Secret, User Graduate, Landmark, Archive. |
| Description | New department description (maximum 300 characters). |
| Agents | New list of agent IDs to include in the department (requires between 1 and 30 agents). |
Output
The node outputs JSON data representing the updated department object returned by the API after the update operation. This typically includes the updated fields such as department ID, name, color, icon, description, and the list of agents currently assigned.
No binary data output is involved in this operation.
Dependencies
- Requires an API key credential for authenticating with the SparkBot WhatsApp API.
- The node depends on the external SparkBot WhatsApp API service to perform department updates.
- Proper configuration of the WhatsApp number and agent lists is necessary for successful updates.
Troubleshooting
Common issues:
- Providing an invalid or non-existent Department ID will result in errors.
- Omitting required fields like WhatsApp Number or Department ID will cause the operation to fail.
- Specifying an empty or invalid list of agents (less than 1 or more than 30) may trigger validation errors.
- Using unsupported color or icon values outside the provided options will cause errors.
Error messages and resolutions:
- "Department not found": Verify the Department ID is correct and belongs to the specified WhatsApp number.
- "Invalid agent list": Ensure the agents array contains valid agent IDs and meets the required count.
- "Authentication failed": Check that the API key credential is correctly configured and has proper permissions.
- "Validation error": Confirm all input properties meet the expected formats and constraints (e.g., name length, description length).
Links and References
- SparkBot WhatsApp API Documentation (general reference for API endpoints and usage)
- n8n Documentation on Creating Custom Nodes