---
schema_version: "1"
id: ba730c20dfd07756984b1bc787065e3d0bbdf8eeccab367593cf9ef172bb7b02
title: EndSmsConversation()
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-end-sms-conversation.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-sms/mc-ampscript-reference-sms-end-sms-conversation.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 2d87f0a883bdde2f73e51dd359ee2c8744e2df5d091b443ff8969841a4f4793f
products:
  - AMPscript for Marketing Cloud
  - Marketing Cloud
---
# EndSmsConversation()

End an active 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

```
EndSmsConversation(originationNumber, destinationNumber)
```

The `EndSmsConversation()` function has two 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.

## Usage

Use this function while there’s an ongoing conversation with a contact. To use this function, pass it your short or long code, and the phone number of the contact.

```
%%=EndSmsConversation("12345",MOBILE_NUMBER)=%%
```

**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.
