> For the complete documentation index, see [llms.txt](https://help.clickatell.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.clickatell.com/developers-api-reference/developers-archive/sms-http-s-api/stop-message.md).

# Stop message

This command will **attempt** to stop the delivery of a particular message. This command can only stop messages that have been scheduled for delivery in the future or may be queued within our router. It cannot stop messages that have already been delivered to an SMSC.

### **Command**

{% code overflow="wrap" %}

```
https://api.clickatell.com/http/delmsg?user=xxxx&password=xxxx&api_id=xxxx&apimsgid=xxxx
```

{% endcode %}

### **Parameters**

You also need to supply your authentication parameters.

| Parameter  | Description                                                             |
| ---------- | ----------------------------------------------------------------------- |
| `apimsgid` | This is the API message ID you get back when you send a message.        |
| `climsgid` | This is the message ID that you specified when you generated a message. |

### **Examples**

#### **Bash**

{% code overflow="wrap" lineNumbers="true" %}

```
username="place username here"
password="place password here"
api_id="place password here"
apiMsgId="place message ID here"
 
curl --data "user=$username&password=$password&api_id=$api_id&apimsgid=$apiMsgId" \
    'https://api.clickatell.com/http/delmsg'
```

{% endcode %}

#### **PHP**

{% code overflow="wrap" lineNumbers="true" %}

```
<?php
$username = urlencode("place username here");
$password = urlencode("place password here");
$api_id   = urlencode("place api_id here");
 
$apiMsgId = "place message ID here";
 
echo file_get_contents("https://api.clickatell.com/http/delmsg"
    . "?user=$username&password=$password&api_id=$api_id&apimsgid=$apiMsgId");
?>
```

{% endcode %}

#### **Python**

{% code overflow="wrap" lineNumbers="true" %}

```
import urllib2, urllib
 
params = {
    "user": "place username here",
    "password": "place password here",
    "api_id": "place password here",
    "apimsgid": "place message ID here"
}
 
params = urllib.urlencode(params)
f = urllib2.urlopen("https://api.clickatell.com/http/delmsg", params)
print f.read()>
```

{% endcode %}

### **API responses**

#### **Example response**

*Successful API response:*

{% code overflow="wrap" %}

```
ID: f6b9af2a2c9e5b18ee2d257e3def5d66 Status: 006
```

{% endcode %}

*Error response:*

{% code overflow="wrap" %}

```
ERR: 001, Authentication failed
```

{% endcode %}

#### **Format**

*Successful API response:*

{% code overflow="wrap" %}

```
ID: <message ID> Status: <status ID>
```

{% endcode %}

*Error response:*

{% code overflow="wrap" %}

```
ERR: <error code>, <error description>
```

{% endcode %}


---

# 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://help.clickatell.com/developers-api-reference/developers-archive/sms-http-s-api/stop-message.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.
