> For the complete documentation index, see [llms.txt](https://docs.oxygenhq.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.oxygenhq.org/download-installation-start/modules/module-twilio.md).

# twilio

## getLastSentApiSms

Retrieves last SMS message sent from API.

**Parameters:**

| Name           | Type      | Description                                                                                             |
| -------------- | --------- | ------------------------------------------------------------------------------------------------------- |
| `removeOnRead` | `Boolean` | Specifies whether to delete the message after reading it.                                               |
| `timeout`      | `Number`  | Timeout in milliseconds for waiting for the message to arrive.                                          |
| `notOlderThan` | `Number`  | `optional` Retrieve message only if it arrived not before the given time (in ms). Default is 4 minutes. |

**Returns:**

`String` - SMS text.

## getLastSms

Retrieves last SMS message.

**Parameters:**

| Name           | Type      | Description                                                                                             |
| -------------- | --------- | ------------------------------------------------------------------------------------------------------- |
| `removeOnRead` | `Boolean` | Specifies whether to delete the message after reading it.                                               |
| `timeout`      | `Number`  | Timeout in milliseconds for waiting for the message to arrive.                                          |
| `notOlderThan` | `Number`  | `optional` Retrieve message only if it arrived not before the given time (in ms). Default is 4 minutes. |
| `fromNumber`   | `String`  | `optional` From number to filter message                                                                |

**Returns:**

`String` - SMS text.

## init

Set Twilio authentication details.

**Parameters:**

| Name         | Type     | Description           |
| ------------ | -------- | --------------------- |
| `accountSid` | `String` | Account SID.          |
| `authToken`  | `String` | Authentication token. |

## sendSms

Send an SMS.

\*\* Usage example:\*\*

```javascript
twilio.init('Account Sid', 'Account Token');
twilio.sendSms('+1xxxxxxxxxx', '+972xxxxxxxxx', 'Hello World!');
```

**Parameters:**

| Name      | Type     | Description                |
| --------- | -------- | -------------------------- |
| `from`    | `String` | Phone number to send from. |
| `to`      | `String` | Phone number to send to.   |
| `message` | `String` | Message to send.           |

**Returns:**

`String` - Message SID.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.oxygenhq.org/download-installation-start/modules/module-twilio.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.
