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

# SMS API

## Using the SMS API

To use the Message REST API you need an account. Please get in touch with the Ebbot team if you don't have access to an account. Send us an email <helpme@ebbot.ai> to request an account.

### Base URL for SMS API

The base URL for Ebbot's SMS API is `https://api.ebbot.ai/sms/v1`

### Authentication

Each request should include auth header with the key `x-api-key` followed by your private token

**Auth header:**

```json
POST /sms/v1 HTTP/1.1
Host: api.ebbot.ai
x-api-key: your_api_key
Content-Type: application/json
```

**401 Unauthorized:** Will be returned if your credentials are wrong or you have insufficient privileges.

### Send message

Example on how to send a message using the SMS API:

{% tabs %}
{% tab title="cURL" %}

```url
curl --location 'https://api.ebbot.ai/sms/v1' \
--header 'x-api-key: your_api_key' \
--header 'Content-Type: application/json' \
--data '{"from": "The Company", "to": "+1234567", "text": "This is a message!"}'
```

{% endtab %}

{% tab title="Python - Requests" %}

```python
import requests
import json

url = "https://api.ebbot.ai/sms/v1"

payload = json.dumps({
  "from": "The Company",
  "to": "+1234567",
  "text": "This is a message!"
})
headers = {
  'x-api-key': 'your_api_key',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
```

{% endtab %}
{% endtabs %}

This endpoint allows you to get free cake

**Body parameters:**

| Name | Type   | Description                                                                 |
| ---- | ------ | --------------------------------------------------------------------------- |
| from | string | The senders name or number.                                                 |
| to   | string | The recipients phone number. in E.164 format. **Example:** `"+46731234567"` |
| text | string | The text message to be sent.                                                |

**Headers:**

| Name      | Type   | Description                |
| --------- | ------ | -------------------------- |
| x-api-key | string | API key provided by Ebbot. |

**Example response:**

{% tabs %}
{% tab title="201 Created" %}

```
{
    "MessageId": [
        "5ec1dcbf-01ac-4322-9d20-a4284693f7a"
    ]
}
```

{% endtab %}
{% endtabs %}

<br>
