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
This node integrates with the SparkBot WhatsApp API to create a new department within a specified WhatsApp number (device). Departments help organize agents into groups for managing conversations or workflows more efficiently. This operation is useful in scenarios where businesses want to segment their support or sales teams by function, product line, or region.
For example, a company might create separate departments for "Sales," "Support," and "Billing," each with distinct colors and icons for quick identification. Agents assigned to these departments will handle messages routed accordingly, improving team collaboration and customer experience.
Properties
| Name | Meaning |
|---|---|
| WhatsApp Number | The ID of the WhatsApp number (device) under which the department will be created. |
| Name | Department name, must be between 2 and 25 characters. |
| Color | Department color used for quick visual identification. Options include Ruby, Tomato, Orange, Sunflower, Bubble, Rose, Poppy, Rouge, Raspberry, Purple, Lavender, Violet, Pool, Emerald, Kelly, Apple, Turquoise, Aqua, Gold, Latte, Cocoa, Iron. |
| Icon | Department icon identifier for visual representation. 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 | Optional description of the department, up to 300 characters. |
| Agents | List of agent IDs to include in the department. Requires between 1 and 30 agents. |
Output
The node outputs JSON data representing the newly created department. This typically includes details such as the department's unique identifier, name, color, icon, description, associated WhatsApp number, and the list of assigned agents.
No binary data output is involved in this operation.
Dependencies
- Requires an active connection to the SparkBot WhatsApp API.
- An API key credential must be configured in n8n to authenticate requests.
- The WhatsApp number (device) must be valid and accessible via the API.
- Agent IDs must correspond to existing agents in the system.
Troubleshooting
- Invalid WhatsApp Number: If the provided WhatsApp number ID is incorrect or not linked to your account, the node will fail. Verify the device ID is correct and accessible.
- Agent List Issues: Providing zero agents or more than 30 agents will cause validation errors. Ensure the agent list contains between 1 and 30 valid agent IDs.
- Name Length Violations: Department names shorter than 2 or longer than 25 characters will be rejected. Adjust the name accordingly.
- API Authentication Errors: Missing or invalid API keys will prevent successful communication. Confirm that the API key credential is properly set up.
- Color or Icon Invalid Option: Selecting a color or icon outside the predefined options may cause errors. Use only the listed values.
If the node throws an error message containing "error" in the JSON output, check the message for specific details and adjust input parameters or credentials accordingly.