---
schema_version: "1"
id: 99a20486f04dcaf92cae7aea592f2aaa026e71a39ae342e4ac47480138e00635
title: CreateSmsConversation()
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/ampscript/references/sms/mc-ampscript-reference-sms-create-sms-conversation.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-sms/mc-ampscript-reference-sms-create-sms-conversation.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 9703f4fa9547f4f71c0796a9337ddb08aa8a47d39bbb55b31b09711fcd66fd23
products:
  - AMPscript for Marketing Cloud
  - Marketing Cloud
---
# CreateSmsConversation()

Creates an SMS conversation with a contact.

**important:** You can only use this AMPscript function in MobileConnect.

You can’t use this function with conversation-based templates, including Double Opt-In and Info Capture templates.

## Availability

<table>
  <tr>
    <td>Marketing Cloud Engagement</td>
    <td>✅ Yes</td>
  </tr>
  <tr>
    <td>Marketing Cloud Next</td>
    <td>❌ No</td>
  </tr>
</table>

## Syntax

```
CreateSmsConversation(originationNumber,
                      destinationNumber,
                      nextKeyword,
                      app)
```

The `CreateSmsConversation()` function has four parameters:

- `originationNumber` (string): Required. The phone number (such as a short code or long code) used in MobileConnect.
- `destinationNumber` (string): Required. The contact’s phone number, including the country code.
- `nextKeyword` (string): Required. The string to set as the next conversation keyword.
- `app` (string): Required. The application used in the conversation. Specify `MOBILECONNECT` for this parameter. Any other value results in an error.

## Usage

Use this function to initiate an SMS conversation with a contact. To use the function, pass it your short or long code, the contact's phone number, the keyword to use for the conversation, and the string `MOBILECONNECT`.

```
%%=CreateSmsConversation("12345",MOBILE_NUMBER,"KEYWORD","MOBILECONNECT")=%%
```

**note:** This function always returns `true` if successful, and an exception if it fails. For this reason, we recommend against using this function for decision making.
