# Notify Altegio about a new chat message

Marks the installed Chat frame as having unread messages. Altegio updates
the timetable UI and may create a notification-center item according to the
location's Chat settings. If lead saving is enabled and `phone_from` does
not match a client, Altegio may create a lead.
The application must belong to the authenticated partner and its Chat frame
must already be installed for the location (normally by passing `chat_url`
to the installation callback).

Endpoint: POST /marketplace/application/new_message
Version: 1.0.0
Security: BearerPartner

## Security:

  - `BearerPartner` (unknown)
    http bearer Bearer {PartnerToken}

## Header parameters:

  - `Accept` (string, required)

## Request fields (application/json):

  - `salon_id` (integer, required)
    Location ID.

  - `application_id` (integer, required)
    Marketplace application ID.

  - `phone_from` (string, required)
    Sender phone number as digits.

  - `message` (string, required)
    Message preview used by notification-center delivery.

  - `name` (string, required)
    Sender name used if lead creation is enabled.

## Response 201:

  - `201` (unknown)
    Chat unread/highlight state updated.

## Response 201 fields (application/json):

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

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

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

## Response 401:

  - `401` (unknown)
    Partner token is missing or invalid.

## 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)
    The application does not belong to the partner.

## 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)
    No Chat frame is installed for this application and location.

## 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)
    Invalid request payload.

## 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.

