# Create an HTTP IN trunk

Create an HTTP IN trunk to forward incoming SMS messages from your DID numbers
to a web server or application endpoint. Define the HTTP request that DIDWW
sends for each message, and optionally add the trunk to an SMS trunk group.

For how DIDWW delivers inbound SMS to your endpoint, see [HTTP IN trunk](../http-in-trunk.html).

## Before you begin

- An active DIDWW account is required. [Sign in to DIDWW](https://my.didww.com/users/sign_in) or [Create DIDWW account](https://my.didww.com/users/sign_up#/users/sign_up).
- A web server or application endpoint that accepts HTTP requests is
  required. If the endpoint is behind a firewall, allow requests from the
  DIDWW source IP addresses. See [HTTP request details from
DIDWW](../../technical-data/http-specification.html#sms-in-spec-request).

## Step 1: Open the creation form

1. In the DIDWW User Panel, go to **SMS > SMS Trunks**.
2. Click **Create New** in the top-right corner.
3. Select **HTTP IN** from the dropdown menu.

[![Create New menu on the SMS Trunks page with HTTP IN highlighted](../../../../_images/fig159.png)](../../../../_images/fig159.png)


**Fig. 1.** Select HTTP IN

## Step 2: Configure the General settings

In the **General** section, define how incoming SMS messages are delivered to
your HTTP endpoint.

1. In **Friendly name**, enter a unique, descriptive name to identify the
   trunk.
2. In **HTTP Method**, select `GET`, `POST`, or `PUT`. The default is
   `GET`.
3. In **Request URL**, enter the URL of your web server or application
   endpoint. For example, `https://example.com/sms`.
4. Optionally, change the **Validate HTTPS Certificate** toggle (on by
   default) or the **Follow redirect** toggle (off by default).
5. Optionally, under **Query Parameters**, click **Add Parameter** to add
   key-value pairs to the request URL. Under **Headers**, click **Add
   Header** to add custom HTTP headers.
6. If you selected `POST` or `PUT`, under **Body Parameters**, select the
   **Body type**. For **JSON** or **RAW**, enter the **Request body**. For
   **HTML Multipart** or **HTML URL Encoded**, click **Add Parameter** to add
   key-value pairs.

[![Create HTTP IN Trunk form with the General settings, the list of available variables, and the Trunk Group Configuration section](../../../../_images/fig253.png)](../../../../_images/fig253.png)


**Fig. 2.** Configure the HTTP IN trunk

You can use variables in the **Request URL**, **Query Parameters**,
**Headers**, and request body, for example `{SMS_TEXT}` for the message
text. Field definitions, defaults, and variables are listed in [General
settings](../http-in-trunk-settings-reference.html#http-in-trunk-settings-general) and [Request
variables](../http-in-trunk-settings-reference.html#http-in-trunk-settings-variables).

## Step 3: Add the trunk to a trunk group (optional)

You may assign the trunk to an existing SMS trunk group in order to enable
failover. Within the trunk group, the trunk's priority determines the order in
which trunks will be used. If the trunk will not be part of a trunk group,
skip to Step 4.

1. Expand the **Trunk Group Configuration** section and select the group in
   **Assign to trunk group**.
2. In **Priority**, enter the trunk's priority within the group, from `0`
   to `32767`.

[![Trunk Group Configuration section of the Create HTTP IN Trunk form with the Assign to trunk group and Priority fields](../../../../_images/trunk_group.webp)](../../../../_images/trunk_group.webp)


**Fig. 3.** Configure the trunk group settings

Note

The system attempts to contact the target SMS trunk with the
highest-numbered priority first.

Field definitions are listed in [Trunk group
settings](../http-in-trunk-settings-reference.html#http-in-trunk-settings-trunk-group). To create a group, see [Create
an
SMS trunk group](../../trunk-groups/how-to-guides/create-sms-trunk-group.html).

## Step 4: Create the trunk

Click **Create** at the bottom of the page to save the new trunk.

[![Create button highlighted on the Create HTTP IN Trunk form](../../../../_images/create.webp)](../../../../_images/create.webp)


**Fig. 4.** Create the trunk

The new trunk appears in the **SMS Trunks** list. Creating the trunk does not
assign it to a DID number.

## Next steps

- To receive messages, [assign the trunk or its SMS trunk group to one or
  more DID numbers](../../../../phone-numbers/my-numbers/how-to-guides/assign-sms-trunk.html#assigning-sms-trunk) that
support inbound SMS.
- Send a test SMS to an assigned DID number and check that the request
  reaches your endpoint. If it does not, review [Inbound SMS
logs](../../../../logs-analytics/sms-logs/inbound-logs.html#inbound-logs).

## Related resources

- [HTTP IN trunk settings reference](../http-in-trunk-settings-reference.html) - Look up field definitions,
  available values, and constraints.
- [HTTP IN trunk](../http-in-trunk.html) - Understand how DIDWW delivers
  inbound SMS to your HTTP endpoint.
- [Assign an SMS trunk](../../../../phone-numbers/my-numbers/how-to-guides/assign-sms-trunk.html#assigning-sms-trunk) - Assign the trunk to one
  or more DID numbers.
- [Manage HTTP IN trunks](manage-http-in-trunk.html) - Edit or delete an
  existing HTTP IN trunk.
- [Inbound SMS specification](../../technical-data/http-specification.html#sms-in-specification) - Review the request
  details, variables, and body formats for HTTP delivery.
- [SMS trunk groups](../../trunk-groups/sms-trunk-groups.html) - Group SMS
  trunks for failover.
