Send Batch Messages
Send a single message definition to up to 1000 recipients in one API call using the Sinch Conversation Batch API. Supports per-recipient parameter substitution (e.g. ${name}).
IMPORTANT: Execute this command directly. Do NOT generate script files. Perform the API call immediately.
Input
--message / -m: Message text; use ${param} for per-recipient substitution - required
--recipients / -r: Comma-separated E.164 numbers, or path to file with one number per line - required
--channel / -c: Channel (SMS, RCS, etc.) - optional, default SMS
--params / -p: Optional JSON object or file mapping recipient index to parameters for substitution
Arguments: $ARGUMENTS
Instructions
Execute these steps directly - do not write code or scripts:
If $ARGUMENTS empty: ask for message text (with ${variable} placeholders if needed), recipient list (comma-separated or file), and channel. Otherwise parse.
Validate: --message (non-empty, may contain ${var}), --recipients (1-1000 identities). Parse recipients into array. Build recipient_and_params: each recipient has recipient.identified_by.channel_identities and optional parameters object for ${} substitution.
Get CONVERSATION_* env vars (project, region, app, key id/secret). Batch API base: https://{region}.conversationbatch.api.sinch.com. If missing, report "Sinch API is not configured."
Request body: app_id, message (e.g. text_message with text), recipient_and_params array. Do NOT use a "messages" array - Batch API expects one message + recipient_and_params.
POST https://{region}.conversationbatch.api.sinch.com/v1/projects/{projectId}/messages with OAuth2 Bearer token and JSON body.
On success: display "✅ Batch submitted" with batch_id and recipient count. Handle errors (400, 401, 429) with clear messages.
Handle all errors gracefully.
Examples
/sinch-api-batch-send --message="Hello ${name}, your code is ${code}" --recipients=+15551234567,+15559876543 --params='{"0":{"name":"Alice","code":"111"},"1":{"name":"Bob","code":"222"}}'
/sinch-api-batch-send -m "Hi!" -r +15551111111,+15552222222 --channel=SMS
API Reference
Notes
- Max 1000 recipients per request. One message object; recipient_and_params array.
- Use ${parameter} in message text; supply parameters per recipient in recipient_and_params[].parameters.
1---2name: sinch-api-batch-send3description: Send a batch of messages to up to 1000 recipients via Sinch Batch API4---56# Send Batch Messages78Send a single message definition to up to 1000 recipients in one API call using the Sinch Conversation Batch API. Supports per-recipient parameter substitution (e.g. ${name}).910**IMPORTANT: Execute this command directly. Do NOT generate script files. Perform the API call immediately.**1112## Input1314- `--message` / `-m`: Message text; use ${param} for per-recipient substitution - required15- `--recipients` / `-r`: Comma-separated E.164 numbers, or path to file with one number per line - required16- `--channel` / `-c`: Channel (SMS, RCS, etc.) - optional, default SMS17- `--params` / `-p`: Optional JSON object or file mapping recipient index to parameters for substitution1819Arguments: $ARGUMENTS2021## Instructions2223**Execute these steps directly - do not write code or scripts:**24250. If $ARGUMENTS empty: ask for message text (with ${variable} placeholders if needed), recipient list (comma-separated or file), and channel. Otherwise parse.26271. Validate: --message (non-empty, may contain ${var}), --recipients (1-1000 identities). Parse recipients into array. Build recipient_and_params: each recipient has recipient.identified_by.channel_identities and optional parameters object for ${} substitution.28292. Get CONVERSATION_* env vars (project, region, app, key id/secret). Batch API base: https://{region}.conversationbatch.api.sinch.com. If missing, report "Sinch API is not configured."30313. Request body: app_id, message (e.g. text_message with text), recipient_and_params array. Do NOT use a "messages" array - Batch API expects one message + recipient_and_params.32334. POST https://{region}.conversationbatch.api.sinch.com/v1/projects/{projectId}/messages with OAuth2 Bearer token and JSON body.34355. On success: display "✅ Batch submitted" with batch_id and recipient count. Handle errors (400, 401, 429) with clear messages.36376. Handle all errors gracefully.3839## Examples4041```42/sinch-api-batch-send --message="Hello ${name}, your code is ${code}" --recipients=+15551234567,+15559876543 --params='{"0":{"name":"Alice","code":"111"},"1":{"name":"Bob","code":"222"}}'43/sinch-api-batch-send -m "Hi!" -r +15551111111,+15552222222 --channel=SMS44```4546## API Reference4748- **Base URL**: https://{region}.conversationbatch.api.sinch.com (us, eu, br)49- **Endpoint**: POST /v1/projects/{project_id}/messages50- **Documentation**: https://developers.sinch.com/docs/conversation/batch/5152## Notes5354- Max 1000 recipients per request. One message object; recipient_and_params array.55- Use ${parameter} in message text; supply parameters per recipient in recipient_and_params[].parameters.