> For the complete documentation index, see [llms.txt](https://whatsnap.gitbook.io/whatsnap-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://whatsnap.gitbook.io/whatsnap-docs/conversations/commands-system.md).

# Command System

Master WhatSnap's command system to dynamically switch WhatsApp accounts,  send messages from specific accounts, and control message routing with simple commands.

WhatSnap's command system provides powerful control over message routing and WhatsApp account selection. These special commands allow you to override default account routing, switch accounts for specific messages, and manage multi-account communications with ease.

{% hint style="success" %}
**Invisible to Recipients**: Commands are processed by WhatSnap and not visible to message recipients. The recipient only sees your actual message content.
{% endhint %}

## Command Overview

Commands are special instructions embedded in your messages that tell WhatSnap how to handle the message routing. They work in both manual conversations and automated workflows.

### Available Commands

| Command          | Purpose                                      | Effect Duration  |
| ---------------- | -------------------------------------------- | ---------------- |
| `#switch`        | Change contact's associated WhatsApp account | Permanent        |
| `#switch_unique` | Send single message from different account   | One message only |

### How Commands Work

{% @mermaid/diagram content="graph TD;
A\["👤 User Types Message with Command"] --> B\["🤖 WhatSnap Detects Command"];
B --> C\["⚙️ Processes Command Instructions"];
C --> D{Command Type?};
D -->|"🔄 #switch"| E\["🏷️ Change Contact Account Tag"];
D -->|"🎯 #switch\_unique"| F\["⚡ Use Account for This Message Only"];
E --> G\["📝 Update Contact Tag"];
F --> H\["📌 Keep Original Tag"];
G --> I\["📱 Send Message from New Account"];
H --> I;
I --> J\["📨 Recipient Receives Message"];
J --> K\["🔒 Command Hidden from Recipient"];

```
classDef user fill:#e3f2fd,stroke:#1976d2,stroke-width:3px,color:#000000;
classDef system fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px,color:#000000;
classDef decision fill:#e1f5fe,stroke:#3f51b5,stroke-width:2px,color:#000000;
classDef permanent fill:#e8f5e8,stroke:#00695c,stroke-width:2px,color:#000000;
classDef temporary fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px,color:#000000;
classDef delivery fill:#e8f5e8,stroke:#00695c,stroke-width:2px,color:#000000;

class A user;
class B,C system;
class D decision;
class E,G permanent;
class F,H temporary;
class I,J,K delivery;" %}
```

## Switch Command (`#switch`)

The `#switch` command permanently changes which WhatsApp account is associated with a contact.

### Syntax

```
#switch|whatsnap-account-[account-name] Your message content here
```

### How It Works

{% stepper %}
{% step %}

#### Command Detection

WhatSnap detects the `#switch` command at the beginning of your message.
{% endstep %}

{% step %}

#### Account Identification

The system identifies the target WhatsApp account based on the tag provided.
{% endstep %}

{% step %}

#### Tag Update

The contact's tag is permanently updated to the new WhatsApp account tag.
{% endstep %}

{% step %}

#### Message Delivery

The message is sent from the specified WhatsApp account.
{% endstep %}

{% step %}

#### Future Messages

All future messages to this contact will use the new WhatsApp account.
{% endstep %}
{% endstepper %}

### Practical Examples

{% tabs %}
{% tab title="Sales Handoff" %}
**Scenario**: Marketing contact needs to be handed off to sales

**Command**:

```
#switch|whatsnap-account-sales Hi John, this is Mike from our sales team. I understand you're interested in our premium package...
```

**What Happens**:

1. Contact's tag changes from `whatsnap-account-marketing` to `whatsnap-account-sales`
2. Message sent from Sales WhatsApp account
3. All future messages to John use Sales account
4. John sees: "Hi John, this is Mike from our sales team. I understand you're interested in our premium package..."
   {% endtab %}

{% tab title="Support Transfer" %}
**Scenario**: General inquiry needs technical support

**Command**:

```
#switch|whatsnap-account-tech-support Hello Sarah, I'm transferring you to our technical support team. They'll be able to help you with the integration questions.
```

**What Happens**:

1. Contact's tag changes to `whatsnap-account-tech-support`
2. Message sent from Technical Support WhatsApp account
3. Future support messages use Technical Support account
4. Clear departmental handoff maintained
   {% endtab %}

{% tab title="Regional Transfer" %}
**Scenario**: Contact needs regional representative

**Command**:

```
#switch|whatsnap-account-west-coast Hi Maria, I'm connecting you with our West Coast team who can better assist you with local services.
```

**What Happens**:

1. Contact's tag changes to `whatsnap-account-west-coast`
2. Message sent from West Coast WhatsApp account
3. Regional representative takes over communication
4. Local expertise and timezone alignment
   {% endtab %}
   {% endtabs %}

### Workflow Integration

The `#switch` command works seamlessly in GoHighLevel workflows:

**Workflow Example - Sales Qualification**:

```
Trigger: Contact responds with "Yes" to marketing message
Action: Send SMS with content:
#switch|whatsnap-account-sales Great news! I'm connecting you with our sales specialist who will help you get started. Expect a call within 2 hours.
```

**Result**: Contact is automatically transferred to sales WhatsApp account and assigned appropriately.

## Switch Unique Command (`#switch_unique`)

The `#switch_unique` command sends a single message from a different WhatsApp account without changing the contact's permanent association.

### Syntax

```
#switch_unique|whatsnap-account-[account-name] Your message content here
```

### How It Works

{% stepper %}
{% step %}

#### Temporary Override

WhatSnap temporarily uses the specified WhatsApp account for this message only.
{% endstep %}

{% step %}

#### Send Message

The message is sent from the specified account.
{% endstep %}

{% step %}

#### Preserve Association

The contact's original WhatsApp account tag remains unchanged.
{% endstep %}

{% step %}

#### Resume Normal Routing

Future messages return to using the contact's original WhatsApp account.
{% endstep %}
{% endstepper %}

### Practical Examples

{% tabs %}
{% tab title="Manager Introduction" %}
**Scenario**: Support rep wants to introduce manager without transferring the case

**Primary Contact Tag**: `whatsnap-account-support`

**Command**:

```
#switch_unique|whatsnap-account-manager Hello Jennifer, this is David, the support manager. I wanted to personally ensure you're getting the best possible help with your issue.
```

**What Happens**:

1. Message sent from Manager's WhatsApp account
2. Contact's tag remains `whatsnap-account-support`
3. Next message from support rep uses Support account again
4. Manager introduction without permanent transfer
   {% endtab %}

{% tab title="Specialist Consultation" %}
**Scenario**: General support case needs one-time expert input

**Primary Contact Tag**: `whatsnap-account-support`

**Command**:

```
#switch_unique|whatsnap-account-technical-expert Hi Tom, I'm Dr. Peterson, our lead technical expert. Based on your description, here's my recommendation for your integration setup...
```

**What Happens**:

1. Expert advice delivered from specialist's account
2. Contact remains associated with general support
3. Follow-up handled by original support representative
4. Expert input without changing ownership
   {% endtab %}

{% tab title="Cross-Department Update" %}
**Scenario**: Sales rep needs to provide billing update

**Primary Contact Tag**: `whatsnap-account-sales`

**Command**:

```
#switch_unique|whatsnap-account-billing Hi Lisa, this is Janet from billing. Your payment has been processed successfully and your account is now fully active.
```

**What Happens**:

1. Billing update sent from Billing WhatsApp account
2. Contact remains associated with Sales
3. Sales rep continues primary relationship
4. Departmental expertise without confusion
   {% endtab %}
   {% endtabs %}

### Workflow Applications

`#switch_unique` is powerful in automated workflows for multi-departmental communication:

**Example Workflow - Order Processing**:

```
Trigger: Order status changes to "Shipped"
Action 1: Send SMS (from shipping account):
#switch_unique|whatsnap-account-shipping Your order #12345 has shipped! Tracking number: ABC123. Expected delivery: Friday.

Action 2: Wait 2 days

Action 3: Send SMS (back to original sales account):
How was your delivery experience? We'd love to hear your feedback!
```

## Command Best Practices

### Choosing Between Commands

{% hint style="info" %}
**Decision Guide**: Use `#switch` for permanent transfers and `#switch_unique` for temporary interactions while maintaining primary relationships.
{% endhint %}

| Use `#switch` When     | Use `#switch_unique` When      |
| ---------------------- | ------------------------------ |
| Transferring ownership | Providing temporary expertise  |
| Changing departments   | Manager/executive introduction |
| Regional reassignment  | Cross-departmental updates     |
| Role changes           | One-time specialist input      |
| Process handoffs       | Temporary coverage             |

### Message Composition

**Command Formatting:**

* **Commands must be at the beginning** of the message
* **Use exact tag names** as they appear in your system
* **Include space after command** before message content
* **No spaces around the pipe (|) character**

**Good Examples:**

```
✅ #switch|whatsnap-account-sales Hello from our sales team!
✅ #switch_unique|whatsnap-account-manager Quick update from management...
```

**Bad Examples:**

```
❌ Hello! #switch|whatsnap-account-sales (command not at beginning)
❌ #switch | whatsnap-account-sales (spaces around pipe)
❌ #switch|wrong-tag-name (incorrect tag format)
```

### Tag Verification

**Before Using Commands:**

* **Verify tag names** match exactly with your connected accounts
* **Test commands** with a small group before widespread use
* **Document tag naming** conventions for your team
* **Regular audits** to ensure tags remain current

## Advanced Command Usage

### Workflow Command Strategies

{% tabs %}
{% tab title="Escalation Workflow" %}
**Progressive Support Escalation**

```
Level 1: Standard support (whatsnap-account-support)
↓ If not resolved in 24 hours
Level 2: #switch|whatsnap-account-senior-support
↓ If still not resolved in 48 hours  
Level 3: #switch|whatsnap-account-support-manager
```

**Benefits:**

* Automatic escalation with appropriate handoffs
* Clear communication from each level
* Maintained conversation context
  {% endtab %}

{% tab title="Campaign Follow-up" %}
**Multi-Touch Campaign with Different Voices**

```
Day 1: Marketing message (whatsnap-account-marketing)
Day 3: #switch_unique|whatsnap-account-sales Quick follow-up from sales...
Day 7: Sales continues (whatsnap-account-marketing - original)
Day 14: #switch_unique|whatsnap-account-manager Personal note from leadership...
```

**Benefits:**

* Multiple touchpoints with different perspectives
* Maintained primary campaign context
* Varied communication style
  {% endtab %}

{% tab title="Customer Journey" %}
**Complete Customer Lifecycle Management**

```
Lead Stage: whatsnap-account-marketing
Qualification: #switch|whatsnap-account-sales  
Onboarding: #switch|whatsnap-account-onboarding
Support: #switch|whatsnap-account-support
Account Management: #switch|whatsnap-account-success
```

**Benefits:**

* Clear stage-based communication
* Specialized expertise at each stage
* Smooth customer experience transitions
  {% endtab %}
  {% endtabs %}

### Multi-Account Campaign Distribution

Use commands to distribute campaigns across multiple accounts:

**Campaign Setup:**

```
Contact Group 1: #switch|whatsnap-account-campaign-1
Contact Group 2: #switch|whatsnap-account-campaign-2  
Contact Group 3: #switch|whatsnap-account-campaign-3
Contact Group 4: #switch|whatsnap-account-campaign-4
```

**Benefits:**

* **Risk Distribution**: Issues with one account don't affect others
* **Speed Increase**: Parallel sending through multiple accounts
* **Limit Management**: Stay within daily message limits per account
* **Performance Testing**: Compare account performance

## Troubleshooting Commands

### Common Command Issues

<details>

<summary>Command Not Working</summary>

**Possible Causes:**

* Command not at beginning of message
* Incorrect tag format or name
* Target account not connected
* Typo in command syntax

**Solutions:**

* Ensure command starts the message
* Verify exact tag name matches connected account
* Check target account connection status
* Review command syntax for errors

</details>

<details>

<summary>Wrong Account Used Despite Command</summary>

**Possible Causes:**

* Tag name doesn't match any connected account
* Multiple conflicting commands in message
* WhatsApp account disconnected

**Solutions:**

* Verify tag name exactly matches connected account
* Use only one command per message
* Check connection status of target account
* Test with known working tag names

</details>

<details>

<summary>Contact Tag Not Updating (#switch)</summary>

**Possible Causes:**

* Permission issues with contact modification
* Workflow conflicts overriding tag changes
* System processing delays

**Solutions:**

* Check user permissions for contact editing
* Review workflows that might modify tags
* Allow time for system processing
* Verify tag change in contact record

**Commands still not working?** Salvador built this command system and can debug your exact setup → [Get Salvador's help](https://wa.me/17543029801?text=Hey%20Salvador%2C%20the%20WhatSnap%20command%20system%20isn%27t%20working%20for%20me)

</details>

### Testing Commands

**Recommended Testing Process:**

{% stepper %}
{% step %}

#### Test Environment Setup

Use test contacts and messages to verify command functionality before production use.
{% endstep %}

{% step %}

#### Command Verification

Test each command type with known contacts and verify correct behavior.
{% endstep %}

{% step %}

#### Tag Confirmation

Check contact records to confirm tag changes (for `#switch`) and stability (for `#switch_unique`).
{% endstep %}

{% step %}

#### Workflow Integration

Test commands within workflows to ensure proper integration with automation.
{% endstep %}
{% endstepper %}

## Integration with Other Features

### Command + Outreach Campaigns

Commands work within outreach campaigns to provide sophisticated routing:

**Example**: Campaign message that routes qualified leads to sales:

```
Hi {{first_name}}, interested in learning more about our premium features? 
Reply YES for pricing information.

[Workflow triggers on "YES" response]
#switch|whatsnap-account-sales Great! I'm connecting you with our sales specialist for personalized pricing...
```

### Command + User Assignments

Commands work together with user assignments:

1. **Command switches account tag**
2. **User assignment rules activate for new tag**
3. **Contact automatically assigned to appropriate team member**
4. **Seamless handoff with proper routing**

## Next Steps

After mastering the command system:

1. [**Workflow Automation**](/whatsnap-docs/conversations/workflow-automation.md) - Integrate commands into automated workflows
2. [**Outreach Campaigns**](https://github.com/WhatSnap/documentation/blob/main/outreach/campaign-overview.md) - Use commands in mass messaging campaigns
3. [**Advanced Strategies**](https://github.com/WhatSnap/documentation/blob/main/advanced/multi-account-strategies.md) - Implement sophisticated multi-account workflows
4. [**Team Training**](https://github.com/WhatSnap/documentation/blob/main/advanced/team-management.md) - Train your team on effective command usage

{% hint style="success" %}
**Command Mastery**: The command system is one of WhatSnap's most powerful features. Master it to unlock sophisticated multi-account messaging strategies that would be impossible with traditional WhatsApp integrations.
{% endhint %}
