---
title: "Dry run"
method: POST
path: "/xms/v1/{service_plan_id}/batches/dry_run"
tags: ["Batches"]
---

# Dry run

`POST /xms/v1/{service_plan_id}/batches/dry_run`

This operation will perform a dry run of a batch which calculates the bodies and number of parts for all messages in the batch without actually sending any messages.

## Query parameters

- `per_recipient` boolean
- `number_of_recipients` integer

## Request body

- union
  - Binary
    - `to` MtDestination[], required — A list of phone numbers and group IDs that will receive the batch. [More info](https://community.sinch.com/t5/Glossary/MSISDN/ta-p/7628).
    - `from` string — Sender number. Must be valid phone number, short code or alphanumeric. Required if Automatic Default Originator not configured.
    - `body` string, required — The message content Base64 encoded. Max 140 bytes including `udh`.
    - `udh` string, required — The UDH header of a binary message HEX encoded. Max 140 bytes including the `body`.
    - `type` 'mt_binary' — SMS in [binary](https://community.sinch.com/t5/Glossary/Binary-SMS/ta-p/7470) format.
    - `delivery_report` 'none' | 'summary' | 'full' | 'per_recipient' | 'per_recipient_final' — Kind of delivery report
    - `send_at` string, date-time — If set in the future the message will be delayed until `send_at` occurs. Must be before `expire_at`. If set in the past, messages will be sent immediately. Formatted as [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601). For example: `YYYY-MM-DDThh:mm:ss.SSSZ`.
    - `expire_at` string, date-time — If set, the system will stop trying to deliver the message at this point. Must be after `send_at`. Default and max is 3 days after `send_at`. Formatted as [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601). For example: `YYYY-MM-DDThh:mm:ss.SSSZ`.
    - `callback_url` string — Override the *default* callback URL for this batch. Must be a valid URL. Learn how to set a default callback URL [here](https://community.sinch.com/t5/SMS/How-do-I-assign-a-callback-URL-to-an-SMS-service-plan/ta-p/8414).
    - `client_reference` string — The client identifier of a batch message. If set, the identifier will be added in the delivery report/callback of this batch.
    - `feedback_enabled` boolean — If set to true then [feedback](https://developers.sinch.com/docs/sms/api-reference/sms/batches/deliveryfeedback) is expected after successful delivery.
    - `from_ton` integer — The type of number for the sender number. Use to override the automatic detection.
    - `from_npi` integer — Number Plan Indicator for the sender number. Use to override the automatic detection.
  - Media — Only available in the US. Contact your account manager if you wish to send MMS.
    - `to` MtDestination[], required — List of Phone numbers and group IDs that will receive the batch. [More info](https://community.sinch.com/t5/Glossary/MSISDN/ta-p/7628)
    - `from` string — Sender number. Must be valid phone number, short code or alphanumeric. Required if Automatic Default Originator not configured.
    - `body` MediaBody, required — The message content, including a URL to the media file
      - `subject` string — The subject text
      - `message` string — The message text. Text only media messages will be rejected, please use SMS instead.
      - `url` string, required — URL to the media file
    - `parameters` ParameterObj — Contains the parameters that will be used for customizing the message for each recipient. [Click here to learn more about parameterization](https://developers.sinch.com/docs/sms/resources/message-info/message-parameterization).
    - `type` 'mt_media' — MMS
    - `delivery_report` 'none' | 'summary' | 'full' | 'per_recipient' | 'per_recipient_final' — Kind of delivery report
    - `send_at` string, date-time — If set in the future, the message will be delayed until `send_at` occurs. Must be before `expire_at`. If set in the past, messages will be sent immediately. Formatted as [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601): `YYYY-MM-DDThh:mm:ss.SSSZ`.
    - `expire_at` string, date-time — If set, the system will stop trying to deliver the message at this point. Must be after `send_at`. Default and max is 3 days after `send_at`. Formatted as [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601): `YYYY-MM-DDThh:mm:ss.SSSZ`.
    - `callback_url` string — Override the default callback URL for this batch. Must be valid URL.
    - `client_reference` string — The client identifier of a batch message. If set, the identifier will be added in the delivery report/callback of this batch
    - `feedback_enabled` boolean — If set to `true`, then [feedback](https://developers.sinch.com/docs/sms/api-reference/sms/batches/deliveryfeedback) is expected after successful delivery.
    - `strict_validation` boolean — Whether or not you want the media included in your message to be checked against [Sinch MMS channel best practices](https://developers.sinch.com/docs/mms/bestpractices/). If set to true, your message will be rejected if it doesn't conform to the listed recommendations, otherwise no validation will be performed.
  - Text
    - `to` MtDestination[], required — List of Phone numbers and group IDs that will receive the batch. [More info](https://community.sinch.com/t5/Glossary/MSISDN/ta-p/7628)
    - `from` string — Sender number. Must be valid phone number, short code or alphanumeric. Required if Automatic Default Originator not configured.
    - `parameters` ParameterObj — Contains the parameters that will be used for customizing the message for each recipient. [Click here to learn more about parameterization](https://developers.sinch.com/docs/sms/resources/message-info/message-parameterization).
    - `body` string, required — The message content
    - `type` 'mt_text' — Regular SMS
    - `delivery_report` 'none' | 'summary' | 'full' | 'per_recipient' | 'per_recipient_final' — Kind of delivery report
    - `send_at` string, date-time — If set in the future, the message will be delayed until `send_at` occurs. Must be before `expire_at`. If set in the past, messages will be sent immediately. Formatted as [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601): `YYYY-MM-DDThh:mm:ss.SSSZ`.
    - `expire_at` string, date-time — If set, the system will stop trying to deliver the message at this point. Must be after `send_at`. Default and max is 3 days after `send_at`. Formatted as [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601): `YYYY-MM-DDThh:mm:ss.SSSZ`.
    - `callback_url` string — Override the *default* callback URL for this batch. Must be a valid URL. Learn how to set a default callback URL [here](https://community.sinch.com/t5/SMS/How-do-I-assign-a-callback-URL-to-an-SMS-service-plan/ta-p/8414).
    - `client_reference` string — The client identifier of a batch message. If set, the identifier will be added in the delivery report/callback of this batch
    - `feedback_enabled` boolean — If set to `true`, then [feedback](https://developers.sinch.com/docs/sms/api-reference/sms/batches/deliveryfeedback) is expected after successful delivery.
    - `flash_message` boolean — Shows message on screen without user interaction while not saving the message to the inbox.
    - `max_number_of_message_parts` integer — Message will be dispatched only if it is not split to more parts than Max Number of Message Parts
    - `truncate_concat` boolean — If set to `true` the message will be shortened when exceeding one part.
    - `from_ton` integer — The type of number for the sender number. Use to override the automatic detection.
    - `from_npi` integer — Number Plan Indicator for the sender number. Use to override the automatic detection.

## Response `200`

OK. A successful response , or an [Error](https://developers.sinch.com/docs/sms/api-reference/status-codes).

- ApiMtMessageDryRun
  - `number_of_recipients` integer, required — The number of recipients in the batch
  - `number_of_messages` integer, required — The total number of SMS message parts to be sent in the batch
  - `per_recipient` ApiRecipientDryRun[]
    - `recipient` string, required — Sender number. Required if Automatic Default Originator not configured.
    - `body` string, required
    - `number_of_parts` integer, required
    - `encoding` 'text' | 'unicode', required

## Other responses

- `400` — Bad request

---

[API](https://skmtc.net/sinch/apis/api-overview-sinch.md) · [All operations](https://skmtc.net/sinch/apis/api-overview-sinch/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sinch/api-overview-sinch/revisions/67cb925f1c81/schema)
