Send a group MMS message
Queues an MMS addressed to multiple recipients as a group conversation. Delivery events are reported asynchronously through messaging webhooks.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.messages.sendGroupMms({
from: '+13125551234',
to: ['+18655551234', '+14155551234'],
});
console.log(response.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
response = client.messages.send_group_mms(
from_="+13125551234",
to=["+18655551234", "+14155551234"],
)
print(response.data)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.Messages.SendGroupMms(context.TODO(), telnyx.MessageSendGroupMmsParams{
From: "+13125551234",
To: []string{"+18655551234", "+14155551234"},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.messages.MessageSendGroupMmsParams;
import com.telnyx.sdk.models.messages.MessageSendGroupMmsResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
MessageSendGroupMmsParams params = MessageSendGroupMmsParams.builder()
.from("+13125551234")
.addTo("+18655551234")
.addTo("+14155551234")
.build();
MessageSendGroupMmsResponse response = client.messages().sendGroupMms(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.messages.send_group_mms(from: "+13125551234", to: ["+18655551234", "+14155551234"])
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$response = $client->messages->sendGroupMms(
from: '+13125551234',
to: ['+18655551234', '+14155551234'],
mediaURLs: ['http://example.com'],
subject: 'From Telnyx!',
text: 'Hello, World!',
useProfileWebhooks: true,
webhookFailoverURL: 'https://backup.example.com/hooks',
webhookURL: 'http://example.com/webhooks',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx messages send-group-mms \
--api-key 'My API Key' \
--from +13125551234 \
--to "'+18655551234'" \
--to "'+14155551234'"curl --request POST \
--url https://api.telnyx.com/v2/messages/group_mms \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "+13125551234",
"to": [
"+18655551234",
"+14155551234"
],
"text": "Hello, World!",
"subject": "From Telnyx!",
"media_urls": [
"http://example.com"
],
"webhook_url": "http://example.com/webhooks",
"webhook_failover_url": "https://backup.example.com/hooks",
"use_profile_webhooks": true
}
'{
"data": {
"record_type": "message",
"direction": "outbound",
"id": "40385f64-5717-4562-b3fc-2c963f66afa6",
"type": "MMS",
"messaging_profile_id": "4000eba1-a0c0-4563-9925-b25e842a7cb6",
"organization_id": "b448f9cc-a842-4784-98e9-03c1a5872950",
"from": {
"phone_number": "+18445550001",
"carrier": "TELNYX LLC",
"line_type": "VoIP"
},
"to": [
{
"phone_number": "+18665550001",
"status": "queued",
"carrier": "T-MOBILE USA, INC.",
"line_type": "Wireless"
}
],
"cc": [],
"text": "Hello, World!",
"num_chars": 13,
"subject": "From Telnyx!",
"media": [
{
"url": "https://pbs.twimg.com/profile_images/1142168442042118144/AW3F4fFD_400x400.png",
"content_type": null,
"sha256": null,
"size": null
}
],
"webhook_url": "https://www.example.com/hooks",
"webhook_failover_url": "https://backup.example.com/hooks",
"encoding": "GSM-7",
"parts": 1,
"tags": [
"Greetings"
],
"cost": {
"amount": "0.0051",
"currency": "USD"
},
"cost_breakdown": {
"carrier_fee": {
"amount": "0.00305",
"currency": "USD"
},
"rate": {
"amount": "0.00205",
"currency": "USD"
}
},
"tcr_campaign_id": "TCPA3X7",
"tcr_campaign_billable": true,
"tcr_campaign_registered": "REGISTERED",
"received_at": "2019-01-23T18:10:02.574Z",
"sent_at": null,
"completed_at": null,
"valid_until": null,
"errors": [],
"wait_seconds": 0.5
}
}{
"errors": [
{
"code": "10036",
"title": "Resource is being processed",
"detail": "A request with this Idempotency-Key is already being processed.",
"source": {
"pointer": "/header/Idempotency-Key"
}
}
]
}{
"errors": [
{
"code": "10007",
"title": "Payload Too Large",
"detail": "The request body exceeds the Edge replay-protection limit for idempotent requests."
}
]
}{
"errors": [
{
"code": "10016",
"title": "Service Unavailable",
"detail": "Edge idempotency protection is temporarily unavailable. Please try again later."
}
]
}{
"errors": [
{
"code": "string",
"title": "string",
"detail": "string",
"source": {
"pointer": "/data/attributes/phone_number",
"parameter": "string"
}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Optional opaque, unquoted key for safely retrying the same logical request. Keys must contain 1 to 255 letters, numbers, hyphens, or underscores. Generate a unique UUID v4 for each operation and reuse it only when retrying that operation with the same request. Invalid headers—including duplicate, empty, malformed, or overlong values—return 400 with error code 10015. A request already in progress with the same key returns 409; reusing the key with a different request returns 422. Only successful responses are replayed, for up to 24 hours. Do not include sensitive data in the key.
1 - 255^[A-Za-z0-9_-]{1,255}$Body
Message payload
Phone number, in +E.164 format, used to send the message.
A list of destinations. No more than 8 destinations are allowed.
Receiving address (+E.164 formatted phone number or short code).
Message body (i.e., content) as a non-empty string.
Subject of multimedia message
A list of media URLs. The total media size must be less than 1 MB.
The URL where webhooks related to this message will be sent.
The failover URL where webhooks related to this message will be sent if sending to the primary URL fails.
If the profile this number is associated with has webhooks, use them for delivery notifications. If webhooks are also specified on the message itself, they will be attempted first, then those on the profile.
Response
Successful response with details about a message.
Show child attributes
Show child attributes
{
"record_type": "message",
"direction": "outbound",
"id": "40385f64-5717-4562-b3fc-2c963f66afa6",
"type": "MMS",
"messaging_profile_id": "4000eba1-a0c0-4563-9925-b25e842a7cb6",
"organization_id": "b448f9cc-a842-4784-98e9-03c1a5872950",
"from": {
"phone_number": "+18445550001",
"carrier": "TELNYX LLC",
"line_type": "VoIP"
},
"to": [
{
"phone_number": "+18665550001",
"status": "queued",
"carrier": "T-MOBILE USA, INC.",
"line_type": "Wireless"
}
],
"cc": [],
"text": "Hello, World!",
"num_chars": 13,
"subject": "From Telnyx!",
"media": [
{
"url": "https://pbs.twimg.com/profile_images/1142168442042118144/AW3F4fFD_400x400.png",
"content_type": null,
"sha256": null,
"size": null
}
],
"webhook_url": "https://www.example.com/hooks",
"webhook_failover_url": "https://backup.example.com/hooks",
"encoding": "GSM-7",
"parts": 1,
"tags": ["Greetings"],
"cost": { "amount": "0.0051", "currency": "USD" },
"cost_breakdown": {
"carrier_fee": { "amount": "0.00305", "currency": "USD" },
"rate": { "amount": "0.00205", "currency": "USD" }
},
"tcr_campaign_id": "TCPA3X7",
"tcr_campaign_billable": true,
"tcr_campaign_registered": "REGISTERED",
"received_at": "2019-01-23T18:10:02.574Z",
"sent_at": null,
"completed_at": null,
"valid_until": null,
"errors": [],
"wait_seconds": 0.5
}
Was this page helpful?
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.messages.sendGroupMms({
from: '+13125551234',
to: ['+18655551234', '+14155551234'],
});
console.log(response.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
response = client.messages.send_group_mms(
from_="+13125551234",
to=["+18655551234", "+14155551234"],
)
print(response.data)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.Messages.SendGroupMms(context.TODO(), telnyx.MessageSendGroupMmsParams{
From: "+13125551234",
To: []string{"+18655551234", "+14155551234"},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.messages.MessageSendGroupMmsParams;
import com.telnyx.sdk.models.messages.MessageSendGroupMmsResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
MessageSendGroupMmsParams params = MessageSendGroupMmsParams.builder()
.from("+13125551234")
.addTo("+18655551234")
.addTo("+14155551234")
.build();
MessageSendGroupMmsResponse response = client.messages().sendGroupMms(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.messages.send_group_mms(from: "+13125551234", to: ["+18655551234", "+14155551234"])
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$response = $client->messages->sendGroupMms(
from: '+13125551234',
to: ['+18655551234', '+14155551234'],
mediaURLs: ['http://example.com'],
subject: 'From Telnyx!',
text: 'Hello, World!',
useProfileWebhooks: true,
webhookFailoverURL: 'https://backup.example.com/hooks',
webhookURL: 'http://example.com/webhooks',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx messages send-group-mms \
--api-key 'My API Key' \
--from +13125551234 \
--to "'+18655551234'" \
--to "'+14155551234'"curl --request POST \
--url https://api.telnyx.com/v2/messages/group_mms \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "+13125551234",
"to": [
"+18655551234",
"+14155551234"
],
"text": "Hello, World!",
"subject": "From Telnyx!",
"media_urls": [
"http://example.com"
],
"webhook_url": "http://example.com/webhooks",
"webhook_failover_url": "https://backup.example.com/hooks",
"use_profile_webhooks": true
}
'{
"data": {
"record_type": "message",
"direction": "outbound",
"id": "40385f64-5717-4562-b3fc-2c963f66afa6",
"type": "MMS",
"messaging_profile_id": "4000eba1-a0c0-4563-9925-b25e842a7cb6",
"organization_id": "b448f9cc-a842-4784-98e9-03c1a5872950",
"from": {
"phone_number": "+18445550001",
"carrier": "TELNYX LLC",
"line_type": "VoIP"
},
"to": [
{
"phone_number": "+18665550001",
"status": "queued",
"carrier": "T-MOBILE USA, INC.",
"line_type": "Wireless"
}
],
"cc": [],
"text": "Hello, World!",
"num_chars": 13,
"subject": "From Telnyx!",
"media": [
{
"url": "https://pbs.twimg.com/profile_images/1142168442042118144/AW3F4fFD_400x400.png",
"content_type": null,
"sha256": null,
"size": null
}
],
"webhook_url": "https://www.example.com/hooks",
"webhook_failover_url": "https://backup.example.com/hooks",
"encoding": "GSM-7",
"parts": 1,
"tags": [
"Greetings"
],
"cost": {
"amount": "0.0051",
"currency": "USD"
},
"cost_breakdown": {
"carrier_fee": {
"amount": "0.00305",
"currency": "USD"
},
"rate": {
"amount": "0.00205",
"currency": "USD"
}
},
"tcr_campaign_id": "TCPA3X7",
"tcr_campaign_billable": true,
"tcr_campaign_registered": "REGISTERED",
"received_at": "2019-01-23T18:10:02.574Z",
"sent_at": null,
"completed_at": null,
"valid_until": null,
"errors": [],
"wait_seconds": 0.5
}
}{
"errors": [
{
"code": "10036",
"title": "Resource is being processed",
"detail": "A request with this Idempotency-Key is already being processed.",
"source": {
"pointer": "/header/Idempotency-Key"
}
}
]
}{
"errors": [
{
"code": "10007",
"title": "Payload Too Large",
"detail": "The request body exceeds the Edge replay-protection limit for idempotent requests."
}
]
}{
"errors": [
{
"code": "10016",
"title": "Service Unavailable",
"detail": "Edge idempotency protection is temporarily unavailable. Please try again later."
}
]
}{
"errors": [
{
"code": "string",
"title": "string",
"detail": "string",
"source": {
"pointer": "/data/attributes/phone_number",
"parameter": "string"
}
}
]
}