> For the complete documentation index, see [llms.txt](https://docs.miatel.com/api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.miatel.com/api/sms-api/send-sms.md).

# Send SMS

If you wish to send SMS via HTTP API, please contact us at <support@miatel.com> stating your Miatel account and the IP addresses to whitelist.

## Endpoint

```
https://sms-hub.miatel.com:4849/sendsms?
```

### &#x20;Parameters

<table data-header-hidden><thead><tr><th width="160"></th><th width="81"></th><th></th></tr></thead><tbody><tr><td>username</td><td>string</td><td>Username or account name</td></tr><tr><td>password</td><td>string</td><td>The password associated with the given username</td></tr><tr><td>from</td><td>string</td><td>Sender ID (SRC-number)</td></tr><tr><td>to</td><td>string</td><td>Recipient's phone number (DST-number).</td></tr><tr><td>text</td><td>string</td><td>Text of SMS. If the content does not fit into the maximum message size according to the currently set <a href="/spaces/KN2cbBlqJluXsELFSq2I/pages/NoApRukv8fvaSZW1Vx9W">encoding</a>, the message will be split into multiple messages.</td></tr><tr><td>comment</td><td>string</td><td>(optional) The name of the communication or other comment about the sent SMS </td></tr></tbody></table>

### Request Example &#x20;

{% code overflow="wrap" %}

```
https://sms-hub.miatel.com:4849/sendsms?username=client&password=98765&to=6585911223&text=Hello
```

{% endcode %}

## Response

You will get HTTP 202 response if the request was sent successfully, and HTTP 404 if there was an error.

### Response template

{% tabs %}
{% tab title="202 Accepted" %}

```html
<html><body>request_code: request_description. id:message_id. count:dlvrd_count. code:code_number</body></html>
```

{% endtab %}

{% tab title="404 Not Found" %}

```html
<html><body>request_code: request_description. status:status_code. code:-code_number</body></html>
```

{% endtab %}
{% endtabs %}

### Used response parameters:

<table><thead><tr><th width="213">Name</th><th width="127">Type</th><th>Description</th></tr></thead><tbody><tr><td>request_code</td><td>number</td><td>The code of the delivery message (0 -  Accepted; 4 - Failed)</td></tr><tr><td>request_description</td><td>string</td><td> Description of the delivery message code</td></tr><tr><td>message_id</td><td>string</td><td>The unique identifier of the send message</td></tr><tr><td>dlvrd_count</td><td>number</td><td>Number of short messages delivered. The value may be padded with leading zeros.</td></tr><tr><td>status_code</td><td>number</td><td><a href="https://docs.miatel.com/api/sms-api/response-codes-and-errors">Response error status code of Miatel platform</a></td></tr><tr><td>code_number</td><td>number</td><td><a href="https://docs.miatel.com/api/sms-api/response-codes-and-errors">Response code of Miatel platform</a></td></tr></tbody></table>

### Example responses

{% tabs %}
{% tab title="202 Accepted" %}

```html
<html><body>0: Accepted for delivery. id:1111e111-2d22-3c33-4b44-55555a555555. count:1. code:0</body></html>
```

{% endtab %}

{% tab title="404 Not Found" %}

```html
<html><body>4: Failed to send sms. status:255. code:-5002</body></html>
```

{% endtab %}
{% endtabs %}


---

# 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://docs.miatel.com/api/sms-api/send-sms.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.
