# Alive5 SMS Sender (`imraghavojha/alive5-sms`) Actor

Send an SMS from your Alive5 business number to one or more recipients and export a submission result for each recipient.

- **URL**: https://apify.com/imraghavojha/alive5-sms.md
- **Developed by:** [Raghav Ojha](https://apify.com/imraghavojha) (community)
- **Categories:** Integrations, Automation
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Alive5 SMS Sender

Send the same SMS from an **Alive5 business number** to one or more recipients. The Actor submits each message separately and saves one result per recipient to an Apify dataset. Use it for workflow notifications, customer updates, or reminders. Apify provides run history, API access, scheduling, and integrations with other tools.

An `accepted` result confirms that Alive5 accepted the submission. It does not confirm delivery to the recipient's handset.

### Before you start

You need an existing Alive5 account with an SMS-enabled business number and API access. In your [Alive5 dashboard](https://app.alive5.com/), open **Integrations > API Key**. Copy your existing API key, or select **Generate** if you do not have one. If API access is unavailable, contact your Alive5 administrator or [Alive5 support](https://www.alive5.com/).

Find the sender configuration with `GET https://api.alive5.com/public/1.0/objects/channels-and-users/list`, authenticated with the `X-A5-APIKEY` header. In `data.Items`, find the SMS channel whose `channel_label` matches your business number. Use that channel's `channel_id` and an assigned agent's `agents[].user_id`.

### Send messages

1. Enter your Alive5 API key in the secret **Alive5 API key** field.
2. Enter your sender number, channel ID, and assigned user ID.
3. Add one or more recipient numbers and your message.
4. Run the Actor and inspect **SMS submission results** in the Output tab. Export the dataset as JSON or CSV, or retrieve it through the Apify API.

### Inputs

All six fields are required and have no defaults.

| Field | Type | Description |
| --- | --- | --- |
| `apiKey` | Secret string | Your Alive5 API key. Apify encrypts this input on the platform. |
| `from` | String | Alive5 business SMS number in E.164 format: `+` followed by 8–15 digits. |
| `to` | Array of strings | Unique recipient numbers in the same E.164 format. Use an array for one recipient too. |
| `message` | String | Nonblank SMS text, preserved exactly, including whitespace. |
| `channelId` | String | SMS channel associated with `from`. |
| `userId` | String | Agent assigned to that channel. |

Example input (replace the illustrative credentials and numbers before sending):

```json
{
  "apiKey": "YOUR_ALIVE5_API_KEY",
  "from": "+14155550100",
  "to": ["+14155550123"],
  "message": "Your requested update is ready.",
  "channelId": "YOUR_SMS_CHANNEL_ID",
  "userId": "YOUR_ASSIGNED_USER_ID"
}
```

### Output

The default dataset contains one record per recipient, in input order. This is an illustrative successful response:

```json
[
  {
    "to": "+14155550123",
    "status": "accepted",
    "messageId": "example-message-id",
    "conversationId": "example-conversation-id",
    "error": null
  }
]
```

`messageId` comes from Alive5's `data.data.message_id`; `conversationId` comes from `data.data.thread_id` and can be null. Failed submissions have `status: "failed"`, null IDs, and a redacted `error` string. The Actor detects Alive5 errors even when the HTTP response status is 200. It never logs your API key or message text, and neither is included in normal output records.

### Failures and retries

All inputs are validated before any SMS request. Invalid configuration fails the run. Recipient errors are saved as records and processing continues. If no submissions are accepted, the run fails after saving all records. If at least one submission is accepted, the run succeeds with a status message showing the accepted count (for example, "2 of 3 SMS accepted"). Check each record's status for individual outcomes.

Requests run sequentially and time out after 20 seconds each. There are no automatic retries. A network failure, timeout, or incomplete response can leave submission uncertain: check Alive5 conversation history before retrying. Rerunning or scheduling the Actor submits messages again; it does not deduplicate across runs. A run interruption or storage failure can leave only partial results.

### Pricing

**Alive5 SMS charges apply** under your Alive5 plan, including applicable message segment and carrier charges. Apify platform usage and any Actor pricing shown in the Store are separate. Total cost depends on recipient count, message length, runtime, and your provider plans. Check both services' pricing before scheduling recurring runs.

### Local development

Use Node.js 22 or newer. Run `npm install`, then put input in `storage/key_value_stores/default/INPUT.json` and run `npx apify-cli run`. Local storage files are ordinary files; protect credentials and remove storage after testing. For an authentication failure check, use a deliberately invalid key and reserved example numbers. Do not use real credentials for a smoke test.

For submission errors, check the API key, sender/channel match, and agent assignment. Consult your Alive5 administrator for account or delivery issues. Include only redacted errors when reporting a problem.

# Actor input Schema

## `apiKey` (type: `string`):

Find or generate your key in Alive5 under Integrations > API Key. This required field is stored encrypted on Apify.

## `from` (type: `string`):

Your Alive5 SMS business number in E.164 format, such as +14155550100. It must match channelId.

## `to` (type: `array`):

One or more E.164 phone numbers. Use an array even for one recipient. Duplicate numbers are rejected to prevent duplicate submissions.

## `message` (type: `string`):

Nonblank SMS text sent unchanged to every recipient. Alive5 message limits and SMS segment charges apply.

## `channelId` (type: `string`):

The channel_id for your sender from Alive5's channels-and-users/list endpoint.

## `userId` (type: `string`):

The user_id of an agent assigned to the selected Alive5 SMS channel.

## Actor input object example

```json
{}
```

# Actor output Schema

## `results` (type: `string`):

Recipient, submission status, message ID, conversation ID, and redacted error.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("imraghavojha/alive5-sms").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("imraghavojha/alive5-sms").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call imraghavojha/alive5-sms --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,imraghavojha/alive5-sms"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/h72YpVmkKKT7wgXz4/builds/yD6vWomVWQcP5Ebk5/openapi.json
