> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://mailchimp.com/developer/transactional/api/messages/send-sms/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://mailchimp.com/_mcp/server. # Send SMS message POST https://mandrillapp.com/api/1.4/messages/send-sms Content-Type: application/json Send a new SMS message through Mandrill Reference: https://mailchimp.com/developer/transactional/api/messages/send-sms ## Request ### Body (application/json) This endpoint expects a MessagesSendSmsRequest. - `key` (string, required) — A valid Mandrill API key - `message` (MessagesSendSmsRequestMessage, required) - `async` (boolean, optional, nullable) — enable a background sending mode that is optimized for bulk sending. In async mode, messages/send-sms will immediately return a status of "queued" for every recipient. To handle rejections when sending in async mode, set up a webhook for the 'reject' event. Defaults to false for messages with no more than 10 recipients; messages with more than 10 recipients are always sent asynchronously, regardless of the value of async. ## Response ### 200 Success - `list of MessagesSmsMessage` ## Errors ### 401 Unauthorized Error Invalid or missing API key. - `status` (string, required) — Status of the response, typically "error" - `code` (enum, required) — Numeric error code - Allowed values: `401` - `name` (enum, required) — Machine-friendly error name - Allowed values: `Invalid_Key` - `message` (string, required) — Human-readable error message ### 404 Not Found Error Unknown subaccount for SMS message - `status` (string, required) — Status of the response, typically "error" - `code` (integer, required) — Numeric error code - `name` (string, required) — Machine-friendly error name - `message` (string, required) — Human-readable error message ### 500 Internal Server Error An unexpected internal server error occurred. - `status` (string, required) — Status of the response, typically "error" - `code` (integer, required) — Numeric error code - `name` (string, required) — Machine-friendly error name - `message` (string, required) — Human-readable error message ## Types ### MessagesSendSmsRequestMessage - `sms` (MessagesSendSmsRequestMessageSms, required) - `merge` (boolean, optional) — Whether to evaluate merge tags in the message. Will automatically be set to true if either merge_vars or global_merge_vars are provided. - `merge_language` (string, optional) — the merge tag language to use when evaluating merge tags, either mailchimp or handlebars Possible values: "mailchimp" or "handlebars". - `global_merge_vars` (list of MergeVar, optional) — global merge variables to use for all recipients. You can override these per recipient. - `merge_vars` (list of MessagesSendSmsRequestMessageMergeVarsItems, optional) — per-recipient merge variables, which override global merge variables with the same name. ### MessagesSmsMessage The sending results for a single SMS recipient - `to` (string, required) — The phone number of the recipient - `from` (string, required) — The phone number of the sender - `status` (enum, required) — The sending status of the recipient - Allowed values: `sent`, `queued`, `scheduled`, `rejected`, `invalid` - `_id` (string, required) — The message's unique id - `reject_reason` (enum, optional) — The reason for the rejection if the recipient status is rejected - Allowed values: `hard-bounce`, `soft-bounce`, `spam`, `unsub`, `custom`, `invalid-sender`, `invalid`, `test-mode-limit`, `unsigned`, `rule` - `queue_reason` (enum, optional) — The reason for the queuing if the recipient status is queued - Allowed values: `async requested by user`, `multiple recipients` ### MessagesSendSmsRequestMessageSms - `text` (string, required) — The SMS message content to be sent. - `to` (list of string, required) — The phone numbers to send the SMS to. - `from` (string, required) — The phone number to send the SMS from. - `consent` (enum, required) — The consent type for this SMS - Allowed values: `onetime`, `recurring`, `recurring-no-confirm` - `track_clicks` (boolean, optional) — whether or not to turn on click tracking for the message ### MergeVar Merge variable for template content injection - `name` (string, optional) — Merge variable name (case-insensitive, may not start with _) - `content` (string, optional) — Content value for the merge variable ### MessagesSendSmsRequestMessageMergeVarsItems - `rcpt` (string, optional) — Phone number of the recipient - `vars` (list of MergeVar, optional) — Recipient-specific merge variables ## Examples **Request** ```json { "key": "ONzNrsmbtNXoIKyfPmjnig", "message": { "sms": { "text": "Hello from Mandrill SMS!", "to": [ "+10000000000", "+10000000001" ], "from": "+10000000000", "consent": "onetime" } } } ``` **Response** ```json [ { "to": "+10000000000", "from": "+10000000000", "status": "sent", "_id": "d451905551f64e279440e833d25b7ff0", "reject_reason": "hard-bounce", "queue_reason": "async requested by user" } ] ``` **SDK Code** ```python import requests url = "https://mandrillapp.com/api/1.4/messages/send-sms" payload = { "key": "ONzNrsmbtNXoIKyfPmjnig", "message": { "sms": { "text": "Hello from Mandrill SMS!", "to": ["+10000000000", "+10000000001"], "from": "+10000000000", "consent": "onetime" } } } headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://mandrillapp.com/api/1.4/messages/send-sms'; const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"key":"ONzNrsmbtNXoIKyfPmjnig","message":{"sms":{"text":"Hello from Mandrill SMS!","to":["+10000000000","+10000000001"],"from":"+10000000000","consent":"onetime"}}}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://mandrillapp.com/api/1.4/messages/send-sms" payload := strings.NewReader("{\n \"key\": \"ONzNrsmbtNXoIKyfPmjnig\",\n \"message\": {\n \"sms\": {\n \"text\": \"Hello from Mandrill SMS!\",\n \"to\": [\n \"+10000000000\",\n \"+10000000001\"\n ],\n \"from\": \"+10000000000\",\n \"consent\": \"onetime\"\n }\n }\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://mandrillapp.com/api/1.4/messages/send-sms") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = 'application/json' request.body = "{\n \"key\": \"ONzNrsmbtNXoIKyfPmjnig\",\n \"message\": {\n \"sms\": {\n \"text\": \"Hello from Mandrill SMS!\",\n \"to\": [\n \"+10000000000\",\n \"+10000000001\"\n ],\n \"from\": \"+10000000000\",\n \"consent\": \"onetime\"\n }\n }\n}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://mandrillapp.com/api/1.4/messages/send-sms") .header("Content-Type", "application/json") .body("{\n \"key\": \"ONzNrsmbtNXoIKyfPmjnig\",\n \"message\": {\n \"sms\": {\n \"text\": \"Hello from Mandrill SMS!\",\n \"to\": [\n \"+10000000000\",\n \"+10000000001\"\n ],\n \"from\": \"+10000000000\",\n \"consent\": \"onetime\"\n }\n }\n}") .asString(); ``` ```php request('POST', 'https://mandrillapp.com/api/1.4/messages/send-sms', [ 'body' => '{ "key": "ONzNrsmbtNXoIKyfPmjnig", "message": { "sms": { "text": "Hello from Mandrill SMS!", "to": [ "+10000000000", "+10000000001" ], "from": "+10000000000", "consent": "onetime" } } }', 'headers' => [ 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://mandrillapp.com/api/1.4/messages/send-sms"); var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"key\": \"ONzNrsmbtNXoIKyfPmjnig\",\n \"message\": {\n \"sms\": {\n \"text\": \"Hello from Mandrill SMS!\",\n \"to\": [\n \"+10000000000\",\n \"+10000000001\"\n ],\n \"from\": \"+10000000000\",\n \"consent\": \"onetime\"\n }\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Content-Type": "application/json"] let parameters = [ "key": "ONzNrsmbtNXoIKyfPmjnig", "message": ["sms": [ "text": "Hello from Mandrill SMS!", "to": ["+10000000000", "+10000000001"], "from": "+10000000000", "consent": "onetime" ]] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://mandrillapp.com/api/1.4/messages/send-sms")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` > Find all the Mailchimp API documentation and tools developers need to send marketing and transactional emails.