# 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 %}


---

# 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://doc.opentact.org/opentact-api-documentation/untitled-3/send-a-message.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.
