> For the complete documentation index, see [llms.txt](https://wiki.mobivate.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.mobivate.com/mno-web-opt-in/mno-web-opt-in-kenya/unsubscribing-users-from-your-service.md).

# Unsubscribing users from your service

### <mark style="color:green;">`GET`</mark> `/api/doi/`

Unsubscribe a user from your service that is using MNO Web Opt-In for Kenya.

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

```hsts
curl -XGET -H "Content-type: application/json" 'https://hostname/api/doi/<account_id>/<api_key>/?source=<shortcode>&destination=<msisdn>&keyword=<kw>&frequency=7&campaign=Test&reference=<your internal reference>&stop=1'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

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

response = requests.get(
    'https://hostname/api/doi/<account_id>/<api_key>/?source=<shortcode>&destination=<msisdn>&keyword=<kw>&frequency=7&campaign=TestCampaign&reference=<your internal reference>&stop=1',
    headers=headers,
)
```

{% endtab %}
{% endtabs %}

**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.    |
| destination | integer | XX7432104492                     | The recipient you want to send this message to.     |
| keyword     | string  | mv-100620006                     | Your unique Mobivate keyword for your service.      |
| reference   | string  | MyRef                            | Your internal reference.                            |
| provider    | string  | safraicomke                      | The network provider this message will be sent via. |
| stop        | string  | stop=1                           | To indicate you intend to unsubscribe the user.     |

#### Additional Body

| Parameter | Type    | Example      | Description                                            |
| --------- | ------- | ------------ | ------------------------------------------------------ |
| frequency | integer | 7            | Billing frequency in days. 7 would be equal to weekly. |
| campaign  | string  | TestCampaign | Your internal campaign reference.                      |

**Response**

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

```json
{
  "200": "MT-c65561314eb34088b6df42d8241aace0",
}
```

{% endtab %}

{% tab title="590" %}

```json
{
  "590": "SEND_FAILED: <Description>"
}
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
**Please note**, the description of the failed unsubscribe message will describe the reason for failing.&#x20;
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://wiki.mobivate.com/mno-web-opt-in/mno-web-opt-in-kenya/unsubscribing-users-from-your-service.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
