# Unsubscribe VIA MT Unsubscribe Notification

### <mark style="color:green;">`GET`</mark> `/srs/api/sendsms`&#x20;

Manually unsubscribe a user from your service using our API by using an unsubscription notification.&#x20;

{% tabs %}
{% tab title="Curl" %}

```hsts
curl -XGET -H "Content-type: application/json" 'https:hostname/srs/api/sendsms?USER_NAME=<account_id>&PASSWORD=<API_Key>&ORIGINATOR=<Short_code>&RECIPIENT=<MSISDN>&PROVIDER=<network>&MESSAGE_TEXT=<URL_encoded_message>&KEYWORD=<product_id>&STARTED=<YYYY-MM-DD HH:MM>+STOP&CLASS=PAUSE'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

headers = {
    'Content-type': 'application/json',
}

response = requests.get(
    'http://https:hostname/srs/api/sendsms?USER_NAME=<account_id>&PASSWORD=<API_Key>&ORIGINATOR=<Short_code>&RECIPIENT=<MSISDN>&PROVIDER=<network>&MESSAGE_TEXT=<URL_encoded_message>&KEYWORD=<product_id>&STARTED=<YYYY-MM-DD HH:MM>+STOP&CLASS=PAUSE',
    headers=headers,
)
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
When calling the Unsubscribe API, **+STOP** needs to be added also to indicate this is an unsubscription request.&#x20;
{% endhint %}

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `No Auth`          |

**Body**

| Parameter     | Type    | Example                          | Description                                       |
| ------------- | ------- | -------------------------------- | ------------------------------------------------- |
| account\_id   | string  | 43e36f50aaf111e272639171000000a9 | Your unique Mobivate account id.                  |
| password      | string  | 3b41d767316541bacef19d1382ac1e12 | Your unique associated Mobivate account api-key.  |
| originator    | integer | 12345                            | The associated shortcode for your service.        |
| recipient     | integer | XX7432104492                     | The recipient you want to send this message to.   |
| provider      | string  | Safaricom                        | The network you plan to send the SMS message via. |
| message\_text | string  | YOU%20HAVE%20UNSUBSCRIBED        | Your URL encoded message.                         |
| started       | string  | 2023-09-13 11:01                 | The date/timestamp of when your message was sent. |
| keyword       | string  | mv-100620006                     | Your unique Mobivate keyword for your service.    |
| class         | string  | PAUSE                            | The class of the message, in this case PAUSE.     |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "MT-aabbccddeeff00112233445566778899"
}
```

{% endtab %}

{% tab title="511" %}

```json
{
  "error": "Username or Password incorrect"
}
```

{% endtab %}
{% endtabs %}
