# SMS API

#### Automation and critical notifications

The SMS API section enables full integration of your software with the MessageFlow infrastructure. This solution handles transactional traffic, such as OTP codes and order statuses, and executes automated communication scenarios directly from your code.

### Key API capabilities

* **Full dashboard visibility**: API operations are not a "black box." All outgoing and incoming messages processed via integration are visible in the dashboard interface, just like standard campaigns.
  * Benefit: Your Customer Service department can independently verify if an SMS with a code reached the user without involving developers or searching through server logs.
* **Direct Connections (Enterprise Quality)**: The platform uses direct, certified connections with mobile operators. This guarantees the highest deliverability and eliminates the risk of grey routing.
* **MessageFlow Priority (Add-on)**: Use a dedicated, separate infrastructure for time-critical messages such as 2FA codes, banking alerts, or password resets. The system processes these notifications outside the standard bulk marketing queue. Note that this service is an optional paid module. Find more information in the [MessageFlow Priority](/advanced-features/messageflow-priority.md) section.
* **Webhooks and Reporting (DLR)**: Your system receives feedback in real time. Configure a `webhookUrl` to automatically receive delivery statuses (Delivered, Undelivered, Expired) directly into your database.
* **Two-way messaging (2-Way)**: The API supports receiving incoming messages on dedicated numbers (Short Codes or Long Numbers). This allows you to build interactive SMS bots.

### Developer Experience (DX)

The platform aims to minimize integration time.

* Standard: RESTful API based on a transparent JSON format.
* Code Snippets: Access ready-to-use "copy-paste" fragments for popular languages, including **Shell (cURL), Python, PHP, Java, C#, Node.js, Go, Ruby, and Swift**.

#### How it works

Communication occurs via secure HTTPS requests.

* **Method**: `POST`
* **Endpoint**: `https://api.messageflow.com/v2.1/sms`
* **Authentication**: Use the required `Application-Key` and `Authorization` headers. You can generate tokens in the Account > API tab.

Example Payload (JSON): Send the message content, recipients, and optional parameters in the request.

```json
{
  "sender": "YourCompany",
  "message": "Your authorization code is: 1234",
  "phoneNumbers": [
    "48111222333"
  ],
  "priority": true
}
```

*(The above code is a simplified example. Find the full structure in the* [*API documentation*](https://dev.messageflow.com/#/)*.)*

{% hint style="info" %}
**Best Practice: OTP Codes**&#x20;

Are you sending one-time passwords? Use the [MessageFlow Priority](/advanced-features/messageflow-priority.md) add-on. This ensures the platform processes the request immediately without waiting in the marketing message queue.
{% endhint %}

### Developer Documentation&#x20;

Find a detailed description of all methods, error codes, and a full list of parameters in the developer portal:&#x20;

[Go to MessageFlow API Docs >>](https://dev.messageflow.com/#/)


---

# Agent Instructions: 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:

```
GET https://docs.messageflow.com/sms/sms-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
