Create SMS trunk
create_sms_trunkCreate an inbound SMS destination trunk for the authenticated customer, then optionally route a DID to it with assign_did_to_sms_trunk. Choose the delivery mode with type: type "http_in" (an HTTP IN trunk, default) → DIDWW pushes each incoming SMS to a webhook; pass name and url (defaults to an HTTP GET webhook), or http_method "POST"/"PUT" with a body and body_type for a request body. type "smtp" (an SMS to Email trunk) → DIDWW delivers each incoming SMS as an email; pass name and send_to (recipient email, e.g. "test@example.com" or "John Doe test@example.com"). subject, message and use_smtp_relay have sensible defaults. Available placeholders (substituted per incoming SMS): {SMS_TIME} received time, {SMS_SRC_ADDR} sender, {SMS_DST_ADDR} receiver, {SMS_TEXT} message text, {SMS_TEXT_BASE64_ENCODED} message text base64-encoded. Placeholders work in the smtp subject/message and in http_in query_parameters/headers/body. Returns the created trunk id and key attributes, or a readable error if the configuration is invalid.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | http_in only: webhook URL DIDWW pushes each incoming SMS to. | |
| body | No | http_in only: request body, required for POST/PUT. May use {SMS_*} placeholders, e.g. {"time":"{SMS_TIME}","text":"{SMS_TEXT}"}. | |
| name | Yes | Trunk name (must be unique for the customer). | |
| type | No | Delivery mode: "http_in" (webhook, default) or "smtp" (email delivery). | |
| blocked | No | Whether the trunk is blocked. Defaults to false. | |
| headers | No | http_in only: HTTP headers (string => string). Values may use {SMS_*} placeholders. | |
| message | No | smtp only: email body text, may use {SMS_*} placeholders. Defaults to "{SMS_TIME}" and "{SMS_TEXT}" on separate lines. | |
| send_to | No | smtp only (required): recipient email, e.g. "test@example.com" or "Name <test@example.com>". | |
| subject | No | smtp only: email subject, may use {SMS_*} placeholders. Defaults to "SMS received from {SMS_SRC_ADDR} to {SMS_DST_ADDR}". | |
| priority | No | Optional routing priority. | |
| body_type | No | http_in only: body encoding, required for POST/PUT. | |
| http_method | No | http_in only: HTTP method used for the webhook. Defaults to "GET". | |
| use_smtp_relay | No | smtp only: use the DIDWW SMTP relay. Defaults to true. | |
| query_parameters | No | http_in only: query string parameters (string => string). Values may use {SMS_*} placeholders. |