> For the complete documentation index, see [llms.txt](https://doc.opentact.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.opentact.org/opentact-api-documentation/untitled-3/send-a-message.md).

# Send SMS with Number

## Send SMS with Number

<mark style="color:green;">`POST`</mark> `https://api.opentact.org/rest/sms`

This API is used to send SMS with the Number

#### Query Parameters

| Name                                      | Type   | Description                                                                         |
| ----------------------------------------- | ------ | ----------------------------------------------------------------------------------- |
| FROM<mark style="color:red;">\*</mark>    | Number | This field contains the sender number.                                              |
| Message<mark style="color:red;">\*</mark> | String | This field contain string, used to add the message, send to the destination number. |
| TO<mark style="color:red;">\*</mark>      | Number | This field contain the destination number.                                          |

#### Headers

| Name                                           | Type   | Description |
| ---------------------------------------------- | ------ | ----------- |
| X-auth Token<mark style="color:red;">\*</mark> | String | JWT- Token  |

{% tabs %}
{% tab title="200: OK SMS SEND" %}

```javascript
{
  "success": true,
  "payload": {
    "uuid": "90c2e069-44c1-4f1a-9619-540432378122",
    "type": "smso",
    "state": "created",
    "from": "123456789",
    "to": 987654321,
    "message": "Hello world",
    "thread": "08360036ab8f77030d725064f42cb1b7",
    "delivered": false,
    "automated": false,
    "tn": {
      "tn": 12017771234,
      "created_on": "2023-01-04T07:52:58.127Z",
      "modified_on": "2023-01-04T07:52:58.127Z",
      "deleted_on": null
    },
    "created_on": "2023-01-04T07:52:58.127Z",
    "modified_on": "2023-01-04T07:52:58.127Z"
  }
}
```

{% endtab %}

{% tab title="201: Created Accepted" %}

```javascript
{
  "success": true,
  "payload": {
    "uuid": "90c2e069-44c1-4f1a-9619-540432378122",
    "type": "smsr",
    "state": "created",
    "from": "123456789",
    "to": 987654321,
    "message": "Hello world",
    "thread": "08360036ab8f77030d725064f42cb1b7",
    "delivered": false,
    "automated": false,
    "tn": {
      "tn": 12017771234,
      "created_on": "2023-01-04T07:52:58.127Z",
      "modified_on": "2023-01-04T07:52:58.127Z",
      "deleted_on": null
    },
    "created_on": "2023-01-04T07:52:58.127Z",
    "modified_on": "2023-01-04T07:52:58.127Z"
  }
}
```

{% endtab %}

{% tab title="403: Forbidden Forbidden" %}

```javascript
{
  "success": false,
  "message": "string",
  "status": 500,
  "meta": "string",
  "fields": {
    "params.to": {
      "message": "invalid integer number",
      "value": "qwerty123456789"
    }
  }
}
```

{% endtab %}

{% tab title="500: Internal Server Error Internal Server Error" %}

```javascript
{
  "success": false,
  "message": "string",
  "status": 500,
  "meta": "string",
  "fields": {
    "params.to": {
      "message": "invalid integer number",
      "value": "qwerty123456789"
    }
  }
}
```

{% endtab %}

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

```javascript
{
  "success": false,
  "status": 404,
  "message": "TNLease and SMSCampaign not found"
}
```

{% endtab %}
{% endtabs %}
