Number selection works the same way for every channel. When you send an outbound message, the integration walks a fixed priority hierarchy and picks the first instance that matches. Only the tag and override syntax changes between WhatsApp, iMessage, and SMS - the decision logic does not.
Selection Priority Hierarchy
The system evaluates these rules in order and uses the first one that resolves to a connected instance:| Priority | Rule | How it’s triggered |
|---|---|---|
| 1 (highest) | Manual Override | The message contains an override pattern (e.g. { WA#N }, {IM#N}) |
| 2 | Temporary Switch | The message contains a temporary-switch pattern (e.g. {TEMP-IM#N}) - one message only |
| 3 | Contact Tags | The contact is tagged with a number (e.g. wa:, im:, sms:) |
| 4 | User Assignment | The contact is assigned to a user who has an instance assigned to them |
| 5 | Default Instance | A location default is configured |
| 6 (lowest) | Any Available | Falls back to any connected instance |
In every case the system only considers connected instances. If the rule resolves to a disconnected instance, it raises an error rather than silently falling through - see Number Selection Errors.
Per-Channel Syntax Reference
The patterns below are interchangeable in concept - pick the row for the channel you’re sending on.N is the instance index; +1234567890 is the target number.
| Capability | iMessage | SMS | |
|---|---|---|---|
| Manual override | { WA#N } | {IM#N} | - |
| Temporary switch (one message) | - | {TEMP-IM#N} | - |
| Contact tag | wa: +1234567890 | im: +1234567890 | sms: +1234567890 |
Priority Rules in Detail
1. Manual Override
Add the override pattern for your channel anywhere in the message -
{ WA#N } for WhatsApp or {IM#N} for iMessage - where N is the instance index, to force a specific instance.- When used: The message contains a manual override pattern.
- Example:
"This message will go via the 2nd instance { WA#2 }" - Behavior:
- Extracts the instance index from the pattern.
- Validates that the instance exists and is connected.
- Removes the pattern from the message before sending.
2. Temporary Switch (iMessage)
Use
{TEMP-IM#N} to send a single message from a different account without permanently changing the contact’s assigned account.- When used: You want to send one message from a different number without changing the contact’s normal account assignment.
- Example:
"Quick update from our support line {TEMP-IM#3}" - Behavior:
- Temporarily routes the message through the specified account.
- Does not change the contact’s default account assignment.
- Removes the pattern from the message before sending.
- Future messages to this contact continue using their normal account.
3. Contact Tags
Tag a contact with
wa: +1234567890 (or im: / sms:) to always use a specific number for that contact.- When used: The contact has a number tag for the channel.
- Example: Contact tagged with
wa: +15551234567 - Behavior:
- The system scans the contact’s tags for the channel’s number pattern (
wa:,im:, orsms:). - It finds the connected instance whose phone number matches the tagged number.
- If a match is found, that instance is used for the message.
- The system scans the contact’s tags for the channel’s number pattern (
4. User Assignment
When a contact is assigned to a user in your CRM, the system uses that user’s instance for the channel being sent on.
- When used: The contact is assigned to a specific user who has an instance assigned to them.
- Behavior:
- The system looks up the user the contact is assigned to in your CRM.
- It finds the instance assigned to that user for the channel being sent on.
- If that instance is connected, it’s used for the message.
5. Default Instance
Always set one instance as the “default” for each location to ensure reliable fallback behavior.
- When used: No specific override, tag, or user assignment resolves.
- Behavior:
- Uses the instance marked as “default” for the location.
- Only considers connected instances.
6. Any Available Instance
- When used: As the final fallback.
- Behavior:
- Selects any connected instance with a phone number.
Advanced Configuration Examples
Example 1: E-commerce Setup
Example 2: Agency Client Management
Best Practices
Setup Recommendations
Error Prevention
Validate manual overrides
Ensure
{ WA#N } / {IM#N} patterns reference existing, connected instances.Troubleshooting Workflow
What’s Next?
- Number Selection Errors: Error codes 101-106 and how to resolve them
- Multiple Instances Overview: Use cases, benefits, and setup
- Full Setup Guide: Connect instances and configure assignments
Support
If you need help with the setup or onboarding:- Email: support@messagesync.ai

