# Create rules for profiles

Create rules to apply configuration profiles automatically to newly purchased DID numbers.

## Before you begin

- At least one configuration profile is required. See [Create configuration profile](create-configuration-profile.html).
- Rules apply only to newly purchased DID numbers. They do not update DID numbers that already exist in your account.
- Rule results depend on rule evaluation behavior. More specific rules, such as city rules, take priority over broader rules, such as country rules. See [Rule priority](../rules-reference.html#rules-priority).

## Step 1: Create a Rule

1. In the DIDWW User Panel, go to **Phone Numbers > Configuration Profiles**.
2. Open the **Rules** tab.
3. Click **Create Rule**.

[![Rules page with Create Rule button.](../../../_images/fig121.png)](../../../_images/fig121.png)


**Fig. 1.** Rules page.

## Step 2: Define the conditions the rule applies to

For the rule fields, filters, and priority details used here, see [Rules reference](../rules-reference.html).

4. Enter the rule name.
5. Select the configuration profile to apply.
6. Select the rule conditions.
7. Click **Create**.

[![Create Rule form with configured fields.](../../../_images/fig224.png)](../../../_images/fig224.png)


**Fig. 2.** Create Rule form.

## Configuration examples

Use these examples to see how configuration profiles and rules work together for common DID number setups.

### Before you begin

- Create a configuration profile first. See [Create configuration profile](create-configuration-profile.html).
- Review the profile and rule fields in [Configuration profiles reference](../profiles-reference.html) and [Rules reference](../rules-reference.html).
- Rules apply only to newly purchased DID numbers. They do not update DID numbers that already exist in your account.

Global rule

A global rule applies one configuration profile to all newly purchased DID numbers.

Use this setup when new DID numbers should use the same voice trunk, SMS trunk, Capacity group, and description by
default. If a new DID number supports inbound SMS, the selected SMS trunk is assigned for inbound messages.

The configuration profile can also include a Capacity group when newly purchased numbers need additional inbound call
Capacity after included channels are in use.

Profile setup example

| Field | Example value |
| --- | --- |
| Name | Global Default Profile |
| Capacity Group | Pay Per Minute |
| Trunk | Default Voice Trunk |
| SMS Trunk | SMS to Email |
| Description | Global DID configuration |

[![Global Default Profile.](../../../_images/fig1-21.png)](../../../_images/fig1-21.png)


**Fig. 3.** Global Default Profile.

Rule setup example

| Field | Example value |
| --- | --- |
| Name | Global Rule |
| Profile | Global Default Profile |
| Countries | Empty |
| Number Types | Empty |
| Regions | Empty |
| Cities | Empty |

[![Global rule applied to all countries.](../../../_images/example1-2.png)](../../../_images/example1-2.png)


**Fig. 4.** Global rule applied to all countries.


Country and number type rules

Country and number type rules apply different configuration profiles to newly purchased DID numbers in the same country
based on DID number type.

Use this setup when Local, Mobile, National, or Toll-Free DID numbers should use different routing or Capacity settings.

Profile setup examples

Local number type profile

Use a Local number type profile when Local DID numbers should route to a PBX or another inbound voice trunk.

| Field | Example value |
| --- | --- |
| Name | USA Local Type Profile |
| Capacity Group | Pay Per Minute |
| Trunk | My PBX |
| SMS Trunk | SMS to Email |
| Description | USA Local Settings |

[![USA Local Type Profile.](../../../_images/example2-1.png)](../../../_images/example2-1.png)


**Fig. 5.** USA Local Type Profile.


Toll-Free number type profile

Use a Toll-Free number type profile when Toll-Free DID numbers should route to a different inbound voice trunk.

| Field | Example value |
| --- | --- |
| Name | USA Toll-Free Profile |
| Capacity Group | Empty |
| Trunk | phone.systems |
| SMS Trunk | SMS to Email |
| Description | USA Toll-Free Settings |

Toll-Free numbers already include 300 channels by default, so the example does not assign a Capacity group.

[![USA Toll-Free Profile.](../../../_images/example2-1-2.png)](../../../_images/example2-1-2.png)


**Fig. 6.** USA Toll-Free Profile.

Rule setup examples

Local rule

| Field | Example value |
| --- | --- |
| Name | USA Local Rule |
| Profile | USA Local Type Profile |
| Countries | United States |
| Number Types | Local |

[![USA Local Rule.](../../../_images/example2-2-1.png)](../../../_images/example2-2-1.png)


**Fig. 7.** USA Local Rule.


Toll-Free rule

| Field | Example value |
| --- | --- |
| Name | USA Toll-Free Rule |
| Profile | USA Toll-Free Profile |
| Countries | United States |
| Number Types | Toll-Free |

[![USA Toll-Free Rule.](../../../_images/example2-2-2.png)](../../../_images/example2-2-2.png)


**Fig. 8.** USA Toll-Free Rule.


Regional rules

Regional rules apply different configuration profiles to newly purchased DID numbers in specific regions.

Use this setup when DID numbers in different regions should route through different regional trunks. Regional rules are
available for supported countries, such as the United States, Canada, and the United Kingdom.

Profile setup examples

New York region profile

| Field | Example value |
| --- | --- |
| Name | USA New York Profile |
| Capacity Group | Pay Per Minute |
| Trunk | USA East Coast SIP Trunk |
| SMS Trunk | SMS to Email |
| Description | East Coast Regional Settings |

[![USA New York Region Profile.](../../../_images/example3-1-2.png)](../../../_images/example3-1-2.png)


**Fig. 9.** USA New York Region Profile.


California region profile

| Field | Example value |
| --- | --- |
| Name | USA California Profile |
| Capacity Group | Pay Per Minute |
| Trunk | USA West Coast SIP Trunk |
| SMS Trunk | SMS to Email |
| Description | West Coast Regional Settings |

[![USA California Region Profile.](../../../_images/example3-1.png)](../../../_images/example3-1.png)


**Fig. 10.** USA California Region Profile.

Rule setup examples

New York regional rule

| Field | Example value |
| --- | --- |
| Name | USA New York Region Rule |
| Profile | USA New York Profile |
| Countries | United States |
| Number Types | Local |
| Regions | New York |

[![USA New York Region Rule.](../../../_images/example3-2.png)](../../../_images/example3-2.png)


**Fig. 11.** USA New York Region Rule.


California regional rule

| Field | Example value |
| --- | --- |
| Name | USA California Region Rule |
| Profile | USA California Profile |
| Countries | United States |
| Number Types | Local |
| Regions | California |

[![USA California Region Rule.](../../../_images/example3-2-2.png)](../../../_images/example3-2-2.png)


**Fig. 12.** USA California Region Rule.


City rules

City rules apply different configuration profiles to newly purchased DID numbers in specific cities.

Use this setup when DID numbers in individual cities should use their own inbound voice trunks, SMS trunks,
descriptions, or Capacity settings.

Profile setup examples

Stockholm city profile

| Field | Example value |
| --- | --- |
| Name | Sweden Stockholm City Profile |
| Capacity Group | Pay Per Minute |
| Trunk | Sweden Stockholm City SIP Trunk |
| SMS Trunk | SMS to Email |
| Description | Stockholm City DID Configuration |

[![Sweden Stockholm City Profile.](../../../_images/example4-1-1.png)](../../../_images/example4-1-1.png)


**Fig. 13.** Sweden Stockholm City Profile.


Warsaw city profile

| Field | Example value |
| --- | --- |
| Name | Poland Warsaw City Profile |
| Capacity Group | Pay Per Minute |
| Trunk | Poland Warsaw City SIP Trunk |
| SMS Trunk | SMS to Email |
| Description | Warsaw City DID Configuration |

[![Poland Warsaw City Profile.](../../../_images/example4-1-2.png)](../../../_images/example4-1-2.png)


**Fig. 14.** Poland Warsaw City Profile.

Rule setup examples

Stockholm city rule

| Field | Example value |
| --- | --- |
| Name | Sweden Stockholm City Only Rule |
| Profile | Sweden Stockholm City Profile |
| Countries | Sweden |
| Number Types | Local |
| Cities | Stockholm |

[![Sweden Stockholm City Rule.](../../../_images/example4-2-1.png)](../../../_images/example4-2-1.png)


**Fig. 15.** Sweden Stockholm City Rule.


Warsaw city rule

| Field | Example value |
| --- | --- |
| Name | Poland Warsaw City Only Rule |
| Profile | Poland Warsaw City Profile |
| Countries | Poland |
| Number Types | Local |
| Cities | Warsaw |

[![Poland Warsaw City Rule.](../../../_images/example4-2-2.png)](../../../_images/example4-2-2.png)


**Fig. 16.** Poland Warsaw City Rule.

## Related resources

- [Rules reference](../rules-reference.html): Review rule fields, conditions, and evaluation behavior.
- [Configuration profiles reference](../profiles-reference.html): Review Configuration Profile fields and actions.
- [How configuration profiles and rules work](../how-configuration-profiles-and-rules-work.html): Understand how profiles and rules work.
- [Create configuration profile](create-configuration-profile.html): Create a configuration profile.
- [Manage rules](manage-rules.html): Edit or delete rules.

On this page
