> For the complete documentation index, see [llms.txt](https://help.recart.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.recart.com/developers/public-api/message/send-message-s-to-a-subscriber.md).

# Send message(s) to a subscriber

Trigger SMS/MMS messages. Maximum 10 messages can be sent in a single request. Requester must comply with TCPA regulations, and make sure the message is not sent in quiet hours.

The site must have an active or trial SMS subscription, otherwise the request fails with `417`.

Messages are queued in the order given rather than sent inline, so `202` confirms that they were accepted for delivery, not that they were delivered. The response returns one entry per message; poll `GET /messages/{id}` with the returned IDs to follow their delivery status.

```json
{"openapi":"3.1.0","info":{"title":"Recart API","version":"2023-12"},"tags":[{"name":"Message","description":"Messages"}],"servers":[{"url":"https://api.recart.com/app-integrations/2023-12","description":"Production"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-Recart-API-Key","description":"It can be obtained in Recart account after contacting Support"}},"schemas":{"PostMessages":{"type":"object","required":["type","attributes"],"properties":{"type":{"type":"string","enum":["messages"]},"attributes":{"type":"object","required":["phoneNumber","messages"],"properties":{"phoneNumber":{"type":"string","description":"Preferably E.164 format"},"messages":{"type":"array","items":{"type":"object","required":["type","body"],"properties":{"type":{"type":"string","description":"Type of the message, only promotional is supported"},"body":{"type":"string","description":"Content of the message, maximum 1024 characters"},"attachment":{"type":"string","format":"uri","description":"URL of the attachment, extension must be .jpg, .jpeg, .png, or .gif"}}}}}}}},"AcceptedMessage":{"type":"object","description":"A message accepted for delivery by `POST /messages`.","required":["type","attributes"],"properties":{"type":{"type":"string","enum":["messages"]},"attributes":{"type":"object","required":["id","message"],"properties":{"id":{"type":"string","description":"ID of the queued message. Use it with `GET /messages/{id}` to follow the delivery status."},"message":{"type":"string","description":"Content of the message, echoed back from the request"}}}}},"HttpErrorBody":{"type":"object","required":["errors"],"properties":{"errors":{"type":"array","items":{"type":"object","required":["id","code","title","detail"],"properties":{"id":{"type":"string"},"code":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"}}}}}}},"responses":{"HttpError":{"description":"HTTP Error response","content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/HttpErrorBody"}}}}}},"paths":{"/messages":{"post":{"summary":"Send message(s) to a subscriber","tags":["Message"],"operationId":"postMessages","description":"Trigger SMS/MMS messages. Maximum 10 messages can be sent in a single request. Requester must comply with TCPA regulations, and make sure the message is not sent in quiet hours.\n\nThe site must have an active or trial SMS subscription, otherwise the request fails\nwith `417`.\n\nMessages are queued in the order given rather than sent inline, so `202` confirms\nthat they were accepted for delivery, not that they were delivered. The response\nreturns one entry per message; poll `GET /messages/{id}` with the returned IDs to\nfollow their delivery status.\n","requestBody":{"required":true,"content":{"application/vnd.api+json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PostMessages"}}}}}},"responses":{"202":{"description":"The messages were accepted and queued for delivery, one entry per message, in\nthe order they were given.\n","content":{"application/vnd.api+json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AcceptedMessage"}}}}}}},"400":{"description":"`ERR_BAD_REQUEST` — the payload failed validation, in which case `detail` lists\nthe offending fields, or `phoneNumber` could not be parsed as a phone number.\nValidation covers the documented limits: at most 10 messages, `body` at most\n1024 characters, `type` must be `promotional`, and `attachment` must end in\n`.jpg`, `.jpeg`, `.png`, or `.gif`.\n","content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/HttpErrorBody"}}}},"401":{"description":"`ERR_UNAUTHORIZED` — the `X-Recart-API-Key` header is missing.","content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/HttpErrorBody"}}}},"403":{"description":"`ERR_FORBIDDEN` — the API key is unknown or has been revoked.","content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/HttpErrorBody"}}}},"415":{"description":"`ERR_UNSUPPORTED_MEDIA_TYPE` — `Content-Type` must be `application/vnd.api+json`\nor `application/json`.\n","content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/HttpErrorBody"}}}},"417":{"description":"`ERR_EXPECTATION_FAILED` — the site does not have an active or trial SMS\nsubscription, so no messages can be sent until billing is resolved. No message\nin the request was queued.\n","content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/HttpErrorBody"}}}},"500":{"description":"The request passed validation but could not be processed.\n\nMessages are queued one by one, so a failure partway through leaves the earlier\nmessages of the request already queued for delivery. No message IDs are returned\nin this case, so a blind retry of the whole request can duplicate the messages\nthat already went through.\n\nUnlike the `4XX` responses, this status is not guaranteed to use the standard\nerror envelope — an unstructured plain-text body is possible — so do not match\non `errors[].code` here.\n"},"4XX":{"$ref":"#/components/responses/HttpError"},"5XX":{"$ref":"#/components/responses/HttpError"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.recart.com/developers/public-api/message/send-message-s-to-a-subscriber.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
