# Send SMS to the list of clients

The object for creating SMS mailing has the following fields:
| Field | Type | Description |
|  --- | --- | --- |
| client_ids | array of numbers | Array of client IDs |
| text | string | SMS text message |

Endpoint: POST /sms/clients/by_id/{location_id}
Version: 1.0.0
Security: BearerPartnerUser

## Security:

  - `BearerPartnerUser` (unknown)
    http bearer Bearer {PartnerToken}, User {UserToken}

## Path parameters:

  - `location_id` (number, required)
    location ID

## Header parameters:

  - `Accept` (string, required)
    e.g. application/vnd.api.v2+json

  - `Content-Type` (string, required)
    application/json

  - `Authorization` (string, required)
    Bearer partner_token, User user_token

## Request fields (application/json):

  - `client_ids` (array)
    Array of client IDs

  - `text` (string)
    SMS text message

## Response 201:

  - `201` (unknown)
    Created

## Response 201 fields (application/json):

  - `success` (boolean)
    Execution success status (true)

  - `data` (null)
    Always null for this endpoint

  - `meta` (object)
    An object containing a 201 status code message

  - `meta.message` (string)

## Response 202:

  - `202` (unknown)
    Accepted - SMS mailing queued for delivery

## Response 202 fields (application/json):

  - `success` (boolean)
    Execution success status (true)

  - `data` (null)
    Always null for this endpoint

  - `meta` (object)
    An object containing a 201 status code message

  - `meta.message` (string)

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: false

  - `data` (object | null)
    Response data.
    Example: null

  - `meta` (object)
    Additional response data.

  - `meta.message` (string)
    Error message.
    Example: Authentication needed.

## Response 402:

  - `402` (unknown)
    Payment Required - Insufficient funds

## Response 402 fields (application/json):

  - `success` (boolean)
    Example: false

  - `data` (null)

  - `meta` (object)

  - `meta.message` (string)
    Example: Insufficient funds on the account. Refill your balance.

## Response 403:

  - `403` (unknown)
    Forbidden

## Response 403 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: false

  - `data` (object | null)
    Response data.
    Example: null

  - `meta` (object)
    Additional response data.

  - `meta.message` (string)
    Error message.
    Example: Access denied.

## Response 404:

  - `404` (unknown)
    Not Found

## Response 404 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: false

  - `data` (object | null)
    Response data.
    Example: null

  - `meta` (object | array)
    Additional response data (empty object or empty array)
    Example: {}

## Response 422:

  - `422` (unknown)
    Unprocessable Entity - validation errors or insufficient funds

## Response 422 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: false

  - `data` (object | null)
    Response data.
    Example: null

  - `meta` (object)
    Additional response data.

  - `meta.message` (string)
    Error message.
    Example: An error has occurred.

  - `meta.errors` (array)
    Set of a validation error messages.

