# Sending and managing messages This article details commonly used API operations. Each section corresponds to an operation and includes a brief overview, a sample request and response payload, and schema information pulled directly from the API reference. Additionally, each section will include links to the corresponding [API reference entry](../api-reference/) and any tutorials (if available). Note: For information on how complete the configuration steps required for this API, along with language-specific guides that illustrate the API's functionality with pre-populated examples, see the [Getting started](../getting-started/) guides that correspond to this API. The SMS REST API enables users to send, retreive, update and delete messages to one or more recipient(s) using **batches**. In simple terms, a batch consists of the message you want to send, your Sinch mobile number, and a list of recipients. With batches, you can do everything from appointment scheduling to marketing campaigns. ## Sending a message This endpoint enables you to send messages. As well as sending messages to multiple recipients, it allows users to schedule messages and even set an expiry date. This is useful for applications which require messages to be sent at particular times, such as appointment scheduling or marketing campaigns. Note: Our **Getting Started** guides contain ready-made code samples for sending a message in the following languages: [**Node**](/docs/sms/getting-started/node/send-sms/) | [**Node SDK**](/docs/sms/getting-started/node-sdk/send-message/) | [**Java SDK**](/docs/sms/getting-started/java/send-sms-sdk/) | [**.NET**](/docs/sms/getting-started/csharp/send-sms/) | [**.NET SDK**](/docs/sms/getting-started/dotnet-sdk/send-message/) | [**Python SDK**](https://developers.sinch.com/docs/sms/getting-started/python/send-sms-sdk/) | [**PHP**](/docs/sms/getting-started/php/send-sms/) ### Send message request and response Below are code samples that highlight how to make this API request in multiple languages. A sample response is also provided. Select your preferred coding language from the language drop-down list: For all possible request body schemas that correspond to this API call, see the [corresponding entry](/docs/sms/api-reference/sms/batches/sendsms) in the API reference. Alternatively, expand the schema below: details summary See the schema For all possible response schemas that correspond to this API call, see the [corresponding entry](/docs/sms/api-reference/sms/batches/sendsms) in the API reference. ## Performing a dry run for a batch of recipients 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. If you are a new Sinch user, the Dry Run operation is perfect for testing how to send a message as it incurrs no costs. For existing users, the Dry Run operation is very useful for testing SMS marketing campaigns designed to engage high volumes of users and making sure there are no errors. ### Dry run request and response Below are code samples that highlight how to make this API request in multiple languages. A sample response is also provided. Select your preferred coding language from the language drop-down list: For all possible request body schemas that correspond to this API call, see the [corresponding entry](/docs/sms/api-reference/sms/batches/dry_run) in the API reference. Alternatively, expand the schema below: details summary See the schema For the full schema of the response that corresponds to this API call, see the [corresponding entry](/docs/sms/api-reference/sms/batches/dry_run) in the API reference. ## Retrieving a list of batches The list operation enables you to list batch messages that you have created in the last 14 days. This operation is highly customizable. Users can filter results by date range and `from` number. If there is a high volume of batches, results can be paginated. Pagination is flexible, with the `page` and `page_size` query parameters enabling users to set the number of pages and the number of results per page. ### Retrieve a list of batches request and response Below are code samples that highlight how to make this API request in multiple languages. A sample response is also provided. Select your preferred coding language from the language drop-down list: For the full schema of this API call, see the [corresponding entry](/docs/sms/api-reference/sms/batches/listbatches). For the full schema of the response that corresponds to this API call, see the [corresponding entry](/docs/sms/api-reference/sms/batches/listbatches) in the API reference. ## Retrieving a message This operation enables users to retrieve a message they created, by returning a specific batch that matches the `batch_id` provided in the path parameters. This is useful if you want to review messages to check for mistakes. ### Retrieve a message request and response Below are code samples that highlight how to make this API request in multiple languages. A sample response is also provided. Select your preferred coding language from the language drop-down list: For the full schema of this API call, see the [corresponding entry](/docs/sms/api-reference/sms/batches/getbatchmessage). For all possible response schemas that correspond to this API call, see the [corresponding entry](/docs/sms/api-reference/sms/batches/getbatchmessage) in the API reference. ## Update a batch message The upate operation works by updating all specified parameters of a batch that matches the `batch_id` provided in the path parameters. This gives users plenty of flexibility, they can change everything from the recipients and groups the message gets sent to, to the type of delivery report. This means users can tweak campaigns they have scheduled in response to new requirements. ### Update a batch message request and response Below are code samples that highlight how to make this API request in multiple languages. A sample response is also provided. Select your preferred coding language from the language drop-down list: For all possible request body schemas that correspond to this API call, see the [corresponding entry](/docs/sms/api-reference/sms/batches/updatebatchmessage) in the API reference. Alternatively, expand the schema below: details summary See the schema For all possible response schemas that correspond to this API call, see the [corresponding entry](/docs/sms/api-reference/sms/batches/updatebatchmessage) in the API reference. ## Replace a message batch This operation enables a users to replace a batch wholesale. It works by replacing all the parameters of a batch with the provided values. It is the same as cancelling a batch and sending a new one instead. This is useful in situations where simply modifying an existing batch isn't enough. ### Replace a message batch request and response Below are code samples that highlight how to make this API request in multiple languages. A sample response is also provided. Select your preferred coding language from the language drop-down list: For all possible request body schemas that correspond to this API call, see the [corresponding entry](/docs/sms/api-reference/sms/batches/replacebatch) in the API reference. Alternatively, expand the schema below: details summary See the schema For all possible response schemas that correspond to this API call, see the [corresponding entry](/docs/sms/api-reference/sms/batches/replacebatch) in the API reference. ## Cancel a batch message This endpoint allows users to cancel a batch by `batch_id` provided in the path parameters. This enables a message to be cancelled before all the intended recipients receive it. Note: If a message has already been succesfully delivered, it can't be cancelled. It's therefore advisable to cancel a scheduled batch **before** the message is scheduled to be sent. ### Cancel a batch request and response Below are code samples that highlight how to make this API request in multiple languages. A sample response is also provided. Select your preferred coding language from the language drop-down list: For the full schema of the request that corresponds to this API call, see the [corresponding entry](/docs/sms/api-reference/sms/batches/cancelbatchmessage) in the API reference. For all possible response schemas that correspond to this API call, see the [corresponding entry](/docs/sms/api-reference/sms/batches/cancelbatchmessage) in the API reference. ## Send delivery feedback for a message When a parameter called `feedback_enabled` is set in a send batch message call, the SMS API can provide feedback on whether the message was delivered successfully using this send delivery feedback API call. By providing the `batch_id` in the path parameter of this operation, users can get delivery feedback for the recipients in the corresponding batch. This is useful in for any user that needs to confirm that their messages are being received. For example, if you're running a marketing campaign, it's essential to have some measure of how successful it was. ### Send delivery feedback request and response Below are code samples that highlight how to make this API request in multiple languages. A sample response is also provided. Select your preferred coding language from the language drop-down list: For the full schema of the request that corresponds to this API call, see the [corresponding entry](/docs/sms/api-reference/sms/batches/deliveryfeedback) in the API reference. Alternatively, expand the schema below: details summary See the schema Response 202 if successful.