# Send SMS campaigns to customers matching the filters

The object for creating SMS mailing has the following fields:
| Field | Type | Description |
|  --- | --- | --- |
| text | string | SMS text message |

#### Client filtering
+ fullname:'Joh' (optional, string) - Name (part of name) to filter clients
+ phone:'1315' (optional, string) - Phone (part of the number) to filter clients
+ email:'test@' (optional, string) - Email (part) for client filtering
+ card:'5663rt' (optional, string) - Card (part) to filter customers by loyalty card number

Attention: If there are no filters, SMS mailing will go to the entire database!

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

## Description:

  - `Client filtering` ()
    fullname:'Joh' (optional, string) - Name (part of name) to filter clientsphone:'1315' (optional, string) - Phone (part of the number) to filter clientsemail:'test@' (optional, string) - Email (part) for client filteringcard:'5663rt' (optional, string) - Card (part) to filter customers by loyalty card number Attention: If there are no filters, SMS mailing will go to the entire database!

## Security:

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

## Path parameters:

  - `location_id` (number, required)
    location ID

## Query parameters:

  - `fullname` (string)
    Name (part of the name) for client filtering

  - `phone` (string)
    Phone (part of the number) for customer filtering

  - `email` (string)
    Email (part) for customer filtering

## 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):

  - `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 campaign 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 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: {}

