openapi: 3.1.0
info:
  title: API Overview | Sinch
  description: >-
    Sinch SMS API is one of the easiest APIs we offer and enables you to add
    fast and reliable global SMS to your applications. Send single messages,
    scheduled batch messages, use available message templates and more.
  termsOfService: https://www.sinch.com/terms-of-service/
  contact:
    name: Support
    url: https://www.sinch.com
    email: Support@sinch.com
  license:
    name: MIT
    url: https://www.sinch.com/toc
  version: v1
servers:
  - url: https://{region}.sms.api.sinch.com
    description: Global API
    variables:
      region:
        default: us
        enum:
          - us
          - eu
          - au
          - br
          - ca
        x-enumDescriptions:
          us: United States
          eu: Europe
          au: Australia
          br: Brazil
          ca: Canada
tags:
  - name: Delivery reports
    description: >-
      The REST API uses message statuses and error codes in delivery reports,
      which refer to the state of the batch and can be present in either
      [Retrieve a delivery
      report](/docs/sms/api-reference/sms/delivery-reports/getdeliveryreportbybatchid)
      or sent as a callback.


      ## Delivery report statuses


      The status field describes which state a particular message is in. Note
      that statuses of type Intermediate will only be reported if you request a
      status of `per_recipient` ([Retrieve a recipient delivery
      report](/docs/sms/api-reference/sms/delivery-reports/getdeliveryreportbyphonenumber)).


      The following statuses are available when using the SMS REST API:


      | Status       | Type         |
      Description                                   |

      | ------------ | ------------ |
      --------------------------------------------- |

      | `Queued`     | Intermediate | Message is queued within REST API system
      and will be dispatched according to the rate of the
      account.                                         |

      | `Dispatched` | Intermediate | Message has been dispatched and accepted
      for delivery by the SMSC. Note that, in certain scenarios, the
      `Dispatched` status may be skipped if a more `Final` status is reached
      prior to sending the delivery report. For example, if a delivery report is
      not sent prior to the corresponding message's successful delivery, you may
      only get a delivery report with a `Delivered` status.|

      | `Aborted`    | Final        | Message was aborted before reaching the
      SMSC.                                                                                                
      |

      | `Cancelled`  | Final        | Message was cancelled by user before
      reaching
      SMSC.                                                                                          
      |

      | `Rejected`   | Final        | Message was rejected by the
      SMSC.                                                                                                            
      |

      | `Deleted`    | Final        | Message has been deleted. Message was
      deleted by a remote SMSC. This may happen if the destination is an invalid
      MSISDN or opted out subscriber.  |

      | `Delivered`  | Final        | Message has been
      delivered.                                                                                                                  
      |

      | `Failed`     | Final        | Message failed to be
      delivered.                                                                                                              
      |

      | `Expired`    | Final        | Message expired before delivery to the
      SMSC. This may happen if the expiry time for the message was very
      short.                               |

      | `Unknown`    | Final        | Message was delivered to the SMSC but no
      Delivery Receipt has been received or a Delivery Receipt that couldn't be
      interpreted was received.  |


      ## Delivery report error codes


      The delivery report status code provides a more detailed view of what
      happened with a message. The REST API error codes are a combination of
      [SMPP error
      codes](/docs/sms/smpp/error-codes/#status-reports-error-codes), [MMS error
      codes](/docs/mms/7-service/mms-status-codes/) and custom codes.


      The REST API custom error codes are all within the 4xx range. These are
      listed below:


      | Status Code       | Name                         | Status       |
      Description                                               |

      | ----------------- | ---------------------------- | ------------ |
      --------------------------------------------------------- |

      | 400               | Queued                       | `Queued`     |
      Message is queued within REST API system and will be dispatched according
      to the rate of the account.     |

      | 401               | Dispatched                   | `Dispatched` |
      Message has been dispatched to SMSC.                              |

      | 402               | Message unroutable           | `Aborted`    | SMSC
      rejected message. Retrying is likely to cause the same error.            |

      | 403               | Internal error               | `Aborted`    | An
      unexpected error caused the message to fail.               |

      | 404               | Temporary delivery failure   | `Aborted`    |
      Message failed because of temporary delivery failure. Message can be
      retried.        |

      | 405               | Unmatched Parameter          | `Aborted`    | One or
      more parameters in the message body has no mapping for this recipient. See
      [Message
      Parameterization](../../../../resources/message-info/message-parameterization/)
      |

      | 406               | Internal Expiry              | `Aborted`    |
      Message was expired before reaching SMSC. This may happen if the expiry
      time for the message was very short.     |

      | 407               | Cancelled                    | `Cancelled`  |
      Message was cancelled by user before reaching SMSC.    |

      | 408               | Internal Reject              | `Aborted`    | SMSC
      rejected the message. Retrying is likely to cause the same error.        
      |

      | 410               | Unmatched default originator | `Aborted`    | No
      default originator exists/configured for this recipient when sending
      message without originator.    |

      | 411               | Exceeded parts limit         | `Aborted`    |
      Message failed as the number of message parts exceeds the defined max
      number of message parts.    |

      | 412               | Unprovisioned region         | `Aborted`    | SMSC
      rejected the message. The account hasn't been provisioned for this
      region.     |

      | 413               | Blocked                      | `Aborted`    | The
      account is blocked. Reach out to support for help. Potentially out of
      credits.             |

      | 414               | Bad Media                    | `Aborted`    | MMS
      only, the request failed due to a bad media URL. It is possible that the
      URL was unreachable, or sent a bad response.             |

      | 415               | Delivery report Rejected     | `Failed`     | MMS
      only, message reached MMSC but was rejected by MMS gateway or mobile
      network.              |

      | 416               | Delivery report Not Supported| `Failed`     | MMS
      only, message reached MMSC but it is not supported.             |

      | 417               | Delivery report Unreachable  | `Failed`     | MMS
      only, message reached MMSC but the destination network or the mobile
      subscriber cannot be reached.             |

      | 418               | Delivery report Unrecognized | `Failed`     | MMS
      only, message reached MMSC but the handset of the mobile subscriber does
      not recognize the message content.             |
  - name: Groups
    description: >-
      A group is a set of phone numbers (or
      [MSISDNs](https://community.sinch.com/t5/Glossary/MSISDN/ta-p/7628)) that
      can be used as a target when sending an SMS. An phone number (MSISDN) can
      only occur once in a group and any attempts to add a duplicate are ignored
      but not rejected.
  - name: Batches
    description: >-
      Batches are sets of SMS messages. You can send a single message or many.
      Batches are queued and sent at the rate limit in first-in-first-out order.
  - name: Inbounds
    description: >-
      Inbounds, or Mobile Originated (MO) messages, are incoming messages.
      Inbound messages can be listed and retrieved like batch messages and they
      can also be delivered by callback requests like delivery reports.


      ## MMS Media error codes


      The REST API handles MO media messages by uploading them to specified s3
      storage location and providing the URL to download the attachment.

      On a successful upload, the code will be `0`. If the upload fails, the
      code will be a value other than `0`.


      | Status Code     | Name                         | Status       |
      Description                                               |

      | --------------- | ---------------------------- | ------------ |
      --------------------------------------------------------- |

      | 0               | Uploaded                     | `Uploaded`   |
      Attachment successfully uploaded to storage. |

      | 1               | Internal failure             | `Failed`     | Internal
      exception happened during upload. |

      | 2               | Bucket not found             | `Failed`     |
      Provisioned bucket doesn't exist. |
  - name: Webhooks
    description: >-
      ## Callbacks
        A callback is an HTTP POST request with a notification made by the Sinch SMS REST API to a URI of your choosing.
        
        The REST API expects the receiving server to respond with a response code within the `2xx` success range. For `5xx` the callback will be retried. For `429` the callback will be retried and the throughput will be lowered. For other status codes in the `4xx` range the callback will not be retried. The first initial retry will happen 5 seconds after the first try. The next attempt is after 10 seconds, then after 20 seconds, after 40 seconds, after 80 seconds, doubling on every attempt. The last retry will be at 81920 seconds (or 22 hours 45 minutes) after the initial failed attempt.

      Note that, with these callbacks, the Sinch SMS REST API will make a
      request to the URI of your choosing. This means that Sinch will be
      authenticating against **your system**. By making a request to your
      account manager, SMS REST API callbacks may be configured with the
      following options:       
        - **Basic authentication** is the simplest form of authentication. It enables access to the SMS API via a username and password. Basic Auth can be utilised in a callback by provisioning the callback URL with the appropriate username and password. Note that, because callbacks are made by Sinch to a URI of your choosing (rather than a call made by your system to Sinch's endpoints), the username and password must be accepted by **your system**.
        - **OAuth 2.0** is a standard form of authentication that provides enhanced security when compared to Basic Authentication. It uses access tokens to reduce the risk of credentials being intercepted. OAuth 2.0 can be utilised in a callback by provisioning the callback URL with username, password, response, scope, and the URL to fetch OAuth access token. Note that, because callbacks are made by Sinch to a URI of your choosing (rather than a call made by your system to Sinch's endpoints), the username, password, response, scope, and access token URL must be accepted by **your system**.
        - **HMAC** Hash-based message authentication code (HMAC) is a cryptographic authentication technique that uses a hash function and a secret key. HMAC can also be configured alongside Basic Auth and OAuth. HMAC authentication can be assigned to a specific URL or an entire Service Plan. In either case, reach out to your account manager to configure HMAC authentication.
        - **AWS SNS** is a managed service that provides message delivery from publishers to subscribers by routing messages through SNS topics. Users can utilise AWS SNS in a callback by provisioning the callback URL with an Access Key ID, Secret Key and Region.

        Additionally, the SMS REST API supports customized headers in callbacks. Reach out to your account manager to configure customized callback headers.Your account manager will be able to configure callbacks associated with your account so that they include the header and value pairs you provide.
        
paths:
  /xms/v1/{service_plan_id}/groups/{group_id}:
    parameters:
      - $ref: '#/components/parameters/service_plan_id'
      - $ref: '#/components/parameters/group_id'
    get:
      tags:
        - Groups
      summary: Retrieve a group
      description: This operation retrieves a specific group with the provided group ID.
      operationId: RetrieveGroup
      responses:
        '200':
          description: >-
            A successful response, or an
            [Error](https://developers.sinch.com/docs/sms/api-reference/status-codes).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiGroup'
        '404':
          description: Not found. The group ID is unknown to the system.
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: Java
          source: |
            /**
             * Sinch Java Snippet
             *
             * <p>This snippet is available at https://github.com/sinch/sinch-sdk-java-snippets
             *
             * <p>See https://github.com/sinch/sinch-sdk-java-snippets/blob/main/README.md for details
             */
            package sms.groups;

            import com.sinch.sdk.SinchClient;
            import com.sinch.sdk.domains.sms.api.v1.GroupsService;
            import com.sinch.sdk.domains.sms.models.v1.groups.Group;
            import com.sinch.sdk.models.Configuration;
            import com.sinch.sdk.models.SMSRegion;
            import java.util.logging.Logger;
            import utils.Settings;

            public class Get {

              private static final Logger LOGGER = Logger.getLogger(Get.class.getName());

              public static void main(String[] args) {

                String projectId = Settings.getProjectId().orElse("MY_PROJECT_ID");
                String keyId = Settings.getKeyId().orElse("MY_KEY_ID");
                String keySecret = Settings.getKeySecret().orElse("MY_KEY_SECRET");
                String smsRegion = Settings.getSMSRegion().orElse("MY_SMS_REGION");

                // The ID of the group to retrieve
                String groupId = "GROUP_ID";

                Configuration configuration =
                    Configuration.builder()
                        .setProjectId(projectId)
                        .setKeyId(keyId)
                        .setKeySecret(keySecret)
                        .setSmsRegion(SMSRegion.from(smsRegion))
                        .build();

                SinchClient client = new SinchClient(configuration);

                GroupsService groupsService = client.sms().v1().groups();

                LOGGER.info(String.format("Get information for group with ID '%s'", groupId));

                Group response = groupsService.get(groupId);

                LOGGER.info("Response: " + response);
              }
            }
    put:
      tags:
        - Groups
      summary: Replace a group
      description: >-
        The replace operation will replace all parameters, including members, of
        an existing group with new values.


        Replacing a group targeted by a batch message scheduled in the future is
        allowed and changes will be reflected when the batch is sent.
      operationId: ReplaceGroup
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiGroupRequest'
            examples:
              GroupReplaceGroup:
                $ref: '#/components/examples/GroupReplaceGroup'
        required: true
      responses:
        '200':
          description: >-
            A successful response, or an
            [Error](https://developers.sinch.com/docs/sms/api-reference/status-codes).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiGroup'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponseObj'
              example:
                code: syntax_invalid_parameter_format
                text: >-
                  The format of parameter 'members[0]' is invalid; value '+1' is
                  not a valid MSISDN.
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponseObj'
              example:
                code: unknown_group
                text: Group '01FC66621VHDBN119Z8PMV1QPU' is unknown or deleted
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: Java
          source: >
            /**
             * Sinch Java Snippet
             *
             * <p>This snippet is available at https://github.com/sinch/sinch-sdk-java-snippets
             *
             * <p>See https://github.com/sinch/sinch-sdk-java-snippets/blob/main/README.md for details
             */
            package sms.groups;


            import com.sinch.sdk.SinchClient;

            import com.sinch.sdk.domains.sms.api.v1.GroupsService;

            import com.sinch.sdk.domains.sms.models.v1.groups.Group;

            import
            com.sinch.sdk.domains.sms.models.v1.groups.request.GroupRequest;

            import com.sinch.sdk.models.Configuration;

            import com.sinch.sdk.models.SMSRegion;

            import java.util.Arrays;

            import java.util.HashSet;

            import java.util.Set;

            import java.util.logging.Logger;

            import utils.Settings;


            public class Replace {

              private static final Logger LOGGER = Logger.getLogger(Replace.class.getName());

              public static void main(String[] args) {

                String projectId = Settings.getProjectId().orElse("MY_PROJECT_ID");
                String keyId = Settings.getKeyId().orElse("MY_KEY_ID");
                String keySecret = Settings.getKeySecret().orElse("MY_KEY_SECRET");
                String smsRegion = Settings.getSMSRegion().orElse("MY_SMS_REGION");

                // The ID of the group to replace members for
                String groupId = "GROUP_ID";
                // The new members to set for the group (Phone numbers in E.164 format)
                Set<String> members = new HashSet<>(Arrays.asList("RECIPIENT_PHONE_NUMBER"));

                Configuration configuration =
                    Configuration.builder()
                        .setProjectId(projectId)
                        .setKeyId(keyId)
                        .setKeySecret(keySecret)
                        .setSmsRegion(SMSRegion.from(smsRegion))
                        .build();

                SinchClient client = new SinchClient(configuration);

                GroupsService groupsService = client.sms().v1().groups();

                GroupRequest request = GroupRequest.builder().setMembers(members).build();

                LOGGER.info(String.format("Replace group with ID '%s'", groupId));

                Group response = groupsService.replace(groupId, request);

                LOGGER.info("Response :" + response);
              }
            }
    post:
      tags:
        - Groups
      summary: Update a group
      description: >-
        With the update group operation, you can add and remove members in an
        existing group as well as rename the group.


        This method encompasses a few ways to update a group:


        1. By using `add` and `remove` arrays containing phone numbers, you
        control the group movements. Any list of valid numbers in E.164 format
        can be added.

        2. By using the `auto_update` object, your customer can add or remove
        themselves from groups. 

        3. You can also add or remove other groups into this group with
        `add_from_group` and `remove_from_group`.


        #### Other group update info


        - The request will not be rejected for duplicate adds or unknown
        removes.

        - The additions will be done before the deletions. If an phone number is
        on both lists, it will not be apart of the resulting group.

        - Updating a group targeted by a batch message scheduled in the future
        is allowed. Changes will be reflected when the batch is sent.
      operationId: UpdateGroup
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiGroupUpdate'
            examples:
              GroupAddRemoveList:
                $ref: '#/components/examples/GroupAddRemoveList'
              GroupAutoUpdate:
                $ref: '#/components/examples/GroupAutoUpdate'
              GroupAutoUpdateSharedShortCode:
                $ref: '#/components/examples/GroupAutoUpdateSharedShortCode'
              GroupUpdateAdd:
                $ref: '#/components/examples/GroupUpdateAdd'
              GroupUpdateRemove:
                $ref: '#/components/examples/GroupUpdateRemove'
              GroupUpdateNameKeepMembers:
                $ref: '#/components/examples/GroupUpdateNameKeepMembers'
        required: true
      responses:
        '200':
          description: >-
            A successful response, or an
            [Error](https://developers.sinch.com/docs/sms/api-reference/status-codes).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiGroup'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponseObj'
              example:
                code: syntax_invalid_parameter_format
                text: >-
                  The format of parameter 'add[0]' is invalid; value '+1' is not
                  a valid MSISDN.
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponseObj'
              example:
                code: unknown_group
                text: Group '01FC66621VHDBN119Z8PMV1QPU' is unknown or deleted
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: Java
          source: >
            /**
             * Sinch Java Snippet
             *
             * <p>This snippet is available at https://github.com/sinch/sinch-sdk-java-snippets
             *
             * <p>See https://github.com/sinch/sinch-sdk-java-snippets/blob/main/README.md for details
             */
            package sms.groups;


            import com.sinch.sdk.SinchClient;

            import com.sinch.sdk.domains.sms.api.v1.GroupsService;

            import com.sinch.sdk.domains.sms.models.v1.groups.Group;

            import
            com.sinch.sdk.domains.sms.models.v1.groups.request.GroupUpdateRequest;

            import com.sinch.sdk.models.Configuration;

            import com.sinch.sdk.models.SMSRegion;

            import java.util.Arrays;

            import java.util.List;

            import java.util.logging.Logger;

            import utils.Settings;


            public class Update {

              private static final Logger LOGGER = Logger.getLogger(Update.class.getName());

              public static void main(String[] args) {

                String projectId = Settings.getProjectId().orElse("MY_PROJECT_ID");
                String keyId = Settings.getKeyId().orElse("MY_KEY_ID");
                String keySecret = Settings.getKeySecret().orElse("MY_KEY_SECRET");
                String smsRegion = Settings.getSMSRegion().orElse("MY_SMS_REGION");

                // The ID of the group to update
                String groupId = "GROUP_ID";
                // New name for the group
                String groupName = "Updated Group Name from Java SDK";
                // Members to remove from the group
                List<String> toRemove = Arrays.asList("+11111111111", "+29999999999");
                // Members to add to the group
                List<String> toAdd = Arrays.asList("+123456789", "+987654321");

                Configuration configuration =
                    Configuration.builder()
                        .setProjectId(projectId)
                        .setKeyId(keyId)
                        .setKeySecret(keySecret)
                        .setSmsRegion(SMSRegion.from(smsRegion))
                        .build();

                SinchClient client = new SinchClient(configuration);

                GroupsService groupsService = client.sms().v1().groups();

                GroupUpdateRequest request =
                    GroupUpdateRequest.builder().setName(groupName).setAdd(toAdd).setRemove(toRemove).build();

                LOGGER.info(String.format("Update group with ID '%s'", groupId));

                Group response = groupsService.update(groupId, request);

                LOGGER.info("Response: " + response);
              }
            }
    delete:
      tags:
        - Groups
      summary: Delete a group
      description: This operation deletes the group with the provided group ID.
      operationId: deleteGroup
      responses:
        '200':
          description: >-
            A successful response , or an
            [Error](https://developers.sinch.com/docs/sms/api-reference/status-codes).
        '404':
          description: Not found. The group ID is unknown to the system.
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: Java
          source: |
            /**
             * Sinch Java Snippet
             *
             * <p>This snippet is available at https://github.com/sinch/sinch-sdk-java-snippets
             *
             * <p>See https://github.com/sinch/sinch-sdk-java-snippets/blob/main/README.md for details
             */
            package sms.groups;

            import com.sinch.sdk.SinchClient;
            import com.sinch.sdk.domains.sms.api.v1.GroupsService;
            import com.sinch.sdk.models.Configuration;
            import com.sinch.sdk.models.SMSRegion;
            import java.util.logging.Logger;
            import utils.Settings;

            public class Delete {

              private static final Logger LOGGER = Logger.getLogger(Delete.class.getName());

              public static void main(String[] args) {

                String projectId = Settings.getProjectId().orElse("MY_PROJECT_ID");
                String keyId = Settings.getKeyId().orElse("MY_KEY_ID");
                String keySecret = Settings.getKeySecret().orElse("MY_KEY_SECRET");
                String smsRegion = Settings.getSMSRegion().orElse("MY_SMS_REGION");

                // The ID of the group to delete
                String groupId = "GROUP_ID";

                Configuration configuration =
                    Configuration.builder()
                        .setProjectId(projectId)
                        .setKeyId(keyId)
                        .setKeySecret(keySecret)
                        .setSmsRegion(SMSRegion.from(smsRegion))
                        .build();

                SinchClient client = new SinchClient(configuration);

                GroupsService groupsService = client.sms().v1().groups();

                LOGGER.info(String.format("Deleting group with ID '%s'", groupId));

                groupsService.delete(groupId);

                LOGGER.info("Done");
              }
            }
  /xms/v1/{service_plan_id}/batches/{batch_id}:
    parameters:
      - $ref: '#/components/parameters/service_plan_id'
      - $ref: '#/components/parameters/batch_id'
    get:
      tags:
        - Batches
      summary: Get a batch message
      description: >-
        This operation returns a specific batch that matches the provided batch
        ID.
      operationId: GetBatchMessage
      responses:
        '200':
          description: >-
            OK. A successful response , or an
            [Error](https://developers.sinch.com/docs/sms/api-reference/status-codes).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Batch'
              examples:
                RetrieveMessageResponseExample:
                  $ref: '#/components/examples/TextResponse'
        '404':
          description: Not found. The batch ID is unknown to the system.
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: Java
          source: >
            /**
             * Sinch Java Snippet
             *
             * <p>This snippet is available at https://github.com/sinch/sinch-sdk-java-snippets
             *
             * <p>See https://github.com/sinch/sinch-sdk-java-snippets/blob/main/README.md for details
             */
            package sms.batches;


            import com.sinch.sdk.SinchClient;

            import com.sinch.sdk.domains.sms.api.v1.BatchesService;

            import
            com.sinch.sdk.domains.sms.models.v1.batches.response.BatchResponse;

            import com.sinch.sdk.models.Configuration;

            import com.sinch.sdk.models.SMSRegion;

            import java.util.logging.Logger;

            import utils.Settings;


            public class Get {

              private static final Logger LOGGER = Logger.getLogger(Get.class.getName());

              public static void main(String[] args) {

                String projectId = Settings.getProjectId().orElse("MY_PROJECT_ID");
                String keyId = Settings.getKeyId().orElse("MY_KEY_ID");
                String keySecret = Settings.getKeySecret().orElse("MY_KEY_SECRET");
                String smsRegion = Settings.getSMSRegion().orElse("MY_SMS_REGION");

                // The ID of the SMS batch to retrieve
                String batchId = "BATCH_ID";

                Configuration configuration =
                    Configuration.builder()
                        .setProjectId(projectId)
                        .setKeyId(keyId)
                        .setKeySecret(keySecret)
                        .setSmsRegion(SMSRegion.from(smsRegion))
                        .build();

                SinchClient client = new SinchClient(configuration);

                BatchesService batchesService = client.sms().v1().batches();

                LOGGER.info(String.format("Get information for batch with ID '%s'", batchId));

                BatchResponse response = batchesService.get(batchId);

                LOGGER.info("Response: " + response);
              }
            }
    put:
      tags:
        - Batches
      summary: Replace a batch
      description: >-
        This operation will replace all the parameters of a batch with the
        provided values. It is the same as cancelling a batch and sending a new
        one instead.
      operationId: ReplaceBatch
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/Binary'
                - $ref: '#/components/schemas/Media'
                - $ref: '#/components/schemas/Text'
            examples:
              TextRequestExample:
                $ref: '#/components/examples/TextRequest'
              BinaryRequestExample:
                $ref: '#/components/examples/BinaryRequest'
              MediaRequestExample:
                $ref: '#/components/examples/MediaRequest'
        required: true
      responses:
        '200':
          description: >-
            A successful response , or an
            [Error](https://developers.sinch.com/docs/sms/api-reference/status-codes).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Batch'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponseObj'
              example:
                code: syntax_invalid_parameter_format
                text: >-
                  The format of parameter 'to[0]' is invalid; value '+1' is not
                  a valid MSISDN or group ID.
        '404':
          description: Not found. The batch ID is unknown to the system.
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: Java
          source: >
            /**
             * Sinch Java Snippet
             *
             * <p>This snippet is available at https://github.com/sinch/sinch-sdk-java-snippets
             *
             * <p>See https://github.com/sinch/sinch-sdk-java-snippets/blob/main/README.md for details
             */
            package sms.batches;


            import com.sinch.sdk.SinchClient;

            import com.sinch.sdk.domains.sms.api.v1.BatchesService;

            import
            com.sinch.sdk.domains.sms.models.v1.batches.request.TextRequest;

            import
            com.sinch.sdk.domains.sms.models.v1.batches.response.BatchResponse;

            import com.sinch.sdk.models.Configuration;

            import com.sinch.sdk.models.SMSRegion;

            import java.util.Arrays;

            import java.util.List;

            import java.util.logging.Logger;

            import utils.Settings;


            public class Replace {

              private static final Logger LOGGER = Logger.getLogger(Replace.class.getName());

              public static void main(String[] args) {

                String projectId = Settings.getProjectId().orElse("MY_PROJECT_ID");
                String keyId = Settings.getKeyId().orElse("MY_KEY_ID");
                String keySecret = Settings.getKeySecret().orElse("MY_KEY_SECRET");
                String smsRegion = Settings.getSMSRegion().orElse("MY_SMS_REGION");

                // ID of the SMS batch to replace
                String batchId = "BATCH_ID";
                // New values to replace in the batch (phone number, in E.164 format (e.g., +46701234567)
                List<String> recipients = Arrays.asList("NEW_RECIPIENT_PHONE_NUMBER");
                // New body of the SMS message
                String body = "A message body updated";

                Configuration configuration =
                    Configuration.builder()
                        .setProjectId(projectId)
                        .setKeyId(keyId)
                        .setKeySecret(keySecret)
                        .setSmsRegion(SMSRegion.from(smsRegion))
                        .build();

                SinchClient client = new SinchClient(configuration);

                BatchesService batchesService = client.sms().v1().batches();

                LOGGER.info(String.format("Replacing batch with ID '%s'", batchId));

                TextRequest request = TextRequest.builder().setTo(recipients).setBody(body).build();

                BatchResponse response = batchesService.replace(batchId, request);

                LOGGER.info("Response: " + response);
              }
            }
    post:
      tags:
        - Batches
      summary: Update a Batch message
      description: >-
        This operation updates all specified parameters of a batch that matches
        the provided batch ID.
      operationId: UpdateBatchMessage
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/update_binary_message'
                - $ref: '#/components/schemas/update_media_message'
                - $ref: '#/components/schemas/update_text_message'
            examples:
              BatchUpdateFillIn:
                $ref: '#/components/examples/BatchUpdateFillIn'
              BatchRemovePhoneNumbers:
                $ref: '#/components/examples/BatchRemovePhoneNumbers'
              BatchAddPhoneNumbers:
                $ref: '#/components/examples/BatchAddPhoneNumbers'
        required: true
      responses:
        '200':
          description: >-
            A successful response , or an
            [Error](https://developers.sinch.com/docs/sms/api-reference/status-codes).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Batch'
              examples:
                UpdatedMessageResponseExample:
                  $ref: '#/components/examples/TextResponse'
                BinaryResponseExample:
                  $ref: '#/components/examples/BinaryResponse'
                MediaResponseExample:
                  $ref: '#/components/examples/MediaResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponseObj'
              example:
                code: syntax_invalid_parameter_format
                text: >-
                  The format of parameter 'to_add[0]' is invalid; value 'abc' is
                  not a valid MSISDN or group ID.
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponseObj'
              example:
                code: missing_callback_url
                text: Requesting delivery report without any callback URL.
        '404':
          description: Not found. The batch ID is unknown to the system.
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: Java
          source: >
            /**
             * Sinch Java Snippet
             *
             * <p>This snippet is available at https://github.com/sinch/sinch-sdk-java-snippets
             *
             * <p>See https://github.com/sinch/sinch-sdk-java-snippets/blob/main/README.md for details
             */
            package sms.batches;


            import com.sinch.sdk.SinchClient;

            import com.sinch.sdk.domains.sms.api.v1.BatchesService;

            import
            com.sinch.sdk.domains.sms.models.v1.batches.request.UpdateTextRequest;

            import
            com.sinch.sdk.domains.sms.models.v1.batches.response.BatchResponse;

            import com.sinch.sdk.models.Configuration;

            import com.sinch.sdk.models.SMSRegion;

            import java.util.Arrays;

            import java.util.List;

            import java.util.logging.Logger;

            import utils.Settings;


            public class Update {

              private static final Logger LOGGER = Logger.getLogger(Update.class.getName());

              public static void main(String[] args) {

                String projectId = Settings.getProjectId().orElse("MY_PROJECT_ID");
                String keyId = Settings.getKeyId().orElse("MY_KEY_ID");
                String keySecret = Settings.getKeySecret().orElse("MY_KEY_SECRET");
                String smsRegion = Settings.getSMSRegion().orElse("MY_SMS_REGION");

                // ID of the SMS batch to update
                String batchId = "BATCH_ID";
                // Phone numbers to remove from the batch (in E.164 format, e.g., +46701234567)
                List<String> toRemove = Arrays.asList("+11111111111", "+29999999999");
                // Phone numbers to add to the batch (in E.164 format, e.g., +46701234567)
                List<String> toAdd = Arrays.asList("+123456789", "+987654321");

                Configuration configuration =
                    Configuration.builder()
                        .setProjectId(projectId)
                        .setKeyId(keyId)
                        .setKeySecret(keySecret)
                        .setSmsRegion(SMSRegion.from(smsRegion))
                        .build();

                SinchClient client = new SinchClient(configuration);

                BatchesService batchesService = client.sms().v1().batches();

                LOGGER.info(String.format("Updating batch with ID '%s'", batchId));

                UpdateTextRequest request =
                    UpdateTextRequest.builder().setToRemove(toRemove).setToAdd(toAdd).build();

                BatchResponse response = batchesService.update(batchId, request);

                LOGGER.info("Response: " + response);
              }
            }
    delete:
      tags:
        - Batches
      summary: Cancel a batch message
      description: >-
        A batch can be canceled at any point. If a batch is canceled while it's
        currently being delivered some messages currently being processed might
        still be delivered. The delivery report will indicate which messages
        were canceled and which weren't.


        Canceling a batch scheduled in the future will result in an empty
        delivery report while canceling an already sent batch would result in no
        change to the completed delivery report.
      operationId: CancelBatchMessage
      responses:
        '200':
          description: >-
            Batch deleted or an
            [Error](https://developers.sinch.com/docs/sms/api-reference/status-codes).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Batch'
              examples:
                CancelBatchResponseExample:
                  $ref: '#/components/examples/CancelBatchResponse'
        '404':
          description: Not found. The batch ID is unknown to the system.
        '409':
          description: >-
            Conflict. There was an active operation operating on the batch. The
            cancellation can be retried.
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: Java
          source: >
            /**
             * Sinch Java Snippet
             *
             * <p>This snippet is available at https://github.com/sinch/sinch-sdk-java-snippets
             *
             * <p>See https://github.com/sinch/sinch-sdk-java-snippets/blob/main/README.md for details
             */
            package sms.batches;


            import com.sinch.sdk.SinchClient;

            import com.sinch.sdk.domains.sms.api.v1.BatchesService;

            import
            com.sinch.sdk.domains.sms.models.v1.batches.response.BatchResponse;

            import com.sinch.sdk.models.Configuration;

            import com.sinch.sdk.models.SMSRegion;

            import java.util.logging.Logger;

            import utils.Settings;


            public class Cancel {

              private static final Logger LOGGER = Logger.getLogger(Cancel.class.getName());

              public static void main(String[] args) {

                String projectId = Settings.getProjectId().orElse("MY_PROJECT_ID");
                String keyId = Settings.getKeyId().orElse("MY_KEY_ID");
                String keySecret = Settings.getKeySecret().orElse("MY_KEY_SECRET");
                String smsRegion = Settings.getSMSRegion().orElse("MY_SMS_REGION");

                // ID of the batch to cancel
                String batchId = "BATCH_ID";

                Configuration configuration =
                    Configuration.builder()
                        .setProjectId(projectId)
                        .setKeyId(keyId)
                        .setKeySecret(keySecret)
                        .setSmsRegion(SMSRegion.from(smsRegion))
                        .build();

                SinchClient client = new SinchClient(configuration);

                BatchesService batchesService = client.sms().v1().batches();

                LOGGER.info(String.format("Cancelling batch with ID '%s'", batchId));

                BatchResponse response = batchesService.cancel(batchId);

                LOGGER.info("Response: " + response);
              }
            }
  /xms/v1/{service_plan_id}/groups:
    parameters:
      - $ref: '#/components/parameters/service_plan_id'
    get:
      tags:
        - Groups
      summary: List Groups
      description: >-
        With the list operation you can list all groups that you have created.
        This operation supports pagination.


        Groups are returned in reverse chronological order.
      operationId: ListGroups
      parameters:
        - name: page
          in: query
          description: The page number starting from 0.
          required: false
          schema:
            type: integer
            default: 0
            minimum: 0
          example: 4
        - name: page_size
          in: query
          description: Determines the size of a page.
          required: false
          schema:
            type: integer
            default: 30
            maximum: 100
            minimum: 0
          example: 50
      responses:
        '200':
          description: >-
            A successful response, or an
            [Error](https://developers.sinch.com/docs/sms/api-reference/status-codes).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiGroupList'
              examples:
                GroupListExample:
                  $ref: '#/components/examples/GroupList'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponseObj'
              example:
                code: syntax_invalid_parameter_format
                text: Parameter 'page_size' is not a valid integer; value 'zero'.
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: Java
          source: >
            /**
             * Sinch Java Snippet
             *
             * <p>This snippet is available at https://github.com/sinch/sinch-sdk-java-snippets
             *
             * <p>See https://github.com/sinch/sinch-sdk-java-snippets/blob/main/README.md for details
             */
            package sms.groups;


            import com.sinch.sdk.SinchClient;

            import com.sinch.sdk.domains.sms.api.v1.GroupsService;

            import
            com.sinch.sdk.domains.sms.models.v1.groups.response.ListGroupsResponse;

            import com.sinch.sdk.models.Configuration;

            import com.sinch.sdk.models.SMSRegion;

            import java.util.logging.Logger;

            import utils.Settings;


            public class List {

              private static final Logger LOGGER = Logger.getLogger(List.class.getName());

              public static void main(String[] args) {

                String projectId = Settings.getProjectId().orElse("MY_PROJECT_ID");
                String keyId = Settings.getKeyId().orElse("MY_KEY_ID");
                String keySecret = Settings.getKeySecret().orElse("MY_KEY_SECRET");
                String smsRegion = Settings.getSMSRegion().orElse("MY_SMS_REGION");

                Configuration configuration =
                    Configuration.builder()
                        .setProjectId(projectId)
                        .setKeyId(keyId)
                        .setKeySecret(keySecret)
                        .setSmsRegion(SMSRegion.from(smsRegion))
                        .build();

                SinchClient client = new SinchClient(configuration);

                GroupsService groupsService = client.sms().v1().groups();

                LOGGER.info("List groups");

                ListGroupsResponse response = groupsService.list();

                LOGGER.info("Response:");
                response.iterator().forEachRemaining(f -> LOGGER.info(f.toString()));
              }
            }
    post:
      tags:
        - Groups
      summary: Create a group
      description: >-
        This endpoint allows you to create a group of recipients.  A new group
        must be created with a group name. This is represented by the `name`
        field which can be up to 20 charecters. In addition, there are a number
        of optional fields:
          - `members` field enables groups to be created with an initial list of contacts
          - `auto_update` allows customers to auto subscribe to a new group. This contains three fields. The `to` field contains the group creator's number. (This number **must be provisioned by contacting your account manager**.) The `add` and `remove` fields are objects containing the keywords that customers need to text to join or leave a group.
      operationId: CreateGroup
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiGroupRequest'
            examples:
              GroupCreateFillIn:
                $ref: '#/components/examples/GroupCreateFillIn'
              CreateGroup:
                $ref: '#/components/examples/CreateGroup'
              GroupCreateParent:
                $ref: '#/components/examples/GroupCreateParent'
        required: true
      responses:
        '201':
          description: >-
            Created, or an
            [Error](https://developers.sinch.com/docs/sms/api-reference/status-codes).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiGroup'
              examples:
                ApiGroup:
                  $ref: '#/components/examples/ApiGroup'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponseObj'
              example:
                code: syntax_invalid_parameter_format
                text: >-
                  The format of parameter 'members[0]' is invalid; value '+1' is
                  not a valid MSISDN.
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponseObj'
              example:
                code: unknown_group
                text: Group '01FC66621VHDBN119Z8PMV1QPU' is unknown or deleted
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: Java
          source: >
            /**
             * Sinch Java Snippet
             *
             * <p>This snippet is available at https://github.com/sinch/sinch-sdk-java-snippets
             *
             * <p>See https://github.com/sinch/sinch-sdk-java-snippets/blob/main/README.md for details
             */
            package sms.groups;


            import com.sinch.sdk.SinchClient;

            import com.sinch.sdk.domains.sms.api.v1.GroupsService;

            import com.sinch.sdk.domains.sms.models.v1.groups.Group;

            import
            com.sinch.sdk.domains.sms.models.v1.groups.request.GroupRequest;

            import com.sinch.sdk.models.Configuration;

            import com.sinch.sdk.models.SMSRegion;

            import java.util.Arrays;

            import java.util.HashSet;

            import java.util.Set;

            import java.util.logging.Logger;

            import utils.Settings;


            public class Create {

              private static final Logger LOGGER = Logger.getLogger(Create.class.getName());

              public static void main(String[] args) {

                String projectId = Settings.getProjectId().orElse("MY_PROJECT_ID");
                String keyId = Settings.getKeyId().orElse("MY_KEY_ID");
                String keySecret = Settings.getKeySecret().orElse("MY_KEY_SECRET");
                String smsRegion = Settings.getSMSRegion().orElse("MY_SMS_REGION");

                // The name of the group to create
                String groupName = "Sinch Java SDK group";
                // The members to include in the group (Phone numbers in E.164 format)
                Set<String> members = new HashSet<>(Arrays.asList("PHONE_NUMBER"));

                Configuration configuration =
                    Configuration.builder()
                        .setProjectId(projectId)
                        .setKeyId(keyId)
                        .setKeySecret(keySecret)
                        .setSmsRegion(SMSRegion.from(smsRegion))
                        .build();

                SinchClient client = new SinchClient(configuration);

                GroupsService groupsService = client.sms().v1().groups();

                LOGGER.info("Creating group");

                GroupRequest request = GroupRequest.builder().setName(groupName).setMembers(members).build();

                Group response = groupsService.create(request);

                LOGGER.info("Response: " + response);
              }
            }
  /xms/v1/{service_plan_id}/batches:
    parameters:
      - $ref: '#/components/parameters/service_plan_id'
    get:
      tags:
        - Batches
      summary: List Batches
      description: >-
        With the list operation you can list batch messages created in the last
        14 days that you have created. This operation supports pagination.
      operationId: ListBatches
      parameters:
        - $ref: '#/components/parameters/page'
        - name: page_size
          in: query
          description: Determines the size of a page.
          required: false
          schema:
            type: integer
            default: 30
            maximum: 100
            minimum: 1
          example: 50
        - name: start_date
          in: query
          description: >-
            Only list messages received at or after this date/time. Formatted as
            [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601):
            `YYYY-MM-DDThh:mm:ss.SSSZ`.


            Default:

            Now-24
          required: false
          schema:
            type: string
            format: date-time
        - name: end_date
          in: query
          description: >-
            Only list messages received before this date/time. Formatted as
            [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601):
            `YYYY-MM-DDThh:mm:ss.SSSZ`.
          required: false
          schema:
            type: string
            format: date-time
        - name: from
          in: query
          description: >-
            Only list messages sent from this sender number. Multiple
            originating numbers can be comma separated. Must be phone numbers or
            short code.
          required: false
          explode: false
          schema:
            type: array
            items:
              type: string
          example:
            - '44345'
            - '45607'
        - name: client_reference
          in: query
          description: Client reference to include
          required: false
          schema:
            type: string
            maxLength: 2048
            minLength: 0
          example: myReference
      responses:
        '200':
          description: >-
            OK. A successful response, or an
            [Error](https://developers.sinch.com/docs/sms/api-reference/status-codes).
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiBatchList'
              examples:
                ApiBatchListExample:
                  $ref: '#/components/examples/ApiBatchList'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponseObj'
              example:
                code: syntax_invalid_parameter_format
                text: Parameter 'page_size' is not a valid integer; value 'zero'.
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: Java
          source: |
            /**
             * Sinch Java Snippet
             *
             * <p>This snippet is available at https://github.com/sinch/sinch-sdk-java-snippets
             *
             * <p>See https://github.com/sinch/sinch-sdk-java-snippets/blob/main/README.md for details
             */
            package sms.batches;

            import com.sinch.sdk.SinchClient;
            import com.sinch.sdk.domains.sms.api.v1.BatchesService;
            import com.sinch.sdk.models.Configuration;
            import com.sinch.sdk.models.SMSRegion;
            import java.util.logging.Logger;
            import utils.Settings;

            public class List {
              private static final Logger LOGGER = Logger.getLogger(List.class.getName());

              public static void main(String[] args) {

                String projectId = Settings.getProjectId().orElse("MY_PROJECT_ID");
                String keyId = Settings.getKeyId().orElse("MY_KEY_ID");
                String keySecret = Settings.getKeySecret().orElse("MY_KEY_SECRET");
                String smsRegion = Settings.getSMSRegion().orElse("MY_SMS_REGION");

                Configuration configuration =
                    Configuration.builder()
                        .setProjectId(projectId)
                        .setKeyId(keyId)
                        .setKeySecret(keySecret)
                        .setSmsRegion(SMSRegion.from(smsRegion))
                        .build();

                SinchClient client = new SinchClient(configuration);

                BatchesService batchesService = client.sms().v1().batches();

                LOGGER.info("List batches");

                LOGGER.info("Response:");

                batchesService.list().iterator().forEachRemaining(f -> LOGGER.info(f.toString()));
              }
            }
    post:
      tags:
        - Batches
      summary: Send
      description: >-
        Send a message or a batch of messages.


        Depending on the length of the body, one message might be split into
        multiple parts and charged accordingly.


        Any groups targeted in a scheduled batch will be evaluated at the time
        of sending. If a group is deleted between batch creation and scheduled
        date, it will be considered empty.


        Be sure to use the correct [region](/docs/sms/api-reference/#base-url)
        in the server URL.
      operationId: SendSMS
      requestBody:
        content:
          application/json:
            schema:
              type: object
              description: Default schema is Text if type is not specified
              oneOf:
                - $ref: '#/components/schemas/Text'
                - $ref: '#/components/schemas/Binary'
                - $ref: '#/components/schemas/Media'
            examples:
              BatchSendFillInText:
                $ref: '#/components/examples/BatchSendFillInText'
              BatchSendFillInBinary:
                $ref: '#/components/examples/BatchSendFillInBinary'
              BatchSendFillInMedia:
                $ref: '#/components/examples/BatchSendFillInMedia'
              BatchSendBasicSMSText:
                $ref: '#/components/examples/BatchSendBasicSMSText'
              BatchSendBasicSMSBinary:
                $ref: '#/components/examples/BatchSendBasicSMSBinary'
              BatchSendBasicCardMMS:
                $ref: '#/components/examples/BatchSendBasicCardMMS'
              BatchSendBasicMediaMMS:
                $ref: '#/components/examples/BatchSendBasicMediaMessage'
              BatchMessageWExpiryText:
                $ref: '#/components/examples/BatchMessageWExpiryText'
              BatchMessageWExpiryBinary:
                $ref: '#/components/examples/BatchMessageWExpiryBinary'
              BatchMessageCustomDeliveryReportURLText:
                $ref: '#/components/examples/BatchMessageCustomDeliveryReportURLText'
              BatchMessageCustomDeliveryReportURLBinary:
                $ref: >-
                  #/components/examples/BatchMessageCustomDeliveryReportURLBinary
              BatchParameterizedMessageText:
                $ref: '#/components/examples/BatchParameterizedMessageText'
              BatchParameterizedMediaMessageText:
                $ref: '#/components/examples/BatchParameterizedMediaMessageText'
        required: true
      responses:
        '201':
          description: >-
            Created. A successful response, or an
            [Error](https://developers.sinch.com/docs/sms/api-reference/status-codes).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Batch'
              examples:
                TextResponseExample:
                  $ref: '#/components/examples/TextResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponseObj'
              example:
                code: syntax_invalid_parameter_format
                text: >-
                  The format of parameter 'to[0]' is invalid; value '+1' is not
                  a valid MSISDN or group ID.
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponseObj'
              example:
                code: missing_callback_url
                text: Requesting delivery report without any callback URL.
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: Java
          source: >
            /**
             * Sinch Java Snippet
             *
             * <p>This snippet is available at https://github.com/sinch/sinch-sdk-java-snippets
             *
             * <p>See https://github.com/sinch/sinch-sdk-java-snippets/blob/main/README.md for details
             */
            package sms.batches;


            import com.sinch.sdk.SinchClient;

            import com.sinch.sdk.domains.sms.api.v1.BatchesService;

            import
            com.sinch.sdk.domains.sms.models.v1.batches.request.TextRequest;

            import
            com.sinch.sdk.domains.sms.models.v1.batches.response.BatchResponse;

            import com.sinch.sdk.models.Configuration;

            import com.sinch.sdk.models.SMSRegion;

            import java.util.Arrays;

            import java.util.List;

            import java.util.logging.Logger;

            import utils.Settings;


            public class Send {

              private static final Logger LOGGER = Logger.getLogger(Send.class.getName());

              public static void main(String[] args) {

                String projectId = Settings.getProjectId().orElse("MY_PROJECT_ID");
                String keyId = Settings.getKeyId().orElse("MY_KEY_ID");
                String keySecret = Settings.getKeySecret().orElse("MY_KEY_SECRET");
                String smsRegion = Settings.getSMSRegion().orElse("MY_SMS_REGION");

                // Sender could be a:
                // - phone number:  e.g. Sinch virtual number in E164 format
                // - alphanumeric sender ID: e.g. a brand name "BRAND"
                // - US short code: e.g. "12345"
                String sender = Settings.getPhoneNumber().orElse("SENDER_NUMBER");
                // The recipient phone number, in E.164 format (e.g., +46701234567)
                List<String> recipients = Arrays.asList("RECIPIENT_PHONE_NUMBER");
                // The body of the SMS message
                String body = "This is a test SMS message using the Sinch Java SDK.";

                Configuration configuration =
                    Configuration.builder()
                        .setProjectId(projectId)
                        .setKeyId(keyId)
                        .setKeySecret(keySecret)
                        .setSmsRegion(SMSRegion.from(smsRegion))
                        .build();

                SinchClient client = new SinchClient(configuration);

                BatchesService batchesService = client.sms().v1().batches();

                LOGGER.info(String.format("Sending SMS Text to recipients '%s'", recipients));

                TextRequest request =
                    TextRequest.builder().setTo(recipients).setBody(body).setFrom(sender).build();

                BatchResponse response = batchesService.send(request);

                LOGGER.info("Response: " + response);
              }
            }
  /xms/v1/{service_plan_id}/batches/{batch_id}/delivery_feedback:
    parameters:
      - $ref: '#/components/parameters/service_plan_id'
      - $ref: '#/components/parameters/batch_id'
    post:
      tags:
        - Batches
      summary: Send delivery feedback for a message
      description: >-
        Send feedback if your system can confirm successful message delivery. 


        Feedback can only be provided if `feedback_enabled` was set when batch
        was submitted. 


        **Batches**: It is possible to submit feedback multiple times for the
        same batch for different recipients. Feedback without specified
        recipients is treated as successful message delivery to all recipients
        referenced in the batch. Note that the `recipients` key is still
        required even if the value is empty.


        **Groups**: If the batch message was created using a group ID, at least
        one recipient is required. Excluding recipients (an empty recipient
        list) does not work and will result in a failed request.
      operationId: deliveryFeedback
      requestBody:
        description: >-
          A list of phone numbers (MSISDNs) that successfully received the
          message.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiDeliveryFeedback'
        required: true
      responses:
        '202':
          description: >-
            Accepted, or an
            [Error](https://developers.sinch.com/docs/sms/api-reference/status-codes).
            A successful response will return an empty 202 HTTP response,
            indicating that the request has been received and is processing.
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponseObj'
              example:
                code: syntax_constraint_violation
                text: >-
                  At least one recipient required for delivery feedback if the
                  batch was created with group ID.
        '404':
          description: Not found. The batch ID is unknown to the system.
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: Java
          source: >
            /**
             * Sinch Java Snippet
             *
             * <p>This snippet is available at https://github.com/sinch/sinch-sdk-java-snippets
             *
             * <p>See https://github.com/sinch/sinch-sdk-java-snippets/blob/main/README.md for details
             */
            package sms.batches;


            import com.sinch.sdk.SinchClient;

            import com.sinch.sdk.domains.sms.api.v1.BatchesService;

            import
            com.sinch.sdk.domains.sms.models.v1.batches.request.SendDeliveryFeedbackRequest;

            import com.sinch.sdk.models.Configuration;

            import com.sinch.sdk.models.SMSRegion;

            import java.util.Arrays;

            import java.util.List;

            import java.util.logging.Logger;

            import utils.Settings;


            public class SendDeliveryFeedback {

              private static final Logger LOGGER = Logger.getLogger(SendDeliveryFeedback.class.getName());

              public static void main(String[] args) {

                String projectId = Settings.getProjectId().orElse("MY_PROJECT_ID");
                String keyId = Settings.getKeyId().orElse("MY_KEY_ID");
                String keySecret = Settings.getKeySecret().orElse("MY_KEY_SECRET");
                String smsRegion = Settings.getSMSRegion().orElse("MY_SMS_REGION");

                // The batch ID from which the message was sent
                String batchId = "BATCH_ID";
                // The recipient phone number, in E.164 format (e.g., +46701234567)
                List<String> recipients = Arrays.asList("RECIPIENT_PHONE_NUMBER");

                Configuration configuration =
                    Configuration.builder()
                        .setProjectId(projectId)
                        .setKeyId(keyId)
                        .setKeySecret(keySecret)
                        .setSmsRegion(SMSRegion.from(smsRegion))
                        .build();

                SinchClient client = new SinchClient(configuration);

                BatchesService batchesService = client.sms().v1().batches();

                LOGGER.info(String.format("Sending delivery feedback for batch with ID '%s'", batchId));

                SendDeliveryFeedbackRequest request =
                    SendDeliveryFeedbackRequest.builder().setRecipients(recipients).build();

                batchesService.sendDeliveryFeedback(batchId, request);

                LOGGER.info("Done");
              }
            }
  /xms/v1/{service_plan_id}/batches/dry_run:
    parameters:
      - $ref: '#/components/parameters/service_plan_id'
    post:
      tags:
        - Batches
      summary: Dry run
      description: >-
        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.
      operationId: Dry_Run
      parameters:
        - name: per_recipient
          in: query
          description: Whether to include per recipient details in the response
          required: false
          schema:
            type: boolean
            default: false
            example: true
        - name: number_of_recipients
          in: query
          description: >-
            Max number of recipients to include per recipient details for in the
            response
          required: false
          schema:
            type: integer
            maximum: 1000
            minimum: 0
            example: 500
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/Binary'
                - $ref: '#/components/schemas/Media'
                - $ref: '#/components/schemas/Text'
            examples:
              DryRunFillIn:
                $ref: '#/components/examples/DryRunFillIn'
              DryRunParameters:
                $ref: '#/components/examples/DryRunParameters'
        required: true
      responses:
        '200':
          description: >-
            OK. A successful response , or an
            [Error](https://developers.sinch.com/docs/sms/api-reference/status-codes).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiMtMessageDryRun'
              examples:
                ApiMtMessageDryRun:
                  $ref: '#/components/examples/ApiMtMessageDryRun'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponseObj'
              example:
                code: syntax_invalid_parameter_format
                text: >-
                  The format of parameter 'to[0]' is invalid; value '+1' is not
                  a valid MSISDN or group ID.
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: Java
          source: >
            /**
             * Sinch Java Snippet
             *
             * <p>This snippet is available at https://github.com/sinch/sinch-sdk-java-snippets
             *
             * <p>See https://github.com/sinch/sinch-sdk-java-snippets/blob/main/README.md for details
             */
            package sms.batches;


            import com.sinch.sdk.SinchClient;

            import com.sinch.sdk.domains.sms.api.v1.BatchesService;

            import
            com.sinch.sdk.domains.sms.models.v1.batches.request.TextRequest;

            import
            com.sinch.sdk.domains.sms.models.v1.batches.response.DryRunResponse;

            import com.sinch.sdk.models.Configuration;

            import com.sinch.sdk.models.SMSRegion;

            import java.util.Arrays;

            import java.util.List;

            import java.util.logging.Logger;

            import utils.Settings;


            public class DryRun {

              private static final Logger LOGGER = Logger.getLogger(DryRun.class.getName());

              public static void main(String[] args) {

                String projectId = Settings.getProjectId().orElse("MY_PROJECT_ID");
                String keyId = Settings.getKeyId().orElse("MY_KEY_ID");
                String keySecret = Settings.getKeySecret().orElse("MY_KEY_SECRET");
                String smsRegion = Settings.getSMSRegion().orElse("MY_SMS_REGION");

                // Sender could be a:
                // - phone number:  e.g. Sinch virtual number in E164 format
                // - alphanumeric sender ID: e.g. a brand name "BRAND"
                // - US short code: e.g. "12345"
                String sender = Settings.getPhoneNumber().orElse("SENDER_NUMBER");
                // The recipient phone number, in E.164 format (e.g., +46701234567)
                List<String> recipients = Arrays.asList("RECIPIENT_PHONE_NUMBER");
                // The body of the SMS message
                String body = "A body text here";

                Configuration configuration =
                    Configuration.builder()
                        .setProjectId(projectId)
                        .setKeyId(keyId)
                        .setKeySecret(keySecret)
                        .setSmsRegion(SMSRegion.from(smsRegion))
                        .build();

                SinchClient client = new SinchClient(configuration);

                BatchesService batchesService = client.sms().v1().batches();

                LOGGER.info("DryRun Request");

                TextRequest request =
                    TextRequest.builder().setFrom(sender).setTo(recipients).setBody(body).build();

                DryRunResponse response = batchesService.dryRun(request);

                LOGGER.info("Response: " + response);
              }
            }
  /xms/v1/{service_plan_id}/inbounds:
    parameters:
      - $ref: '#/components/parameters/service_plan_id'
    get:
      tags:
        - Inbounds
      summary: List incoming messages
      description: >-
        With the list operation, you can list all inbound messages that you have
        received. This operation supports pagination. Inbounds are returned in
        reverse chronological order.
      operationId: ListInboundMessages
      parameters:
        - $ref: '#/components/parameters/page'
        - name: page_size
          in: query
          description: Determines the size of a page
          required: false
          schema:
            type: integer
            default: 30
            maximum: 100
            minimum: 1
        - name: to
          in: query
          description: >-
            Only list messages sent to this destination. Multiple phone numbers
            formatted as either
            [E.164](https://community.sinch.com/t5/Glossary/E-164/ta-p/7537) or
            short codes can be comma separated.
          required: false
          explode: false
          schema:
            type: array
            items:
              type: string
          example:
            - '+14155553421'
            - '45607'
        - name: start_date
          in: query
          description: >-
            Only list messages received at or after this date/time. Formatted as
            [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601):
            `YYYY-MM-DDThh:mm:ss.SSSZ`.


            Default:

            Now-24
          required: false
          schema:
            type: string
            format: date-time
        - name: end_date
          in: query
          description: >-
            Only list messages received before this date/time. Formatted as
            [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601):
            `YYYY-MM-DDThh:mm:ss.SSSZ`.
          required: false
          schema:
            type: string
            format: date-time
            example: '2016-10-02T09:34:18.542Z'
        - name: client_reference
          in: query
          description: >-
            Using a client reference in inbound messages requires additional
            setup on your account. Contact your [account
            manager](https://dashboard.sinch.com/settings/account-details) to
            enable this feature.


            Only list inbound messages that are in response to messages with a
            previously provided client reference. 
          required: false
          schema:
            type: string
            maxLength: 2048
            minLength: 0
          example: myReference
      responses:
        '200':
          description: >-
            OK. A successful response , or an
            [Error](https://developers.sinch.com/docs/sms/api-reference/status-codes).
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiInboundList'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponseObj'
              example:
                code: syntax_invalid_parameter_format
                text: Parameter 'page_size' is not a valid integer; value 'zero'.
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: Java
          source: |
            /**
             * Sinch Java Snippet
             *
             * <p>This snippet is available at https://github.com/sinch/sinch-sdk-java-snippets
             *
             * <p>See https://github.com/sinch/sinch-sdk-java-snippets/blob/main/README.md for details
             */
            package sms.inbounds;

            import com.sinch.sdk.SinchClient;
            import com.sinch.sdk.domains.sms.api.v1.InboundsService;
            import com.sinch.sdk.models.Configuration;
            import com.sinch.sdk.models.SMSRegion;
            import java.util.logging.Logger;
            import utils.Settings;

            public class List {

              private static final Logger LOGGER = Logger.getLogger(List.class.getName());

              public static void main(String[] args) {

                String projectId = Settings.getProjectId().orElse("MY_PROJECT_ID");
                String keyId = Settings.getKeyId().orElse("MY_KEY_ID");
                String keySecret = Settings.getKeySecret().orElse("MY_KEY_SECRET");
                String smsRegion = Settings.getSMSRegion().orElse("MY_SMS_REGION");

                Configuration configuration =
                    Configuration.builder()
                        .setProjectId(projectId)
                        .setKeyId(keyId)
                        .setKeySecret(keySecret)
                        .setSmsRegion(SMSRegion.from(smsRegion))
                        .build();

                SinchClient client = new SinchClient(configuration);

                InboundsService inboundsService = client.sms().v1().inbounds();

                LOGGER.info("List inbounds messages");

                LOGGER.info("Response:");
                inboundsService.list().iterator().forEachRemaining(f -> LOGGER.info(f.toString()));
              }
            }
  /xms/v1/{service_plan_id}/inbounds/{inbound_id}:
    parameters:
      - $ref: '#/components/parameters/service_plan_id'
      - $ref: '#/components/parameters/inbound_id'
    get:
      tags:
        - Inbounds
      summary: Retrieve inbound message
      description: >-
        This operation retrieves a specific inbound message using the provided
        inbound ID.
      operationId: RetrieveInboundMessage
      responses:
        '200':
          description: >-
            OK. A successful response , or an
            [Error](https://developers.sinch.com/docs/sms/api-reference/status-codes).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inbound'
              examples:
                MOTextExample:
                  $ref: '#/components/examples/text_message'
        '404':
          description: Not found. The batch ID is unknown to the system.
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: Java
          source: |
            /**
             * Sinch Java Snippet
             *
             * <p>This snippet is available at https://github.com/sinch/sinch-sdk-java-snippets
             *
             * <p>See https://github.com/sinch/sinch-sdk-java-snippets/blob/main/README.md for details
             */
            package sms.inbounds;

            import com.sinch.sdk.SinchClient;
            import com.sinch.sdk.domains.sms.api.v1.InboundsService;
            import com.sinch.sdk.domains.sms.models.v1.inbounds.InboundMessage;
            import com.sinch.sdk.models.Configuration;
            import com.sinch.sdk.models.SMSRegion;
            import java.util.logging.Logger;
            import utils.Settings;

            public class Get {

              private static final Logger LOGGER = Logger.getLogger(Get.class.getName());

              public static void main(String[] args) {

                String projectId = Settings.getProjectId().orElse("MY_PROJECT_ID");
                String keyId = Settings.getKeyId().orElse("MY_KEY_ID");
                String keySecret = Settings.getKeySecret().orElse("MY_KEY_SECRET");
                String smsRegion = Settings.getSMSRegion().orElse("MY_SMS_REGION");

                // The ID of the inbound message to retrieve
                String inboundId = "INBOUND_ID";

                Configuration configuration =
                    Configuration.builder()
                        .setProjectId(projectId)
                        .setKeyId(keyId)
                        .setKeySecret(keySecret)
                        .setSmsRegion(SMSRegion.from(smsRegion))
                        .build();

                SinchClient client = new SinchClient(configuration);

                InboundsService inboundsService = client.sms().v1().inbounds();

                LOGGER.info(String.format("Get inbound message with ID '%s'", inboundId));

                InboundMessage response = inboundsService.get(inboundId);

                LOGGER.info("Response: " + response);
              }
            }
  /xms/v1/{service_plan_id}/groups/{group_id}/members:
    parameters:
      - $ref: '#/components/parameters/service_plan_id'
      - $ref: '#/components/parameters/group_id'
    get:
      tags:
        - Groups
      summary: Get phone numbers for a group
      description: >-
        This operation retrieves the members of the group with the provided
        group ID.
      operationId: GetMembers
      responses:
        '200':
          description: >-
            A successful response, or an
            [Error](https://developers.sinch.com/docs/sms/api-reference/status-codes).
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/msisdn'
        '404':
          description: Not found. The group ID is unknown to the system.
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: Java
          source: |
            /**
             * Sinch Java Snippet
             *
             * <p>This snippet is available at https://github.com/sinch/sinch-sdk-java-snippets
             *
             * <p>See https://github.com/sinch/sinch-sdk-java-snippets/blob/main/README.md for details
             */
            package sms.groups;

            import com.sinch.sdk.SinchClient;
            import com.sinch.sdk.domains.sms.api.v1.GroupsService;
            import com.sinch.sdk.models.Configuration;
            import com.sinch.sdk.models.SMSRegion;
            import java.util.Collection;
            import java.util.logging.Logger;
            import utils.Settings;

            public class ListMembers {

              private static final Logger LOGGER = Logger.getLogger(ListMembers.class.getName());

              public static void main(String[] args) {

                String projectId = Settings.getProjectId().orElse("MY_PROJECT_ID");
                String keyId = Settings.getKeyId().orElse("MY_KEY_ID");
                String keySecret = Settings.getKeySecret().orElse("MY_KEY_SECRET");
                String smsRegion = Settings.getSMSRegion().orElse("MY_SMS_REGION");

                // The ID of the group to retrieve members from
                String groupId = "GROUP_ID";

                Configuration configuration =
                    Configuration.builder()
                        .setProjectId(projectId)
                        .setKeyId(keyId)
                        .setKeySecret(keySecret)
                        .setSmsRegion(SMSRegion.from(smsRegion))
                        .build();

                SinchClient client = new SinchClient(configuration);

                GroupsService groupsService = client.sms().v1().groups();

                LOGGER.info(String.format("List members within group with ID '%s'", groupId));

                Collection<String> response = groupsService.listMembers(groupId);

                LOGGER.info("Response:");
                response.iterator().forEachRemaining(f -> LOGGER.info(f.toString()));
              }
            }
  /xms/v1/{service_plan_id}/delivery_reports:
    parameters:
      - $ref: '#/components/parameters/service_plan_id'
    get:
      tags:
        - Delivery reports
      summary: Retrieve a list of delivery reports
      description: |-
        Get a list of finished delivery reports.

        This operation supports pagination.
      operationId: getDeliveryReports
      parameters:
        - $ref: '#/components/parameters/page'
        - name: page_size
          in: query
          description: Determines the size of a page.
          required: false
          schema:
            type: integer
            default: 30
            maximum: 100
            minimum: 1
          example: 50
        - name: start_date
          in: query
          description: |-
            Only list messages received at or after this date/time.
            Default: 24h ago
          required: false
          schema:
            type: string
            format: date-time
        - name: end_date
          in: query
          description: Only list messages received before this date/time.
          required: false
          schema:
            type: string
            format: date-time
          example: '2022-10-02 09:34:18.542000+00:00'
        - name: status
          in: query
          description: Comma separated list of delivery report statuses to include.
          required: false
          explode: false
          schema:
            type: array
            items:
              $ref: '#/components/schemas/DeliveryStatus'
          example:
            - Queued
            - Dispatched
            - Delivered
        - name: code
          in: query
          description: Comma separated list of delivery receipt error codes to include.
          style: form
          explode: false
          schema:
            type: array
            items:
              $ref: '#/components/schemas/DeliveryReceiptStatusCode'
          example:
            - 400
            - 405
        - name: client_reference
          in: query
          description: Client reference to include
          required: false
          schema:
            type: string
            maxLength: 2048
            minLength: 0
          example: myReference
      responses:
        '200':
          description: >-
            A successful response , or an
            [Error](https://developers.sinch.com/docs/sms/api-reference/status-codes).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeliveryReportList'
              examples:
                SmsListDeliveryReports:
                  $ref: '#/components/examples/SmsListDeliveryReports'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponseObj'
              example:
                code: syntax_invalid_parameter_format
                text: Parameter 'page_size' is not a valid integer; value 'zero'.
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: Java
          source: |
            /**
             * Sinch Java Snippet
             *
             * <p>This snippet is available at https://github.com/sinch/sinch-sdk-java-snippets
             *
             * <p>See https://github.com/sinch/sinch-sdk-java-snippets/blob/main/README.md for details
             */
            package sms.deliveryReports;

            import com.sinch.sdk.SinchClient;
            import com.sinch.sdk.domains.sms.api.v1.DeliveryReportsService;
            import com.sinch.sdk.models.Configuration;
            import com.sinch.sdk.models.SMSRegion;
            import java.util.logging.Logger;
            import utils.Settings;

            public class List {

              private static final Logger LOGGER = Logger.getLogger(List.class.getName());

              public static void main(String[] args) {

                String projectId = Settings.getProjectId().orElse("MY_PROJECT_ID");
                String keyId = Settings.getKeyId().orElse("MY_KEY_ID");
                String keySecret = Settings.getKeySecret().orElse("MY_KEY_SECRET");
                String smsRegion = Settings.getSMSRegion().orElse("MY_SMS_REGION");

                Configuration configuration =
                    Configuration.builder()
                        .setProjectId(projectId)
                        .setKeyId(keyId)
                        .setKeySecret(keySecret)
                        .setSmsRegion(SMSRegion.from(smsRegion))
                        .build();

                SinchClient client = new SinchClient(configuration);

                DeliveryReportsService deliveryReportsService = client.sms().v1().deliveryReports();

                LOGGER.info("List Delivery Reports");

                LOGGER.info("Response:");
                deliveryReportsService.list().iterator().forEachRemaining(f -> LOGGER.info(f.toString()));
              }
            }
  /xms/v1/{service_plan_id}/batches/{batch_id}/delivery_report:
    parameters:
      - $ref: '#/components/parameters/service_plan_id'
      - $ref: '#/components/parameters/batch_id'
    get:
      tags:
        - Delivery reports
      summary: Retrieve a delivery report
      description: >-
        Delivery reports can be retrieved even if no callback was requested. The
        difference between a summary and a full report is only that the full
        report contains the phone numbers in
        [E.164](https://community.sinch.com/t5/Glossary/E-164/ta-p/7537) format
        for each status code.
      operationId: GetDeliveryReportByBatchId
      parameters:
        - name: type
          in: query
          description: >-
            The type of delivery report.


            - A `summary` will count the number of messages sent per status. 

            - A `full` report give that of a `summary` report but in addition,
            lists phone numbers.
          required: false
          schema:
            $ref: '#/components/schemas/QueryReportType'
            default: summary
        - name: status
          in: query
          description: Comma separated list of delivery_report_statuses to include
          required: false
          explode: false
          schema:
            type: array
            items:
              $ref: '#/components/schemas/DeliveryStatus'
          example:
            - Queued
            - Dispatched
            - Delivered
        - name: code
          in: query
          description: Comma separated list of delivery_receipt_error_codes to include
          required: false
          explode: false
          schema:
            type: array
            items:
              $ref: '#/components/schemas/DeliveryReceiptStatusCode'
          example:
            - 400
            - 405
      responses:
        '200':
          description: >-
            A successful response, or an
            [Error](https://developers.sinch.com/docs/sms/api-reference/status-codes).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchDeliveryReport'
              examples:
                Delivery Report:
                  $ref: '#/components/examples/SmsDeliveryReport'
                Mms Delivery Report:
                  $ref: '#/components/examples/MmsDeliveryReport'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponseObj'
              example:
                code: syntax_invalid_parameter_format
                text: '''bla'' is not a valid status'
        '404':
          description: Not found. The batch ID is unknown to the system.
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: Java
          source: >
            /**
             * Sinch Java Snippet
             *
             * <p>This snippet is available at https://github.com/sinch/sinch-sdk-java-snippets
             *
             * <p>See https://github.com/sinch/sinch-sdk-java-snippets/blob/main/README.md for details
             */
            package sms.deliveryReports;


            import com.sinch.sdk.SinchClient;

            import com.sinch.sdk.domains.sms.api.v1.DeliveryReportsService;

            import
            com.sinch.sdk.domains.sms.models.v1.deliveryreports.BatchDeliveryReport;

            import com.sinch.sdk.models.Configuration;

            import com.sinch.sdk.models.SMSRegion;

            import java.util.logging.Logger;

            import utils.Settings;


            public class Get {

              private static final Logger LOGGER = Logger.getLogger(Get.class.getName());

              public static void main(String[] args) {

                String projectId = Settings.getProjectId().orElse("MY_PROJECT_ID");
                String keyId = Settings.getKeyId().orElse("MY_KEY_ID");
                String keySecret = Settings.getKeySecret().orElse("MY_KEY_SECRET");
                String smsRegion = Settings.getSMSRegion().orElse("MY_SMS_REGION");

                // The ID of the SMS batch to retrieve the delivery report for
                String batchId = "BATCH_ID";

                Configuration configuration =
                    Configuration.builder()
                        .setProjectId(projectId)
                        .setKeyId(keyId)
                        .setKeySecret(keySecret)
                        .setSmsRegion(SMSRegion.from(smsRegion))
                        .build();

                SinchClient client = new SinchClient(configuration);

                DeliveryReportsService deliveryReportsService = client.sms().v1().deliveryReports();

                LOGGER.info(String.format("Get delivery report for batch with ID '%s'", batchId));

                BatchDeliveryReport response = deliveryReportsService.get(batchId);

                LOGGER.info("Response: " + response);
              }
            }
  /xms/v1/{service_plan_id}/batches/{batch_id}/delivery_report/{recipient_msisdn}:
    parameters:
      - $ref: '#/components/parameters/service_plan_id'
      - $ref: '#/components/parameters/batch_id'
      - $ref: '#/components/parameters/recipient_msisdn'
    get:
      tags:
        - Delivery reports
      summary: Retrieve a recipient delivery report
      description: >-
        A recipient delivery report contains the message status for a single
        recipient phone number.
      operationId: GetDeliveryReportByPhoneNumber
      responses:
        '200':
          description: >-
            A successful response, or an
            [Error](https://developers.sinch.com/docs/sms/api-reference/status-codes).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecipientDeliveryReport'
              examples:
                Delivery Report:
                  $ref: '#/components/examples/SmsRecipientDeliveryReport'
                Mms Delivery Report:
                  $ref: '#/components/examples/MmsRecipientDeliveryReport'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponseObj'
              example:
                code: syntax_invalid_parameter_format
                text: '''abc'' is not a valid msisdn'
        '404':
          description: Not found. The batch ID or msisdn is unknown to the system.
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: Java
          source: >
            /**
             * Sinch Java Snippet
             *
             * <p>This snippet is available at https://github.com/sinch/sinch-sdk-java-snippets
             *
             * <p>See https://github.com/sinch/sinch-sdk-java-snippets/blob/main/README.md for details
             */
            package sms.deliveryReports;


            import com.sinch.sdk.SinchClient;

            import com.sinch.sdk.domains.sms.api.v1.DeliveryReportsService;

            import
            com.sinch.sdk.domains.sms.models.v1.deliveryreports.RecipientDeliveryReport;

            import com.sinch.sdk.models.Configuration;

            import com.sinch.sdk.models.SMSRegion;

            import java.util.logging.Logger;

            import utils.Settings;


            public class GetForNumber {

              private static final Logger LOGGER = Logger.getLogger(Get.class.getName());

              public static void main(String[] args) {

                String projectId = Settings.getProjectId().orElse("MY_PROJECT_ID");
                String keyId = Settings.getKeyId().orElse("MY_KEY_ID");
                String keySecret = Settings.getKeySecret().orElse("MY_KEY_SECRET");
                String smsRegion = Settings.getSMSRegion().orElse("MY_SMS_REGION");

                // The ID of the SMS batch to retrieve the delivery report for
                String batchId = "BATCH_ID";
                // The phone number to retrieve the delivery report for
                String phoneNumber = "RECIPIENT_PHONE_NUMBER";

                Configuration configuration =
                    Configuration.builder()
                        .setProjectId(projectId)
                        .setKeyId(keyId)
                        .setKeySecret(keySecret)
                        .setSmsRegion(SMSRegion.from(smsRegion))
                        .build();

                SinchClient client = new SinchClient(configuration);

                DeliveryReportsService deliveryReportsService = client.sms().v1().deliveryReports();

                LOGGER.info(String.format("Get delivery report for number '%s'", phoneNumber));

                RecipientDeliveryReport response = deliveryReportsService.getForNumber(batchId, phoneNumber);

                LOGGER.info("Response :" + response);
              }
            }
components:
  schemas:
    errorResponseObj:
      type: object
      properties:
        code:
          type: string
          description: >-
            The error code. See [error
            codes](https://developers.sinch.com/docs/sms/api-reference/status-codes/).
        text:
          type: string
          description: The human readable description of the error.
    parameterObj:
      type: object
      additionalProperties:
        type: object
        additionalProperties:
          type: string
          description: >-
            The key is the recipient's MSISDN that should have the
            `parameter_key` replaced with the value.


            If key is `default`, then specified value is used as the fall-back
            value for omitted recipient phone numbers
            [MSISDNs](https://community.sinch.com/t5/Glossary/MSISDN/ta-p/7628).
          maxLength: 1600
        description: |-
          The name of the parameter that will be replaced in the message body. 

          Letters A-Z and a-z, digits 0-9 and .-_ allowed.
      propertyNames:
        description: >-
          They key if name of the parameter (`parameter_key`) present within
          body to be customized
        pattern: ^[A-Za-z0-9_\-.]+$
        type: string
        maxLength: 16
        minLength: 1
      description: >-
        Contains the parameters that will be used for customizing the message
        for each recipient. 


        [Click here to learn more about
        parameterization](/docs/sms/resources/message-info/message-parameterization).
    addKeyword:
      description: Keyword to be sent in MO to add MSISDN to a group
      properties:
        first_word:
          type: string
          description: >-
            Opt-in keyword like "JOIN" if _auto_update.to_ is dedicated
            long/short number or unique brand keyword like "Sinch" if it is a
            shared short code.
          example: Sinch
          maxLength: 15
          minLength: 1
          pattern: ^\w+$
        second_word:
          type: string
          description: Opt-in keyword like "JOIN" if _auto_update.to_ is shared short code.
          example: JOIN
          maxLength: 15
          minLength: 1
          pattern: ^\w+$
      required:
        - first_word
    removeKeyword:
      description: Keyword to be sent in MO to remove MSISDN to a group
      example:
        first_word: LEAVE
      properties:
        first_word:
          type: string
          description: >-
            Opt-out keyword like "LEAVE" if _auto_update.to_ is dedicated
            long/short number or unique brand keyword like "Sinch" if it is a
            shared short code.
          example: LEAVE
          maxLength: 15
          minLength: 1
          pattern: ^\w+$
        second_word:
          type: string
          description: >-
            Opt-out keyword like "LEAVE" if _auto_update.to_ is shared short
            code.
          maxLength: 15
          minLength: 1
          pattern: ^\w+$
      required:
        - first_word
    addFromGroupId:
      type: string
      description: >-
        One time copy of all members from the group referenced by the group ID
        into this group.
      example: 01FC66621VHDBN119Z8PMV1QPU
    removeFromGroupId:
      type: string
      description: >-
        Remove all members from this group that are currently in the group
        referenced by the group ID.
      example: 01FC66621VHDBN119Z8PMV1AHY
    ApiGroupAutoUpdate:
      type: object
      properties:
        to:
          type: string
          format: E.164
          description: >-
            Short code or long number addressed in
            [MO](https://community.sinch.com/t5/Glossary/MO-Mobile-Originated/ta-p/7618).


            Constraints:


            Must be valid phone number or short code which has been
            **provisioned by your account manager**.
          example: '+15551231234'
        add:
          $ref: '#/components/schemas/addKeyword'
        remove:
          $ref: '#/components/schemas/removeKeyword'
      required:
        - to
    ApiGroupRequest:
      type: object
      allOf:
        - $ref: '#/components/schemas/ApiGroup'
        - type: object
          properties:
            members:
              type: array
              description: >-
                Initial list of phone numbers in [E.164
                format](https://community.sinch.com/t5/Glossary/E-164/ta-p/7537)
                [MSISDNs](https://community.sinch.com/t5/Glossary/MSISDN/ta-p/7628)
                for the group.
              format: E.164
              example:
                - '+15551231234'
                - '+15551256344'
              items:
                type: string
                format: E.164
                maxLength: 10000
                minLength: 0
                example: '["+15551231234","+15551256344"]'
                description: >-
                  Initial list of phone numbers in [E.164
                  format](https://community.sinch.com/t5/Glossary/E-164/ta-p/7537)
                  [MSISDNs](https://community.sinch.com/t5/Glossary/MSISDN/ta-p/7628)
                  for the group.
              maxItems: 10000
              minItems: 0
              uniqueItems: true
    ApiGroup:
      type: object
      properties:
        id:
          type: string
          description: The ID used to reference this group.
          example: 01FC66621VHDBN119Z8PMV1QPQ
          readOnly: true
        name:
          type: string
          description: Name of group if set.
          maxLength: 20
          minLength: 1
          example: My new customers
        size:
          type: integer
          format: int32
          description: The number of members currently in the group.
          example: 2
          readOnly: true
        created_at:
          type: string
          format: date-time
          description: 'Timestamp for group creation. Format: YYYY-MM-DDThh:mm:ss.SSSZ'
          readOnly: true
        modified_at:
          type: string
          format: date-time
          description: >-
            Timestamp for when the group was last updated. Format:
            YYYY-MM-DDThh:mm:ss.SSSZ
          readOnly: true
        child_groups:
          type: array
          description: >-
            Phone numbers
            [MSIDNs](https://community.sinch.com/t5/Glossary/MSISDN/ta-p/7628)
            of child group will be included in this group. If present then this
            group will be auto populated.


            Constraints: Elements must be group IDs.
          items:
            $ref: '#/components/schemas/MtGroupId'
          maxItems: 10
          minItems: 0
          uniqueItems: true
        auto_update:
          $ref: '#/components/schemas/ApiGroupAutoUpdate'
    Binary:
      type: object
      properties:
        to:
          type: array
          description: >-
            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).
          format: E.164
          example:
            - '+15551231234'
            - '+15551256344'
          items:
            $ref: '#/components/schemas/MtDestination'
          maxItems: 1000
          minItems: 1
        from:
          type: string
          description: >-
            Sender number. Must be valid phone number, short code or
            alphanumeric. Required if Automatic Default Originator not
            configured.
          example: '+15551231234'
        body:
          type: string
          description: |-
            The message content Base64 encoded. 

            Max 140 bytes including `udh`.
        udh:
          type: string
          description: >-
            The UDH header of a binary message HEX encoded. Max 140 bytes
            including the `body`.
        type:
          type: string
          description: >-
            SMS in
            [binary](https://community.sinch.com/t5/Glossary/Binary-SMS/ta-p/7470)
            format.
          enum:
            - mt_binary
          x-enumDescriptions:
            mt_binary: >-
              SMS in
              [binary](https://community.sinch.com/t5/Glossary/Binary-SMS/ta-p/7470)
              format.
        delivery_report:
          $ref: '#/components/schemas/DeliveryReportType'
        send_at:
          type: string
          description: >-
            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`.
          format: date-time
          example: '2024-08-07T12:34:56.789Z'
        expire_at:
          type: string
          description: >-
            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`.
          format: date-time
        callback_url:
          type: string
          description: >-
            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).
          maxLength: 2048
          minLength: 0
        client_reference:
          type: string
          description: >-
            The client identifier of a batch message. If set, the identifier
            will be added in the delivery report/callback of this batch.
          maxLength: 2048
          minLength: 0
        feedback_enabled:
          type: boolean
          default: false
          description: >-
            If set to true then
            [feedback](/docs/sms/api-reference/sms/batches/deliveryfeedback) is
            expected after successful delivery.
        from_ton:
          type: integer
          format: int32
          description: >-
            The type of number for the sender number. Use to override the
            automatic detection.
          maximum: 6
          minimum: 0
        from_npi:
          type: integer
          format: int32
          description: >-
            Number Plan Indicator for the sender number. Use to override the
            automatic detection.
          maximum: 18
          minimum: 0
      required:
        - body
        - to
        - udh
      title: Binary
    Media:
      type: object
      description: >-
        Only available in the US. Contact your account manager if you wish to
        send MMS.
      properties:
        to:
          type: array
          format: E.164
          description: >-
            List of Phone numbers and group IDs that will receive the batch.
            [More
            info](https://community.sinch.com/t5/Glossary/MSISDN/ta-p/7628)
          example:
            - '+15551231234'
            - '+15551256344'
          items:
            $ref: '#/components/schemas/MtDestination'
          maxItems: 1000
          minItems: 1
        from:
          type: string
          description: >-
            Sender number. Must be valid phone number, short code or
            alphanumeric. Required if Automatic Default Originator not
            configured.
          example: '+15551231234'
        body:
          $ref: '#/components/schemas/MediaBody'
        parameters:
          $ref: '#/components/schemas/parameterObj'
        type:
          type: string
          description: MMS
          enum:
            - mt_media
          x-enumDescriptions:
            mt_media: MMS
        delivery_report:
          $ref: '#/components/schemas/DeliveryReportType'
        send_at:
          type: string
          format: date-time
          description: >
            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:
          type: string
          format: date-time
          description: >
            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:
          type: string
          description: Override the default callback URL for this batch. Must be valid URL.
          maxLength: 2048
          minLength: 0
        client_reference:
          type: string
          description: >-
            The client identifier of a batch message. If set, the identifier
            will be added in the delivery report/callback of this batch
          maxLength: 2048
          minLength: 0
        feedback_enabled:
          type: boolean
          default: false
          description: >-
            If set to `true`, then
            [feedback](/docs/sms/api-reference/sms/batches/deliveryfeedback) is
            expected after successful delivery.
        strict_validation:
          type: boolean
          description: >
            Whether or not you want the media included in your message to be
            checked against [Sinch MMS channel best
            practices](/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.
          default: false
      required:
        - body
        - to
      title: Media
    MediaBody:
      type: object
      description: The message content, including a URL to the media file
      properties:
        subject:
          type: string
          description: The subject text
          example: Media message from Sinch!
          maxLength: 80
          minLength: 0
        message:
          type: string
          description: >-
            The message text. Text only media messages will be rejected, please
            use SMS instead.
          example: Your text message.
          maxLength: 2000
          minLength: 0
        url:
          type: string
          description: URL to the media file
          example: >-
            https://en.wikipedia.org/wiki/Sinch_(company)#/media/File:Sinch_LockUp_RGB.png
          maxLength: 2048
          minLength: 0
      required:
        - url
    Text:
      type: object
      properties:
        to:
          maxItems: 1000
          minItems: 1
          type: array
          description: >-
            List of Phone numbers and group IDs that will receive the batch.
            [More
            info](https://community.sinch.com/t5/Glossary/MSISDN/ta-p/7628)
          format: E.164
          example:
            - '+15551231234'
            - '+15551256344'
          items:
            $ref: '#/components/schemas/MtDestination'
        from:
          type: string
          description: >-
            Sender number. Must be valid phone number, short code or
            alphanumeric. Required if Automatic Default Originator not
            configured.
          example: '+15551231234'
        parameters:
          $ref: '#/components/schemas/parameterObj'
        body:
          type: string
          description: The message content
          example: Hi ${name}! How are you?
          maxLength: 2000
          minLength: 0
        type:
          type: string
          description: Regular SMS
          enum:
            - mt_text
          x-enumDescriptions:
            mt_text: Regular SMS
        delivery_report:
          $ref: '#/components/schemas/DeliveryReportType'
        send_at:
          type: string
          format: date-time
          description: >-
            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`.
          example: '2024-08-07T12:34:56.789Z'
        expire_at:
          type: string
          format: date-time
          description: >-
            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:
          type: string
          description: >-
            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).
          maxLength: 2048
          minLength: 0
        client_reference:
          type: string
          description: >-
            The client identifier of a batch message. If set, the identifier
            will be added in the delivery report/callback of this batch
          maxLength: 2048
          minLength: 0
        feedback_enabled:
          type: boolean
          default: false
          description: >-
            If set to `true`, then
            [feedback](/docs/sms/api-reference/sms/batches/deliveryfeedback) is
            expected after successful delivery.
        flash_message:
          type: boolean
          default: false
          description: >-
            Shows message on screen without user interaction while not saving
            the message to the inbox.
        max_number_of_message_parts:
          type: integer
          format: int32
          description: >-
            Message will be dispatched only if it is not split to more parts
            than Max Number of Message Parts
          minimum: 1
        truncate_concat:
          type: boolean
          description: >-
            If set to `true` the message will be shortened when exceeding one
            part.
        from_ton:
          type: integer
          format: int32
          description: >-
            The type of number for the sender number. Use to override the
            automatic detection.
          maximum: 6
          minimum: 0
        from_npi:
          type: integer
          format: int32
          description: >-
            Number Plan Indicator for the sender number. Use to override the
            automatic detection.
          maximum: 18
          minimum: 0
      required:
        - body
        - to
      title: Text
    ApiGroupUpdate:
      type: object
      properties:
        add:
          type: array
          description: >-
            Add a list of phone numbers (MSISDNs) to this group. The phone
            numbers are a strings within an array and must be in [E.164
            format](https://community.sinch.com/t5/Glossary/E-164/ta-p/7537).
          items:
            type: string
            format: E.164
            maxLength: 10000
            minLength: 0
          maxItems: 10000
          minItems: 0
        remove:
          type: array
          description: >-
            Remove a list of phone numbers (MSISDNs) to this group.The phone
            numbers are a strings within an array and must be in [E.164
            format](https://community.sinch.com/t5/Glossary/E-164/ta-p/7537).
          items:
            type: string
            format: E.164
            maxLength: 10000
            minLength: 0
          maxItems: 10000
          minItems: 0
        name:
          type: string
          description: >-
            The name of the group. Omitting `name` from the JSON body will leave
            the name unchanged. To remove an existing name set, name explicitly
            to the JSON value `null`.
          maxLength: 20
          minLength: 1
        add_from_group:
          $ref: '#/components/schemas/addFromGroupId'
          description: |-
            Copy the members from the another group into this group.

            Constraints:
            Must be valid group ID
        remove_from_group:
          $ref: '#/components/schemas/removeFromGroupId'
          description: |-
            Remove the members in a specified group from this group.

            Constraints:
            Must be valid group ID
        auto_update:
          $ref: '#/components/schemas/ApiGroupAutoUpdate'
    ApiUpdateMtMessage:
      type: object
      properties:
        from:
          type: string
          description: >-
            Sender number. Must be valid phone number, short code or
            alphanumeric.
          example: '+15551231234'
        type:
          type: string
        to_add:
          type: array
          description: List of phone numbers and group IDs to add to the batch.
          items:
            $ref: '#/components/schemas/MtDestination'
          maxItems: 1000
          minItems: 1
        to_remove:
          type: array
          description: List of phone numbers and group IDs to remove from the batch.
          items:
            $ref: '#/components/schemas/MtDestination'
          maxItems: 1000
          minItems: 1
        delivery_report:
          $ref: '#/components/schemas/DeliveryReportType'
        send_at:
          type: string
          format: date-time
          description: >
            If set, in the future the message will be delayed until `send_at`
            occurs. Formatted as
            [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601):
            `YYYY-MM-DDThh:mm:ss.SSSZ`.


            Constraints: Must be before expire_at. If set in the past, messages
            will be sent immediately.
        expire_at:
          type: string
          format: date-time
          description: >
            If set, the system will stop trying to deliver the message at this
            point.


            Constraints: Must be after `send_at`


            Default: 3 days after `send_at`
        callback_url:
          type: string
          description: |
            Override the default callback URL for this batch.

            Constraints: Must be valid URL.
          maxLength: 2048
          minLength: 0
        client_reference:
          type: string
          maxLength: 2048
          minLength: 0
          description: >-
            The client identifier of a batch message. If set, the identifier
            will be added in the delivery report/callback of this batch
        feedback_enabled:
          type: boolean
          description: >-
            If set to `true`, then
            [feedback](/docs/sms/api-reference/sms/batches/deliveryfeedback) is
            expected after successful delivery.
          default: false
    update_binary_message:
      allOf:
        - $ref: '#/components/schemas/ApiUpdateMtMessage'
        - type: object
          properties:
            body:
              type: string
              description: |-
                The message content Base64 encoded. 
                 
                 Max 140 bytes together with udh.
            udh:
              type: string
              description: >-
                The UDH header of a binary message HEX encoded. Max 140 bytes
                together with body.
            type:
              type: string
              description: >-
                SMS in
                [binary](https://community.sinch.com/t5/Glossary/Binary-SMS/ta-p/7470)
                format.
              enum:
                - mt_binary
              x-enumDescriptions:
                mt_binary: >-
                  SMS in
                  [binary](https://community.sinch.com/t5/Glossary/Binary-SMS/ta-p/7470)
                  format.
            from_ton:
              type: integer
              format: int32
              description: >-
                The type of number for the sender number. Use to override the
                automatic detection.
              maximum: 6
              minimum: 0
            from_npi:
              type: integer
              format: int32
              description: >-
                Number Plan Indicator for the sender number. Use to override the
                automatic detection.
              maximum: 18
              minimum: 0
      required:
        - udh
      title: Update binary message
    update_media_message:
      allOf:
        - $ref: '#/components/schemas/ApiUpdateMtMessage'
        - type: object
          properties:
            body:
              $ref: '#/components/schemas/MediaBody'
            parameters:
              $ref: '#/components/schemas/parameterObj'
            type:
              type: string
              description: MMS
              enum:
                - mt_media
              x-enumDescriptions:
                mt_media: MMS
            strict_validation:
              type: boolean
              default: false
              description: >
                Whether or not you want the media included in your message to be
                checked against [Sinch MMS channel best
                practices](/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.
      title: Update media message
    update_text_message:
      allOf:
        - $ref: '#/components/schemas/ApiUpdateMtMessage'
        - type: object
          properties:
            parameters:
              $ref: '#/components/schemas/parameterObj'
            body:
              type: string
              description: The message content
              example: Hi ${name}! How are you?
              maxLength: 2000
              minLength: 0
            type:
              type: string
              description: Regular SMS
              enum:
                - mt_text
              x-enumDescriptions:
                mt_text: Regular SMS
            from_ton:
              type: integer
              format: int32
              description: >-
                The type of number for the sender number. Use to override the
                automatic detection.
              maximum: 6
              minimum: 0
            from_npi:
              type: integer
              format: int32
              description: >-
                Number Plan Indicator for the sender number. Use to override the
                automatic detection.
              maximum: 18
              minimum: 0
            max_number_of_message_parts:
              type: integer
              format: int32
              description: >-
                Message will be dispatched only if it is not split to more parts
                than Max Number of Message Parts
              minimum: 1
            truncate_concat:
              type: boolean
              description: >-
                If set to true the message will be shortened when exceeding one
                part.
            flash_message:
              type: boolean
              default: false
              description: >-
                Shows message on screen without user interaction while not
                saving the message to the inbox.
      title: Update text message
    ApiDeliveryFeedback:
      type: object
      required:
        - recipients
      properties:
        recipients:
          type: array
          description: >-
            A list of phone numbers (MSISDNs) that have successfully received
            the message. The key is required, however, the value can be an empty
            array (`[]`) for *a batch*. If the feedback was enabled for *a
            group*, at least one phone number is required.
          items:
            type: string
            description: List of recipients confirmed to have received their message.
      example:
        recipients:
          - '+15551231234'
          - '+15551256344'
    ApiMtMessageDryRun:
      type: object
      properties:
        number_of_recipients:
          type: integer
          format: int32
          description: The number of recipients in the batch
        number_of_messages:
          type: integer
          format: int32
          description: The total number of SMS message parts to be sent in the batch
        per_recipient:
          type: array
          items:
            $ref: '#/components/schemas/ApiRecipientDryRun'
      required:
        - number_of_messages
        - number_of_recipients
    ApiRecipientDryRun:
      description: >-
        The recipient, the number of message parts to this recipient, the body
        of the message, and the encoding type of each message
      type: object
      properties:
        recipient:
          type: string
          description: |-
            Sender number.
             
             Required if Automatic Default Originator not configured.
          example: '+15551231234'
        body:
          type: string
        number_of_parts:
          type: integer
          format: int32
        encoding:
          type: string
          enum:
            - text
            - unicode
          x-enumDescriptions:
            text: GSM text encoding
            unicode: Unicode text encoding
      required:
        - body
        - encoding
        - number_of_parts
        - recipient
    ApiInboundList:
      type: object
      properties:
        count:
          type: integer
          format: int64
          description: The total number of inbounds matching the given filters
          example: 2
        page:
          type: integer
          format: int32
          description: The requested page.
          example: 0
        inbounds:
          type: array
          description: The page of inbounds matching the given filters.
          items:
            $ref: '#/components/schemas/inbound'
        page_size:
          type: integer
          format: int32
          description: The number of inbounds returned in this request.
          example: 2
    ApiMoMessage:
      type: object
      description: The page of inbounds matching the given filters.
      properties:
        client_reference:
          type: string
          description: >-
            If this inbound message is in response to a previously sent message
            that contained a client reference, then this field contains *that*
            client reference. 


            Utilizing this feature requires additional setup on your account.
            Contact your [account
            manager](https://dashboard.sinch.com/settings/account-details) to
            enable this feature.
        from:
          type: string
          description: >-
            The phone number that sent the message. [More
            info](https://community.sinch.com/t5/Glossary/MSISDN/ta-p/7628)
          example: '+11203494390'
        id:
          type: string
          description: The ID of this inbound message.
          example: 01FC66621XXXXX119Z8PMV1QPA
        operator_id:
          type: string
          description: The MCC/MNC of the sender's operator if known.
          example: '35000'
        received_at:
          type: string
          format: date-time
          description: >-
            When the system received the message. 


            Formatted as [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601):
            `YYYY-MM-DDThh:mm:ss.SSSZ`.
        sent_at:
          type: string
          format: date-time
          description: >-
            When the message left the originating device. Only available if
            provided by operator.


            Formatted as [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601):
            `YYYY-MM-DDThh:mm:ss.SSSZ`.
        to:
          type: string
          description: The Sinch phone number or short code to which the message was sent.
          example: '11203453453'
        type:
          type: string
          readOnly: true
      required:
        - from
        - id
        - received_at
        - to
        - type
    MmsMedia:
      description: Collection of attachments in incoming message.
      type: object
      properties:
        code:
          type: integer
          format: int32
          description: >-
            The result code. Possible values: 0 (success), 1 (content upload
            error), 2 (cloud bucket error), 3 (bucket key error).
        content_type:
          type: string
          description: >-
            Content type of binary. [More
            info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)
          example: image/jpeg
        status:
          type: string
          description: Status of the uploaded media.
          enum:
            - Uploaded
            - Failed
          x-enumDescriptions:
            Uploaded: Upload was successful
            Failed: Upload failure
        url:
          type: string
          description: URL to be used to download attachment.
      required:
        - code
        - content_type
        - status
    MmsMoBody:
      type: object
      description: The message content, including a URL to the media filters.
      properties:
        media:
          type: array
          description: Collection of attachments in incoming message.
          items:
            $ref: '#/components/schemas/MmsMedia'
        message:
          type: string
          description: The text message content of the MMS media message.
        subject:
          type: string
          description: The subject of the MMS media message.
    binary_message:
      allOf:
        - $ref: '#/components/schemas/ApiMoMessage'
        - type: object
          properties:
            body:
              type: string
              description: |
                The message content Base64 encoded. 

                Max 140 bytes together with udh.
            type:
              type: string
              description: >-
                SMS in
                [binary](https://community.sinch.com/t5/Glossary/Binary-SMS/ta-p/7470)
                format.
              enum:
                - mo_binary
              x-enumDescriptions:
                mo_binary: >-
                  SMS in
                  [binary](https://community.sinch.com/t5/Glossary/Binary-SMS/ta-p/7470)
                  format.
              readOnly: true
            udh:
              type: string
              description: >-
                The UDH header of a binary message HEX encoded. Max 140 bytes
                together with body.
      required:
        - body
        - from
        - id
        - received_at
        - to
        - udh
      title: Binary MO
    media_message:
      allOf:
        - $ref: '#/components/schemas/ApiMoMessage'
        - type: object
          properties:
            body:
              $ref: '#/components/schemas/MmsMoBody'
            type:
              type: string
              description: MMS
              enum:
                - mo_media
              x-enumDescriptions:
                mo_media: MMS
              readOnly: true
      required:
        - body
        - from
        - id
        - received_at
        - to
      title: Media MO
    text_message:
      allOf:
        - $ref: '#/components/schemas/ApiMoMessage'
        - type: object
          properties:
            body:
              type: string
              maxLength: 2000
              minLength: 0
            type:
              type: string
              description: Regular SMS
              enum:
                - mo_text
              x-enumDescriptions:
                mo_text: Regular SMS
              readOnly: true
      required:
        - body
        - from
        - id
        - received_at
        - to
      title: Text MO
    ApiGroupList:
      type: object
      properties:
        count:
          type: integer
          description: The total number of groups.
          example: 2
        page:
          type: integer
          format: int32
          description: The requested page.
          example: 0
        groups:
          type: array
          items:
            $ref: '#/components/schemas/ApiGroup'
        page_size:
          type: integer
          format: int32
          description: The number of groups returned in this request
          example: 2
    DeliveryReportList:
      type: object
      properties:
        count:
          type: integer
          description: The total number of entries matching the given filters.
          format: int64
          example: 2
        page:
          type: integer
          format: int32
          description: The requested page.
          example: 0
        page_size:
          type: integer
          format: int32
          description: The number of entries returned in this request.
          example: 2
        delivery_reports:
          type: array
          description: The page of delivery reports matching the given filters.
          items:
            $ref: '#/components/schemas/RecipientDeliveryReport'
    RecipientDeliveryReport:
      type: object
      properties:
        applied_originator:
          type: string
          description: >-
            The default originator used for the recipient this delivery report
            belongs to, if default originator pool configured and no originator
            set when submitting batch.
        at:
          type: string
          format: date-time
          description: >-
            A timestamp of when the Delivery Report was created in the Sinch
            service. Formatted as
            [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601):
            `YYYY-MM-DDThh:mm:ss.SSSZ`.
        batch_id:
          type: string
          description: The ID of the batch this delivery report belongs to
          example: 01FC66621XXXXX119Z8PMV1QPQ
          readOnly: true
        client_reference:
          type: string
          description: >-
            The client identifier of the batch this delivery report belongs to,
            if set when submitting batch.
        code:
          $ref: '#/components/schemas/DeliveryReceiptStatusCode'
          description: >-
            The detailed [status
            code](https://developers.sinch.com/docs/sms/api-reference/sms/delivery-reports/delivery-report-error-codes).
        encoding:
          type: string
          description: >-
            Applied encoding for message. Present only if smart encoding is
            enabled.
          enum:
            - GSM
            - UNICODE
          example: GSM
          x-enumDescriptions:
            GSM: GSM encoding.
            UNICODE: Unicode encoding.
        number_of_message_parts:
          type: integer
          format: int32
          description: >-
            The number of parts the message was split into. Present only if
            `max_number_of_message_parts` parameter was set.
          example: 1
        operator:
          type: string
          description: >-
            The operator that was used for delivering the message to this
            recipient, if enabled on the account by Sinch.
          example: '35000'
        operator_status_at:
          type: string
          format: date-time
          description: >-
            A timestamp extracted from the Delivery Receipt from the originating
            SMSC. Formatted as
            [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601):
            `YYYY-MM-DDThh:mm:ss.SSSZ`.
        recipient:
          type: string
          description: Phone number that was queried.
          example: '15551231234'
        status:
          $ref: '#/components/schemas/DeliveryStatus'
        type:
          type: string
          description: The recipient delivery report type.
          enum:
            - recipient_delivery_report_sms
            - recipient_delivery_report_mms
          x-enumDescriptions:
            recipient_delivery_report_sms: An SMS recipient delivery report.
            recipient_delivery_report_mms: An MMS recipient delivery report.
      required:
        - at
        - batch_id
        - code
        - recipient
        - status
        - type
      title: Recipient delivery report
    ApiBatchList:
      properties:
        count:
          type: integer
          format: int64
          description: The total number of entries matching the given filters.
          example: 12
        page:
          type: integer
          format: int32
          description: The requested page.
          example: 0
        batches:
          type: array
          description: The page of batches matching the given filters.
          items:
            $ref: '#/components/schemas/Batch'
        page_size:
          type: integer
          format: int32
          description: The number of entries returned in this request.
          example: 30
    BatchDeliveryReport:
      type: object
      properties:
        batch_id:
          type: string
          description: The ID of the batch this delivery report belongs to.
          example: 01FC66621XXXXX119Z8PMV1QPQ
          readOnly: true
        client_reference:
          type: string
          description: >-
            The client identifier of the batch this delivery report belongs to,
            if set when submitting batch.
        statuses:
          type: array
          description: >-
            Array with status objects. Only status codes with at least one
            recipient will be listed.
          items:
            $ref: '#/components/schemas/MessageDeliveryStatus'
        total_message_count:
          type: integer
          format: int32
          description: The total number of messages in the batch.
          example: 2
          minimum: 0
        type:
          type: string
          description: The delivery report type.
          enum:
            - delivery_report_sms
            - delivery_report_mms
          x-enumDescriptions:
            delivery_report_sms: An SMS delivery report.
            delivery_report_mms: An MMS delivery report.
      required:
        - batch_id
        - statuses
        - total_message_count
        - type
      title: Delivery report
    MessageDeliveryStatus:
      type: object
      description: >-
        Array with status objects. Only status codes with at least one recipient
        will be listed.
      properties:
        code:
          $ref: '#/components/schemas/DeliveryReceiptStatusCode'
          description: >-
            The detailed [status
            code](/docs/sms/api-reference/sms/delivery-reports/delivery-report-error-codes).
        count:
          type: integer
          format: int32
          description: The number of messages that currently has this code.
          example: 2
          minimum: 1
        recipients:
          type: array
          description: >-
            Only for `full` report. A list of the phone number recipients which
            messages has this status code.
          example:
            - '15551231234'
            - '15551256344'
          items:
            type: string
            description: >-
              Only for `full` report. A list of the phone number recipients
              which messages has this status code.
            example: '["15551231234","15551256344"]'
          uniqueItems: true
        status:
          $ref: '#/components/schemas/DeliveryStatus'
      required:
        - code
        - count
        - status
    MtDestination:
      type: string
      description: |-
        List of phone numbers and group IDs that will receive the batch.

        [More info](https://community.sinch.com/t5/Glossary/MSISDN/ta-p/7628).
      format: E.164
      examples:
        - '+15551231234'
        - '+15551256344'
    TextResponse:
      type: object
      required:
        - type
      properties:
        id:
          type: string
          description: Unique identifier for batch
          readOnly: true
          example: 01FC66621XXXXX119Z8PMV1QPQ
        to:
          maxItems: 1000
          minItems: 1
          type: array
          description: >-
            List of Phone numbers and group IDs that will receive the batch.
            [More
            info](https://community.sinch.com/t5/Glossary/MSISDN/ta-p/7628)
          format: E.164
          example:
            - '+15551231234'
            - '+15551256344'
          items:
            $ref: '#/components/schemas/MtDestination'
        from:
          type: string
          description: >-
            Sender number. Must be valid phone number, short code or
            alphanumeric. Required if Automatic Default Originator not
            configured.
          example: '+15551231234'
        canceled:
          type: boolean
          description: Indicates if the batch has been canceled or not.
          readOnly: true
          default: false
        parameters:
          $ref: '#/components/schemas/parameterObj'
        body:
          maxLength: 2000
          minLength: 0
          type: string
          description: The message content
          example: Hi ${name}! How are you?
        type:
          type: string
          description: Regular SMS
          x-enumDescriptions:
            mt_text: Regular SMS
          enum:
            - mt_text
          readOnly: true
        created_at:
          type: string
          description: >-
            Timestamp for when batch was created. Formatted as
            [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601):`YYYY-MM-DDThh:mm:ss.SSSZ`.
          format: date-time
          readOnly: true
        modified_at:
          type: string
          description: >-
            Timestamp for when batch was last updated. Formatted as
            [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601):`YYYY-MM-DDThh:mm:ss.SSSZ`.
          format: date-time
          readOnly: true
        delivery_report:
          $ref: '#/components/schemas/DeliveryReportType'
        send_at:
          type: string
          description: >-
            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`.
          format: date-time
        expire_at:
          type: string
          description: >-
            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`.
          format: date-time
        callback_url:
          maxLength: 2048
          minLength: 0
          type: string
          description: Override the default callback URL for this batch. Must be valid URL.
        client_reference:
          maxLength: 2048
          minLength: 0
          type: string
          description: >-
            The client identifier of a batch message. If set, the identifier
            will be added in the delivery report/callback of this batch
          example: myReference
        feedback_enabled:
          type: boolean
          description: >-
            If set to `true`, then
            [feedback](/docs/sms/api-reference/sms/batches/deliveryfeedback) is
            expected after successful delivery.
          default: false
        flash_message:
          type: boolean
          description: >-
            Shows message on screen without user interaction while not saving
            the message to the inbox.
          default: false
        truncate_concat:
          type: boolean
          description: >-
            If set to `true` the message will be shortened when exceeding one
            part.
        max_number_of_message_parts:
          minimum: 1
          type: integer
          description: >-
            Message will be dispatched only if it is not split to more parts
            than Max Number of Message Parts
          format: int32
        from_ton:
          maximum: 6
          minimum: 0
          type: integer
          description: >-
            The type of number for the sender number. Use to override the
            automatic detection.
          format: int32
        from_npi:
          maximum: 18
          minimum: 0
          type: integer
          description: >-
            Number Plan Indicator for the sender number. Use to override the
            automatic detection.
          format: int32
    MtGroupId:
      type: string
      description: >-
        MSISDNs of child group will be included in this group. If present then
        this group will be auto populated.
         
         Constraints: Elements must be group IDs.
      example: 01FC66621VHDBN119Z8PMV1AHY
    msisdn:
      type: string
      format: E.164
      description: >-
        A phone number in [E.164
        format](https://community.sinch.com/t5/Glossary/E-164/ta-p/7537).
      example: '+453234457784'
    BinaryResponse:
      type: object
      required:
        - type
      properties:
        id:
          type: string
          description: Unique identifier for batch.
          readOnly: true
          example: 01FC66621XXXXX119Z8PMV1QPQ
        to:
          maxItems: 1000
          minItems: 1
          type: array
          description: >-
            A list of phone numbers and group IDs that have received the batch.
            [More
            info](https://community.sinch.com/t5/Glossary/MSISDN/ta-p/7628).
          format: E.164
          example:
            - '+15551231234'
            - '+15551256344'
          items:
            $ref: '#/components/schemas/MtDestination'
        from:
          type: string
          description: |-
            The sender number provided.

            Required if the Automatic Default Originator is not configured.
          example: '+15551231234'
        canceled:
          type: boolean
          description: Indicates whether or not the batch has been canceled.
          readOnly: true
          default: false
        body:
          type: string
          description: 'The message content provided. Base64 encoded. '
        udh:
          type: string
          description: >-
            The
            [UDH](https://community.sinch.com/t5/Glossary/UDH-User-Data-Header/ta-p/7776)
            header of a binary message HEX encoded. Max 140 bytes including the
            `body`.
        type:
          type: string
          description: >-
            SMS in
            [binary](https://community.sinch.com/t5/Glossary/Binary-SMS/ta-p/7470)
            format.
          x-enumDescriptions:
            mt_binary: >-
              SMS in
              [binary](https://community.sinch.com/t5/Glossary/Binary-SMS/ta-p/7470)
              format.
          enum:
            - mt_binary
        created_at:
          type: string
          description: >-
            Timestamp for when batch was created. 


            Formatted as [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601). For
            example: `YYYY-MM-DDThh:mm:ss.SSSZ`.
          format: date-time
          readOnly: true
        modified_at:
          type: string
          description: >-
            Timestamp for when batch was last updated. 


            Formatted as [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601). For
            example: `YYYY-MM-DDThh:mm:ss.SSSZ`.
          format: date-time
          readOnly: true
        delivery_report:
          type: string
          description: >-
            The delivery report callback option selected. Will be either `none`,
            `summary`, `full`, `per_recipient`, or `per_recipient_final`.
          $ref: '#/components/schemas/DeliveryReportType'
        send_at:
          type: string
          description: >-
            If set, the date and time the message should be delivered. Formatted
            as [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601). For example:
            `YYYY-MM-DDThh:mm:ss.SSSZ`.
          format: date-time
        expire_at:
          type: string
          description: >-
            If set, the date and time the message will expire. Formatted as
            [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601). For example:
            `YYYY-MM-DDThh:mm:ss.SSSZ`.
          format: date-time
        callback_url:
          maxLength: 2048
          minLength: 0
          type: string
          description: The callback URL provided in the request.
        client_reference:
          maxLength: 2048
          minLength: 0
          type: string
          description: >-
            The string input to identify this batch message. If set, the
            identifier will be added in the delivery report/callback of this
            batch.
        feedback_enabled:
          type: boolean
          description: >-
            If set to true, then
            [feedback](/docs/sms/api-reference/sms/batches/deliveryfeedback) is
            expected after successful delivery.
          default: false
        from_ton:
          maximum: 6
          minimum: 0
          type: integer
          description: The type of number for the sender number.
          format: int32
        from_npi:
          maximum: 18
          minimum: 0
          type: integer
          description: Number Plan Indicator for the sender number.
          format: int32
    MediaResponse:
      required:
        - type
      properties:
        id:
          type: string
          description: Unique identifier for batch
          example: 01FC66621XXXXX119Z8PMV1QPQ
          readOnly: true
        to:
          type: array
          format: E.164
          description: >-
            List of Phone numbers and group IDs that will receive the batch.
            [More
            info](https://community.sinch.com/t5/Glossary/MSISDN/ta-p/7628)
          example:
            - '+15551231234'
            - '+15551256344'
          items:
            $ref: '#/components/schemas/MtDestination'
          maxItems: 1000
          minItems: 1
        from:
          type: string
          description: |-
            Sender number.
             
             Required if Automatic Default Originator not configured.
          example: '+15551231234'
        canceled:
          type: boolean
          default: false
          description: Indicates if the batch has been canceled or not.
          readOnly: true
        body:
          $ref: '#/components/schemas/MediaBody'
        parameters:
          $ref: '#/components/schemas/parameterObj'
        type:
          type: string
          description: Media message
          enum:
            - mt_media
          x-enumDescriptions:
            mt_media: Media message
          readOnly: true
        created_at:
          type: string
          format: date-time
          description: |-
            Timestamp for when batch was created. 
             
             YYYY-MM-DDThh:mm:ss.SSSZ format
          readOnly: true
        modified_at:
          type: string
          format: date-time
          description: |-
            Timestamp for when batch was last updated. 
             
             YYYY-MM-DDThh:mm:ss.SSSZ format
          readOnly: true
        delivery_report:
          $ref: '#/components/schemas/DeliveryReportType'
        send_at:
          type: string
          format: date-time
          description: >-
            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. 
             
             YYYY-MM-DDThh:mm:ss.SSSZ format
          example: '2024-08-07T12:34:56.789Z'
        expire_at:
          type: string
          format: date-time
          description: >-
            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. 
             
             YYYY-MM-DDThh:mm:ss.SSSZ format
        callback_url:
          type: string
          description: Override the default callback URL for this batch. Must be valid URL.
          maxLength: 2048
          minLength: 0
        client_reference:
          type: string
          description: >-
            The client identifier of a batch message. If set, the identifier
            will be added in the delivery report/callback of this batch
          maxLength: 2048
          minLength: 0
        feedback_enabled:
          type: boolean
          default: false
          description: >-
            If set to true then
            [feedback](/docs/sms/api-reference/sms/batches/deliveryfeedback) is
            expected after successful delivery.
        strict_validation:
          type: boolean
          description: >
            Whether or not you want the media included in your message to be
            checked against [Sinch MMS channel best
            practices](/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.
    DeliveryStatus:
      type: string
      description: The simplified status as described in _Delivery Report Statuses_.
      example: Delivered
      enum:
        - Queued
        - Dispatched
        - Aborted
        - Cancelled
        - Failed
        - Delivered
        - Expired
        - Rejected
        - Deleted
        - Unknown
      x-enumDescriptions:
        Queued: >-
          Intermediate type. Message is queued within REST API system and will
          be dispatched according to the rate of the account.
        Dispatched: >-
          Intermediate type. Message has been dispatched and accepted for
          delivery by the SMSC.
        Aborted: Final type. Message was aborted before reaching the SMSC.
        Cancelled: Final type. Message was cancelled by user before reaching SMSC.
        Failed: Final type. Message failed to be delivered.
        Delivered: Final type. Message has been delivered.
        Expired: >-
          Final type. Message expired before delivery to the SMSC. This may
          happen if the expiry time for the message was very short.
        Rejected: Final type. Message was rejected by the SMSC.
        Deleted: Final type. Message was deleted by the SMSC.
        Unknown: >-
          Final type. Message was delivered to the SMSC but no Delivery Receipt
          has been received or a Delivery Receipt that couldn't be interpreted
          was received.
    DeliveryReceiptStatusCode:
      type: integer
      format: int32
      description: >-
        The delivery report status code provides a more detailed view of what
        happened with a message. The REST API error codes are a combination of
        [SMPP error
        codes](/docs/sms/smpp/error-codes/#status-reports-error-codes), [MMS
        error codes](/docs/mms/7-service/mms-status-codes/) and custom codes.
      enum:
        - 400
        - 401
        - 402
        - 403
        - 404
        - 405
        - 406
        - 407
        - 408
        - 410
        - 411
        - 412
        - 413
        - 414
        - 415
        - 416
        - 417
        - 418
      x-enumDescriptions:
        '400': >-
          Queued. Message is queued within REST API system and will be
          dispatched according to the rate of the account.
        '401': Dispatched. Message has been dispatched to SMSC.
        '402': >-
          Message unroutable. SMSC rejected message. Retrying is likely to cause
          the same error.
        '403': Internal error. An unexpected error caused the message to fail.
        '404': >-
          Temporary delivery. failure` Message failed because of temporary
          delivery failure. Message can be retried.
        '405': >-
          Unmatched Parameter. One or more parameters in the message body has no
          mapping for this recipient. See [Message
          Parameterization](../../../../resources/message-info/message-parameterization/)
        '406': >-
          Internal Expiry. Message was expired before reaching SMSC. This may
          happen if the expiry time for the message was very short.
        '407': Cancelled. Message was cancelled by user before reaching SMSC.
        '408': >-
          Internal Reject. SMSC rejected the message. Retrying is likely to
          cause the same error.
        '410': >-
          Unmatched default originator. No default originator exists/configured
          for this recipient when sending message without originator.
        '411': >-
          Exceeded parts limit. Message failed as the number of message parts
          exceeds the defined max number of message parts.
        '412': >-
          Unprovisioned region. SMSC rejected the message. The account hasn't
          been provisioned for this region.
        '413': >-
          Blocked. The account is blocked. Reach out to support for help.
          Potentially out of credits.
        '414': >-
          Bad Media. MMS only, the request failed due to a bad media URL. It is
          possible that the URL was unreachable, or sent a bad response.
        '415': >-
          Delivery report Rejected. MMS only, message reached MMSC but was
          rejected by MMS gateway or mobile network.
        '416': >-
          Delivery report Not Supported. MMS only, message reached MMSC but it
          is not supported.
        '417': >-
          Delivery report Unreachable. MMS only, message reached MMSC but the
          destination network or the mobile subscriber cannot be reached.
        '418': >-
          Delivery report Unrecognized. MMS only, message reached MMSC but the
          handset of the mobile subscriber does not recognize the message
          content.
    QueryReportType:
      type: string
      description: Kind of delivery report
      enum:
        - summary
        - full
      x-enumDescriptions:
        summary: Will count the number of messages sent per status.
        full: >-
          Report give that of a `summary` report but in addition, lists phone
          numbers.
    DeliveryReportType:
      type: string
      description: Kind of delivery report
      enum:
        - none
        - summary
        - full
        - per_recipient
        - per_recipient_final
      x-enumDescriptions:
        none: No delivery report callback will be sent.
        summary: A single delivery report callback will be sent.
        full: >-
          A single delivery report callback will be sent which includes a list
          of recipients per delivery status.
        per_recipient: >-
          A delivery report callback will be sent for each status change of a
          message. This could result in a lot of callbacks and should be **used
          with caution for larger batches**. These delivery reports also include
          a timestamp of when the Delivery Report originated from the SMSC.
        per_recipient_final: >-
          A delivery report callback representing the final status of a message
          will be sent for each recipient. This will send only one callback per
          recipient, compared to the multiple callbacks sent when using
          `per_recipient`. The delivery report will also include a timestamp of
          when it originated from the SMSC.
    inbound:
      description: Inbounds, or Mobile Originated (MO) messages, are incoming messages
      oneOf:
        - $ref: '#/components/schemas/text_message'
        - $ref: '#/components/schemas/binary_message'
        - $ref: '#/components/schemas/media_message'
      discriminator:
        propertyName: type
        mapping:
          mo_text: '#/components/schemas/text_message'
          mo_binary: '#/components/schemas/binary_message'
          mo_media: '#/components/schemas/media_message'
    Batch:
      type: object
      oneOf:
        - $ref: '#/components/schemas/TextResponse'
        - $ref: '#/components/schemas/BinaryResponse'
        - $ref: '#/components/schemas/MediaResponse'
      discriminator:
        propertyName: type
        mapping:
          mt_text: '#/components/schemas/TextResponse'
          mt_binary: '#/components/schemas/BinaryResponse'
          mt_media: '#/components/schemas/MediaResponse'
  parameters:
    service_plan_id:
      name: service_plan_id
      in: path
      required: true
      description: >-
        Your service plan ID. You can find this on your
        [Dashboard](https://dashboard.sinch.com/sms/api/rest).
      schema:
        type: string
      example: jd63jf88477ll123ab4567cd89012ef3
    batch_id:
      name: batch_id
      in: path
      required: true
      description: The batch ID you received from sending a message.
      schema:
        type: string
      example: 01FC66621XXXXX119Z8PMV1QPQ
    inbound_id:
      name: inbound_id
      in: path
      required: true
      description: The inbound ID found when listing inbound messages.
      schema:
        type: string
      example: 01FC66621XXXXX119Z8PMV1QPA
    group_id:
      name: group_id
      in: path
      required: true
      description: ID of a group that you are interested in getting.
      schema:
        type: string
    recipient_msisdn:
      name: recipient_msisdn
      in: path
      required: true
      description: Phone number for which you to want to search.
      schema:
        type: string
      example: '+134848393506'
    page:
      name: page
      in: query
      description: The page number starting from 0.
      schema:
        type: integer
        minimum: 0
        default: 0
      example: 2
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >
        Your API token is sent in the `Authorization` header preceded by
        `Bearer`. You'll have an API token per `service_plan_id`. Both can be
        found in the [Sinch Customer
        Dashboard](https://dashboard.sinch.com/sms/api/rest). Double check that
        you're using the correct region in your base URL.
  examples:
    MediaRequest:
      summary: media request example
      value:
        to:
          - 15551231234
          - 15551256344
        body:
          url: >-
            https://en.wikipedia.org/wiki/Sinch_(company)#/media/File:Sinch_LockUp_RGB.png
    BinaryRequest:
      summary: binary request example
      value:
        to:
          - 15551231234
          - 15551256344
        body: Hi ${name}! How are you?
        udh: abcxaf123
    TextRequest:
      summary: example text request
      value:
        to:
          - 15551231234
          - 15551256344
        body: Hi ${name}! How are you?
    ApiMtMessageDryRun:
      summary: example dry run response
      value:
        number_of_recipients: 1
        number_of_messages: 1
        per_recipient:
          - recipient: 15551231234
            number_of_parts: 1
            body: Test Message
            encoding: GSM
    ApiUpdateTextMtMessage:
      summary: example message response
      value:
        id: 01FC66621XXXXX119Z8PMV1QPQ
        to:
          - 15551231234
          - 15551256344
        from: 15551231234
        canceled: false
        parameters:
          '{parameter_key}':
            '{msisdn}': string
            default: string
        body: Hi ${name}! How are you?
        type: mt_text
        created_at: '2019-08-24T14:15:22Z'
        modified_at: '2019-08-24T14:15:22Z'
        delivery_report: none
        send_at: '2019-08-24T14:15:22Z'
        expire_at: '2019-08-24T14:15:22Z'
        callback_url: string
        client_reference: myReference
        feedback_enabled: false
        flash_message: false
        truncate_concat: true
        max_number_of_message_parts: 1
        from_ton: 6
        from_npi: 18
    ApiGroup:
      summary: example group response
      value:
        id: 01FC66621XXXXX119Z8PMV1QPU
        name: My new customers
        size: 2
        created_at: '2019-08-24T14:15:22Z'
        modified_at: '2019-08-24T14:15:22Z'
        auto_update:
          to: 15551231234
          add: join
          remove: leave
    msisdn:
      summary: phone number response
      value:
        - '+453234457784'
    ApiInboundList:
      summary: List of incoming messages
      value:
        count: 1
        page: 0
        inbounds:
          - body: Test Message
            client_reference: ABC123
            from: '+11203494390'
            id: 01FC66621XXXXX119Z8PMV1QPA
            operator_id: '35000'
            received_at: '2019-08-24T14:15:22Z'
            sent_at: '2019-08-24T14:15:22Z'
            to: '11203453453'
            type: mo_text
        page_size: 50
    text_message:
      summary: Mobile originating message
      value:
        body: Test message
        client_reference: ABC123
        from: '+11203494390'
        id: 01FC66621XXXXX119Z8PMV1QPA
        operator_id: '35000'
        received_at: '2019-08-24T14:15:22Z'
        sent_at: '2019-08-24T14:15:22Z'
        to: '11203453453'
        type: mo_text
    media_message:
      summary: Mobile originating message
      value:
        body:
          subject: Test subject
          message: Test message
          media:
            - url: https://some.s3.example.com/inbounds
              contentType: image/jpeg
              status: UPLOADED
              code: 0
        from: '+11203494390'
        id: 01FC66621XXXXX119Z8PMV1QPA
        received_at: '2019-08-24T14:15:22Z'
        sent_at: '2019-08-24T14:15:22Z'
        to: '11203453453'
        type: mo_media
    CancelBatchResponse:
      summary: batch message example
      value:
        id: 01FC66621XXXXX119Z8PMV1QPQ
        to:
          - 15551231234
          - 15551256344
        from: 15551231234
        canceled: true
        parameters:
          '{parameter_key}':
            '{msisdn}': 15551231234
            default: string
        body: Hi ${name}! How are you?
        type: mt_text
        created_at: '2019-08-24T14:15:22Z'
        modified_at: '2019-08-24T14:15:22Z'
        delivery_report: none
        send_at: '2019-08-24T14:15:22Z'
        expire_at: '2019-08-24T14:15:22Z'
        callback_url: myCallbackUrl
        client_reference: myReference
        feedback_enabled: false
        flash_message: false
        truncate_concat: true
        max_number_of_message_parts: 1
        from_ton: 6
        from_npi: 18
    TextResponse:
      summary: batch message example
      value:
        id: 01FC66621XXXXX119Z8PMV1QPQ
        to:
          - 15551231234
          - 15551256344
        from: 15551231234
        canceled: false
        parameters:
          '{parameter_key}':
            '{msisdn}': 15551231234
            default: string
        body: Hi ${name}! How are you?
        type: mt_text
        created_at: '2019-08-24T14:15:22Z'
        modified_at: '2019-08-24T14:15:22Z'
        delivery_report: none
        send_at: '2019-08-24T14:15:22Z'
        expire_at: '2019-08-24T14:15:22Z'
        callback_url: myCallbackUrl
        client_reference: myReference
        feedback_enabled: false
        flash_message: false
        truncate_concat: true
        max_number_of_message_parts: 1
        from_ton: 6
        from_npi: 18
    BinaryResponse:
      summary: binary response example
      value:
        id: 01FC66621XXXXX119Z8PMV1QPQ
        to:
          - 15551231234
          - 15551256344
        from: 15551231234
        canceled: false
        parameters:
          '{parameter_key}':
            '{msisdn}': 15551231234
            default: string
        body: YOUR_base64_message_body
        udh: abcxaf123
        type: mt_binary
        created_at: '2019-08-24T14:15:22Z'
        modified_at: '2019-08-24T14:15:22Z'
        delivery_report: none
        send_at: '2019-08-24T14:15:22Z'
        expire_at: '2019-08-24T14:15:22Z'
        callback_url: myCallbackUrl
        client_reference: myReference
        feedback_enabled: false
        from_ton: 6
        from_npi: 18
    MediaResponse:
      summary: media response example
      value:
        id: 01FC66621XXXXX119Z8PMV1QPQ
        to:
          - 15551231234
          - 15551256344
        from: 15551231234
        canceled: false
        parameters:
          '{parameter_key}':
            '{msisdn}': 15551231234
            default: string
        body:
          url: example.source.jpg
          message: your image
        type: mt_media
        created_at: '2019-08-24T14:15:22Z'
        modified_at: '2019-08-24T14:15:22Z'
        delivery_report: none
        send_at: '2019-08-24T14:15:22Z'
        expire_at: '2019-08-24T14:15:22Z'
        callback_url: myCallbackUrl
        client_reference: myReference
        feedback_enabled: false
        strict_validation: false
    ApiBatchList:
      summary: API batch list example
      value:
        count: '2'
        page: '1'
        batches:
          - id: abc123
            to:
              - '01234567'
            from: '01234567'
            canceled: false
            body: Test message
            udh: abcxaf123
            type: mt_text
            created_at: '2023-11-11T09:00:20.0'
            modified_at: '2023-11-11T09:00:20.0'
            delivery_report: none
            send_at: '2023-11-11T09:00:20.0'
            expire_at: ''
            callback_url: ''
            client_reference: xyz
            feedback_enabled: false
            flash_message: false
            truncate_concat: 'false'
            max_number_of_message_parts: '1'
            from_ton: '0'
            from_npi: '0'
          - id: def345
            to:
              - '07654321'
            from: 12346790
            canceled: false
            body: Test Message 2
            udh: abcxaf123
            type: mt_text
            created_at: '2023-11-11T09:00:20.0'
            modified_at: '2023-11-11T09:00:20.0'
            delivery_report: none
            send_at: '2023-11-11T09:00:20.0'
            expire_at: '2023-11-11T09:00:20.0'
            callback_url: ''
            client_reference: abc
            feedback_enabled: false
            flash_message: false
            truncate_concat: 'false'
            max_number_of_message_parts: '1'
            from_ton: '0'
            from_npi: '0'
        page_size: '10'
    BatchSendFillInBinary:
      summary: Binary - fill-in
      value:
        from: YOUR_Sinch_virtual_number
        to:
          - YOUR_recipient_number
        body: YOUR_base64_message_body
        type: mt_binary
        udh: YOUR_user_data_header
    BatchSendFillInMedia:
      summary: Media - fill-in
      value:
        from: YOUR_Sinch_virtual_number
        to:
          - YOUR_recipient_number
        body:
          url: YOUR_media_link
          message: Optional Text Message
        type: mt_media
    BatchSendFillInText:
      summary: Text - fill-in
      value:
        from: YOUR_Sinch_virtual_number
        to:
          - YOUR_recipient_number
        body: YOUR_message_body
        type: mt_text
    BatchSendBasicSMSBinary:
      summary: Binary - Basic SMS example
      value:
        from: '12345'
        to:
          - '+15551231212'
        body: U2FtcGxlIG1lc3NhZ2Uu
        type: mt_binary
        udh: YOUR_user_data_header
    BatchSendBasicSMSText:
      summary: Text - Basic SMS example
      value:
        from: '12345'
        to:
          - '+15551231212'
        body: >-
          Programmers are tools for converting caffeine into code. We just got a
          new shipment of mugs! Check them out: https://tinyurl.com/4a6fxce7!
        type: mt_text
    BatchSendBasicMediaMessage:
      summary: Media - Media only MMS
      value:
        from: '12345'
        to:
          - '15551231212'
        body:
          url: >-
            https://en.wikipedia.org/wiki/Sinch_(company)#/media/File:Sinch_LockUp_RGB.png
        type: mt_media
    BatchSendBasicCardMMS:
      summary: Media - Card MMS
      value:
        from: '12345'
        to:
          - '15551231212'
        body:
          url: >-
            https://en.wikipedia.org/wiki/Sinch_(company)#/media/File:Sinch_LockUp_RGB.png
          message: Text message from Sinch!
        type: mt_media
    BatchMessageWExpiryBinary:
      summary: Binary - Batch message with expiry
      value:
        from: '12345'
        to:
          - '+12345678901'
          - '+19876543210'
        body: U2FtcGxlIG1lc3NhZ2Uu
        type: mt_binary
        udh: YOUR_user_data_header
        expire_at: YYYY-MM-DDThh:mm:ss.SSSZ
    BatchMessageWExpiryText:
      summary: Text - Batch message with expiry
      value:
        from: '12345'
        to:
          - '+12345678901'
          - '+19876543210'
        body: This is a message that will stop attempting to send after three hours.
        type: mt_text
        expire_at: YYYY-MM-DDThh:mm:ss.SSSZ
    BatchParameterizedMessageText:
      summary: Text - Parameterized message
      value:
        from: '12345'
        to:
          - '+12345678910'
          - '+449876543210'
        body: Hi ${name}! Are you in for next week?
        type: mt_text
        parameters:
          name:
            '+12345678910': Joe
            default: there
    BatchParameterizedMediaMessageText:
      summary: Media - Parameterized message
      value:
        from: '12345'
        to:
          - '+12345678910'
          - '+449876543210'
        body:
          url: >-
            https://en.wikipedia.org/wiki/Sinch_(company)#/media/File:Sinch_LockUp_RGB.png
          message: Hi ${name}! Are you in for next week?
        type: mt_media
        parameters:
          name:
            '+12345678910': Joe
            default: there
    BatchMessageCustomDeliveryReportURLBinary:
      summary: Binary - Batch message with custom delivery report URL
      value:
        from: '12345'
        to:
          - '+12345678910'
          - '+449876543210'
        body: U2FtcGxlIG1lc3NhZ2Uu
        delivery_report: summary
        callback_url: http://www.example.com
        type: mt_binary
        udh: YOUR_user_data_header
    BatchMessageCustomDeliveryReportURLText:
      summary: Text - Batch message with custom delivery report URL
      value:
        from: '12345'
        to:
          - '+12345678910'
          - '+449876543210'
        body: >-
          There's a fine line between a numerator and a denominator that only a
          fraction of people understand.
        delivery_report: summary
        callback_url: http://www.example.com
        type: mt_text
    DryRunFillIn:
      summary: Dry Run
      value:
        from: YOUR_virtual_number
        to:
          - YOUR_numbers_sending_to
          - another_number
        body: YOUR body text here
        parameters:
          name:
            Phone_number_of_recipient: recipient_name
            default: default_in_place_of_name
    DryRunParameters:
      summary: Dry run batch with parameters
      value:
        from: '12345'
        to:
          - '+12345678910'
          - '+449876543210'
        body: >-
          Hi ${name}! Our latest survey shows that 3 out of 4 people make up 75%
          of the world's population.
        parameters:
          name:
            '+12345678910': Joe
            default: there
    BatchGetSpecificNumberBatchesInTimeFrame:
      summary: Get a specific number of batches within a certain time frame
      value:
        page: 1
        page_size: 30
        start_date: Now-24
    BatchGetSpecificPage:
      summary: Get a specific page from a batch with multiple pages
      value:
        page: 3
        page_size: 50
        start_date: Now-48
    BatchGetSpecificDate:
      summary: Get a batch from a specific date
      value:
        start_date: 2022-06-23T0000
        end_date: 2022-06-23T2400
    BatchGetSpecificBatches:
      summary: Get multiple, specific batches
      value:
        from: 44345,45607
    BatchUpdateFillIn:
      summary: Update
      value:
        to_remove:
          - YOUR_numbers
          - to_remove
          - as_strings_in_array
          - with_country_code
          - '16267890123'
        to_add:
          - YOUR_numbers
          - to_add
    BatchRemovePhoneNumbers:
      summary: Remove a group of phone numbers from a batch
      value:
        to_remove:
          - '11111111111'
          - '29999999999'
          - '15551234567'
          - '1123456789'
          - '15559876543'
    BatchAddPhoneNumbers:
      summary: Add phone numbers to a batch
      value:
        to_add:
          - '123456789'
          - '987654321'
    DeliveryReportSummary:
      summary: Summary report response
      value:
        type: delivery_report_sms
        batch_id: '{batch_id}'
        total_message_count: 3
        statuses:
          - code: 400
            status: Queued
            count: 1
          - code: 0
            status: Delivered
            count: 2
    DeliveryReportFull:
      summary: Full report
      value:
        type: delivery_report_sms
        batch_id: '{batch_id}'
        total_message_count: 3
        statuses:
          - code: 400
            status: Queued
            count: 1
            recipients:
              - '123456789'
          - code: 0
            status: Delivered
            count: 2
            recipients:
              - '987654321'
              - '123459876'
    DeliveryReportSpecificNumber:
      summary: For a specific number
      value:
        type: recipient_delivery_report_sms
        batch_id: '{batch_id}'
        total_message_count: 1
        statuses:
          - code: 400
            status: Queued
            count: 1
            recipients:
              - '123456789'
    SmsDeliveryReport:
      summary: SMS delivery report
      value:
        batch_id: 01FC66621XXXXX119Z8PMV1QPQ
        statuses:
          - code: 0
            count: 1
            recipients:
              - '44231235674'
            status: Delivered
        total_message_count: 1
        type: delivery_report_sms
    MmsDeliveryReport:
      summary: MMS delivery report
      value:
        batch_id: 01FC66621XXXXX119Z8PMV1QPQ
        statuses:
          - code: 0
            count: 1
            recipients:
              - '44231235674'
            status: Delivered
        total_message_count: 1
        type: delivery_report_mms
    MmsRecipientDeliveryReport:
      summary: MMS recipient delivery report
      value:
        at: '2022-08-30 08:16:08.930000+00:00'
        batch_id: 01FC66621XXXXX119Z8PMV1QPQ
        code: 0
        recipient: '44231235674'
        status: Delivered
        type: recipient_delivery_report_mms
    SmsRecipientDeliveryReport:
      summary: SMS recipient delivery report
      value:
        type: recipient_delivery_report_sms
        batch_id: 01FC66621XXXXX119Z8PMV1QPQ
        recipient: '+44231235674'
        code: 401
        status: Dispatched
        at: '2022-08-30T08:16:08.930Z'
    SmsListDeliveryReports:
      summary: List delivery reports
      value:
        count: 1
        page: 0
        page_size: 2
        delivery_reports:
          - applied_originator: My Originator
            at: '2019-08-24T14:15:22Z'
            batch_id: 01FC66621XXXXX119Z8PMV1QPQ
            client_reference: my_client_reference
            code: 0
            encoding: GSM
            number_of_message_parts: 1
            operator: '35000'
            operator_status_at: '2019-08-24T14:15:22Z'
            recipient: '15551231234'
            status: Delivered
            type: recipient_delivery_report_sms
    GroupCreateFillIn:
      summary: Create a group - fill in
      value:
        members:
          - member_MSISDNs
          - as_strings_in_array
          - '16051234567'
        name: YOUR_group_name
    CreateGroup:
      summary: Create a group
      value:
        members:
          - '123456789'
          - '987654321'
        name: Atlanta Pythonistas
    GroupAutoUpdate:
      summary: Update a group based on customer keyword response
      value:
        name: Homeowners
        auto_update:
          to: '443456789012'
          add:
            first_word: Join
          remove:
            first_word: Stop
    GroupAutoUpdateSharedShortCode:
      summary: Create auto an update group for a shared short code
      value:
        name: Patients at Clinic 2
        auto_update:
          to: '54321'
          add:
            first_word: West2
            second_word: Join
          remove:
            first_word: West2
            second_word: Stop
    GroupAddRemoveList:
      summary: Add or remove a list of phone numbers
      value:
        add:
          - '+14058961234'
          - '+447911123456'
          - '+55987654321'
        remove:
          - '+4612345678'
          - '+15551235555'
    GroupCreateParent:
      summary: Create a parent group
      description: >-
        Create a parent group that includes all members of groups with a certain
        ID.
      value:
        name: YOUR_group_name
        child_groups:
          - first_child_group_id
          - second_child_group_id
    GroupUpdateAdd:
      summary: Add or remove members from another group
      value:
        add_from_group: 01FC66621XXXXX119Z8PMV1QPQ
        remove_from_group: 01AB61221XXXXX119X8PMV1ABA
    GroupUpdateRemove:
      summary: Rename a group without changing its members
      value:
        name: New group name
    GroupUpdateNameKeepMembers:
      summary: Remove the name of a group without changing its members
      value:
        name: string
    GroupReplaceGroup:
      summary: Replace a group
      value:
        members:
          - '123456789'
          - '987654321'
        name: New Name of the Group
    ListGroupQuantity:
      summary: Retrieve the first 30 groups
      value:
        page: 0
        count: 30
    ListGroupPage:
      summary: Retrieve a certain page with a defined page size
      value:
        page: 3
        page_size: 50
    GroupList:
      summary: Retrieve a list of groups
      value:
        page: 50
        page_size: 50
        count: 1
        groups:
          - name: My First Group
            members:
              - '+14155553421'
              - '+13435552671'
              - '+14325552677'
            auto_update:
              to: '+453234457784'
              add:
                first_word: join
                second_word: add
              remove:
                first_word: leave
                second_word: remove
security:
  - BearerAuth: []
webhooks:
  incomingSMS:
    summary: Incoming SMS
    post:
      tags:
        - Webhooks
        - Inbounds
      summary: Incoming SMS
      description: >-
        An inbound message is a message sent to one of your short codes or long
        numbers from a mobile phone.

        To receive inbound message callbacks, a URL needs to be added to your
        REST API. This URL can be specified in your
        [Dashboard](https://dashboard.sinch.com/sms/api).
      operationId: incomingSMS
      requestBody:
        description: The incoming message to your sinch number
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/inbound'
            examples:
              Text MO:
                value:
                  body: This is a test message.
                  from: '16051234567'
                  id: 01XXXXX21XXXXX119Z8P1XXXXX
                  operator_id: string
                  received_at: '2022-08-24 14:15:22+00:00'
                  sent_at: '2022-08-24 14:15:22+00:00'
                  to: '13185551234'
                  type: mo_text
              Binary MO:
                value:
                  body: VGV4dCBtZXNzYWdl
                  from: '16051234567'
                  id: 01XXXXX21XXXXX119Z8P1XXXXX
                  operator_id: operator
                  received_at: '2022-08-24 14:15:22+00:00'
                  sent_at: '2022-08-24 14:15:22+00:00'
                  to: '13185551234'
                  type: mo_binary
                  udh: 10010203040506070809000a0b0c0d0e0f
              Media MO:
                value:
                  body:
                    subject: Test subject
                    message: Test message
                    media:
                      - url: https://some.s3.example.com/inbounds
                        contentType: image/png
                        status: UPLOADED
                        code: 0
                  from: '+11203494390'
                  id: 01XXXXX21XXXXX119Z8P1XXXXX
                  received_at: '2019-08-24 14:15:22+00:00'
                  sent_at: '2019-08-24 14:15:22+00:00'
                  to: '11203453453'
                  type: mo_media
      responses:
        '200':
          description: >-
            A `2xx` status code indicates that the data was received
            successfully.
        '400':
          description: >-
            A `4xx` status counts as a permanent failure and will not trigger
            any retries, except for `429`.
        '429':
          description: >-
            The callback will be retried and the callback throughput will be
            lowered.
        '500':
          description: A `5xx` status code will trigger a retry.
      security: []
  deliveryReport:
    summary: Delivery Report
    post:
      tags:
        - Webhooks
        - Delivery reports
      summary: Delivery Report
      description: >-
        A delivery report contains the status and status code for each recipient
        of a batch. To get a delivery report callback for a message or batch of
        messages, set the `delivery_report` field accordingly when [creating a
        batch](/docs/sms/api-reference/sms/batches/sendsms). 


        The following is provided so you can better understand our
        webhooks/callbacks. Configuration of both webhooks and the type of
        delivery report requested happens when sending a batch.


        #### Callback URL


        The callback URL can either be provided for each batch or provisioned
        globally for your account in your [Sinch Customer
        Dashboard](https://dashboard.sinch.com/sms/api/rest). Learn how to
        configure a webhook/callback
        [here](https://community.sinch.com/t5/SMS/How-do-I-assign-a-callback-URL-to-an-SMS-service-plan/ta-p/8414). 


        #### Type


        The `type` is the type of delivery report webhook. The response will
        vary depending on the webhook delivery report you selected when the
        batch was sent, so choose the appropriate selection under "One of".


        - The `delivery_report_sms` and `delivery_report_mms` types are
        documented under <b>Delivery report</b>. These are reports containing
        either [a full report or summary
        report](/docs/sms/api-reference/sms/batches/sendsms#batches/sendsms/t=request&path=&oneof=0/delivery_report),
        depending on your selection at the time the batch was sent.

        - The `recipient_delivery_report_sms` and
        `recipient_delivery_report_mms` delivery report types are documented
        under <b>Recipient delivery report</b>. These are delivery reports for
        recipient phone numbers. If you set `per_recipient` for the
        `delivery_report` parameter when sending the batch, a recipient report
        gets sent to you for each status change for each recipient in your
        batch. If you set `per_recipient_final`, a recipient report gets sent to
        you for the final status of each recipient in your batch.
      operationId: deliveryReport
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/BatchDeliveryReport'
                - $ref: '#/components/schemas/RecipientDeliveryReport'
            examples:
              Delivery report:
                $ref: '#/components/examples/SmsDeliveryReport'
              Recipient delivery report:
                $ref: '#/components/examples/SmsRecipientDeliveryReport'
              MMS delivery report:
                $ref: '#/components/examples/MmsDeliveryReport'
              MMS recipient delivery report:
                $ref: '#/components/examples/MmsRecipientDeliveryReport'
      responses:
        '200':
          description: >-
            A `2xx` status code indicates that the data was received
            successfully.
        '400':
          description: >-
            A `4xx` status counts as a permanent failure and will not trigger
            any retries, except for `429`.
        '429':
          description: >-
            The callback will be retried and the callback throughput will be
            lowered.
        '500':
          description: A `5xx` status code will trigger a retry.
      security: []
