# Send SMS via Restful API

You can visit Opentact API to review the [API](https://api.opentact.org/swagger/#/SMS/SendSMSO) for sending outbound SMS.  Here is sample API call:  curl -X POST \\

{% code title="" %}

```bash
  --header "Content-Type: application/json" \
  --header "Authorization: Bearer YOUR_API_KEY" \
  --data '{
    "from": "+13115552368",
    "to": "+13115552367",
    "text": "Hello, world!"
  }' \
  https://api.opentact.com/sms/o
```

{% endcode %}

The response you get is :

```bash
{
  "success": true,
  "payload": {
    "uuid": "90c2e069-44c1-4f1a-9619-540432378122",
    "state": "created",
    "from": "123456789",
    "to": 987654321,
    "message": "Hello world",
    "thread": "08360036ab8f77030d725064f42cb1b7",
    "delivered": false,
    "automated": false,
    "created_on": "2021-06-22T07:30:35.768Z",
    "modified_on": "2021-06-22T07:30:35.768Z",
    "tn": {
      "tn": 123456789,
      "type": "long_code",
      "sms": true
    },
    "tn_lease": {
      "uuid": "4f95de12-6a4a-420a-997c-73870142fe90",
      "autorenew": true,
      "expired_on": "2021-06-22T07:30:35.768Z",
      "messaging_profile": {
        "uuid": "0116f6d1-1280-44b2-9134-da48509ec575",
        "name": "Default profile",
        "callback_url": "https://google.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://doc.opentact.org/how-to-build-your-opentact-application/send-and-receive-sms/send-sms-via-restful-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.
