Skip to content

MMS

Queue an outgoing MMS

Use this method to queue MMS messages. Can be used to send the same message body to multiple recipients.

Schemas

Request

NameTypeDescription
bodyString(1..4096)Optional text body, required if no media is provided and should not be included if media is provided.
expires_atString(format:date-time)An ISO8601 timestamp denoting when the message should be considered expired and abort sending. Expired messages will not refund the cost of processing the message, even if it is never sent.
fromString(format:e164)The sender number, or address that the message should originate from. If set to null or not present, a random number from the account will be used instead. Numbers may be in E.164 format (eg +17055551234), the preceding + will always be stripped internally.
idStringAny user-supplied id string, it need not be unique, however it will only be used for tagging purposes and is not generally available for lookup. Users may provide this id, or the response’s id for inquiries or support.
mediaArray:Queue MMS Request MediaUnlike SMS, MMS is made up of small media segments or attachments. This array allows supplying the media segments for the message.
request_dlrBooleanWhether or not a DLR should be requested. Note: some carriers may not return a DLR.
toArray:String(format:e164)Array of recipient phone numbers in E.164 format. Note: Multiple recipient numbers will results in multiple messages

Response

NameTypeDescription
resultsArray:ObjectArray of result objects, one for each recipient
results[].directionStringDirection of the message, “OUTBOUND” for sent messages
results[].error_codeStringStatus code of the operation, “OK” for success or an error code.
results[].expires_atString(format:date-time)ISO8601 timestamp when the message expires
results[].fromString(format:e164)The sender phone number
results[].idStringUnique identifier for the message
results[].origin_idStringUser-supplied ID passed in the request
results[].schedule_atString(format:date-time)ISO8601 timestamp when the message is scheduled to be sent
results[].statusStringCurrent status of the message
results[].timestampString(format:date-time)ISO8601 timestamp of when the message was processed
results[].toString(format:e164)The recipient phone number
results[].typeStringThe message type, “MMS” for multimedia messages

Examples

Successful request

Everything is correct and functioning as expected.

Request:

POST: https://mms.swift-api.com/v1/mms
Content-Type: application/json
Authorization: Bearer ABC123
{
"body": "Hello, World",
"expires_at": "2024-06-14T00:00:00.000000Z",
"from": "12003004000",
"id": "my-mms-message-2",
"media": [
{
"blob": "SGVsbG8sIFdvcmxk",
"content_type": "image/png",
"id": "image",
"type": "BLOB",
"url": "https://example.com/path/to/image.png"
}
],
"request_dlr": false,
"to": [
"12003004001"
]
}

Response:

HTTP/1.1 200
Content-Type: application/json
Content-Length: 441
{
"results": [
{
"direction": "OUTBOUND",
"error_code": "OK",
"expires_at": "2024-06-14T00:00:00.000000Z",
"from": "12003004000",
"id": "01JDQ11TSMA0SXCS4ZMEP5FVTP",
"origin_id": "my-mms-message-2",
"schedule_at": "2024-06-14T00:00:00.000000Z",
"status": "NEW",
"timestamp": "2024-06-14T00:00:00.000000Z",
"to": "12003004001",
"type": "MMS"
}
]
}

Errored request

Occurs when there’s an issue with the request. Refer to the error_code field for details. A list of possible error codes can be found here.

HTTP/1.1 422
Content-Type: application/json
Content-Length: 441
{
"results": [
{
"direction": "OUTBOUND",
"error_code": "ACCOUNT_MMS_DISABLED",
"expires_at": "2024-06-14T00:00:00.000000Z",
"from": "12003004000",
"id": "01JDQ11TSMA0SXCS4ZMEP5FVTP",
"origin_id": "my-mms-message-2",
"schedule_at": "2024-06-14T00:00:00.000000Z",
"status": "NEW",
"timestamp": "2024-06-14T00:00:00.000000Z",
"to": "12003004001",
"type": "MMS"
}
]
}

Partial success

Occurs when there are successes and failures in the request.

HTTP/1.1 207
Content-Type: application/json
Content-Length: 441
{
"results": [
{
"direction": "OUTBOUND",
"error_code": "ACCOUNT_MMS_DISABLED",
"expires_at": "2024-06-14T00:00:00.000000Z",
"from": "12003004000",
"id": "01JDQ11TSMA0SXCS4ZMEP5FVTP",
"origin_id": "my-mms-message-2",
"schedule_at": "2024-06-14T00:00:00.000000Z",
"status": "NEW",
"timestamp": "2024-06-14T00:00:00.000000Z",
"to": "12003004001",
"type": "MMS"
}
]
}