> ## Documentation Index
> Fetch the complete documentation index at: https://developers.partoo.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Update messaging settings

> This endpoint lets you update a specific Messaging Settings.




## OpenAPI

````yaml /assets/openapi/openapi-bundled.yaml post /messaging/settings/{setting_id}
openapi: 3.1.0
info:
  title: Partoo Rest API
  version: v2
  license:
    name: © Copyright Partoo
    url: https://www.partoo.co/en/gtu-api/
  x-logo:
    url: >-
      https://partoo-client-images.s3.amazonaws.com/logo-partoo-restapi-white.png
  description: >
    ## Introduction

    The Partoo Rest API allows you to automate all the actions that are possible
    to do in the Partoo Web Application.


    The Partoo Rest API can be used for many different purposes:
      - Create/update/delete your businesses & users if you are a client.
      - Create/subscribe/manage organizations, businesses & users if you are a reseller.
      - Retrieve data on businesses you have access to if you are a publisher.
      - ...
servers:
  - url: https://api.partoo.co/v2
    description: Production server
  - url: https://api.sandbox.partoo.co/v2
    description: Sandbox server (dev environment for clients & partners)
security:
  - ApiKeyAuth: []
paths:
  /messaging/settings/{setting_id}:
    post:
      tags:
        - Messaging Settings
      summary: Update messaging settings
      description: |
        This endpoint lets you update a specific Messaging Settings.
      operationId: updateMessagingSettings
      parameters:
        - name: setting_id
          in: path
          required: true
          schema:
            type: integer
            description: The id of the Messaging Settings to update
      requestBody:
        required: true
        content:
          application/json:
            schema:
              description: Request body to update a Post
              type: object
              properties:
                welcome_message:
                  $ref: '#/components/schemas/MessagingSettingWelcomeMessage'
                offline_message:
                  $ref: '#/components/schemas/MessagingSettingOfflineMessage'
                uses_business_hours:
                  $ref: '#/components/schemas/MessagingSettingUsesBusinessHours'
                custom_chat_hours:
                  $ref: '#/components/schemas/ChatHours'
                is_launched:
                  $ref: '#/components/schemas/MessagingSettingIsLaunched'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessagingSetting'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
components:
  schemas:
    MessagingSettingWelcomeMessage:
      type:
        - string
        - 'null'
      description: >
        When a consumer first contacts the business, an automated reply is sent.

        The content of the reply depends on whether the consumer contacted the
        business during it's chat hours.        

        If it is, the welcome_message is sent as a reply.     


        The welcome_message is mandatory, and can be customized. A default will
        be set if none is specified.
    MessagingSettingOfflineMessage:
      type:
        - string
        - 'null'
      description: >
        When a consumer first contacts the business, an automated reply is
        sent.      

        The content of the reply depends on whether the consumer contacted the
        business during it's chat hours.      

        If it is not, the offline_message is sent as a reply.     


        The offline_message is mandatory, and can be customized. A default will
        be set if none is specified.
    MessagingSettingUsesBusinessHours:
      type:
        - boolean
        - 'null'
      description: >
        If set to true, the business' "open_hours" will be used as chat
        hours.    

        Otherwise, you need to specify "custom_chat_hours".
    ChatHours:
      type:
        - object
        - 'null'
      description: >
        The chat hours of the business (in its timezone).


        Chat hours are specified per weekday. This is done by supplying an
        object mapping weekdays ("monday", "tuesday", etc.) to a list of
        strings. These strings in turn represent time slots during which the
        business is open.      


        For example, the following value would set the chat hours to between
        08:00-15:00 in the afternoon and 18:00-23:00 in the evening on
        Mondays:      


        `{"monday": ["08:00-15:00", "18:00-23:00"]}`    


        To indicate that a business can be contacted for 24 hours, for a
        specific weekday, use the value `["00:00-23:59"]`.     


        This field is not mandatory unless "uses_business_hours" is set to
        false.
      required:
        - monday
        - tuesday
        - wednesday
        - thursday
        - friday
        - saturday
        - sunday
      properties:
        monday:
          $ref: '#/components/schemas/Day'
        tuesday:
          $ref: '#/components/schemas/Day'
        wednesday:
          $ref: '#/components/schemas/Day'
        thursday:
          $ref: '#/components/schemas/Day'
        friday:
          $ref: '#/components/schemas/Day'
        saturday:
          $ref: '#/components/schemas/Day'
        sunday:
          $ref: '#/components/schemas/Day'
    MessagingSettingIsLaunched:
      type:
        - boolean
        - 'null'
      description: >
        Some messaging channels (Google and Facebook) can be temporarily
        deactivated. This allows the business to close for a period of time
        without having to answer consumer messages.      


        This is important because consumers will get frustrated if they are able
        to contact a business and do not get an answer. It is also important to
        note that for some messaging channels, not responding to messages may
        lead to decreased visibility of the business, or suspension of the
        messaging service.      


        The is_launched property indicates whether the business is reachable for
        those messaging channels.        


        The value can be updated, and the changes will be propagated to the
        messaging channels, effectively toggling the On or Off the ability for
        consumers to reach the business. (The change to "is_launched" is made
        asychronously, and the update will be effective when the messaging
        channels have finished propagating the information)
    MessagingSetting:
      type: object
      properties:
        id:
          type: integer
        business_id:
          type: string
          description: |
            The ID of the business that the MessagingSetting is related to.
        business_name:
          type:
            - string
            - 'null'
          description: |
            The Name of the business that the MessagingSetting is related to.
        business_address:
          type:
            - string
            - 'null'
          description: >
            The Formatted address of the business that the MessagingSetting
            isrelated to.
          example: 1 Rue de la Paix, 75000 Paris
        welcome_message:
          $ref: '#/components/schemas/MessagingSettingWelcomeMessage'
        offline_message:
          $ref: '#/components/schemas/MessagingSettingOfflineMessage'
        uses_business_hours:
          $ref: '#/components/schemas/MessagingSettingUsesBusinessHours'
        custom_chat_hours:
          $ref: '#/components/schemas/ChatHours'
        is_launched:
          $ref: '#/components/schemas/MessagingSettingIsLaunched'
    Day:
      description: >-
        Open in the morning and in the evening `[10:00-14:00, 18:00-00:00]`.
        Closed the whole day `[]`
      type: array
      items:
        $ref: '#/components/schemas/TimeWindow'
      example:
        - 10:00-14:00
    TimeWindow:
      description: Time window
      type: string
      pattern: ^([0-1][0-9]|2[0-3]):([0-5][0-9])-([0-1][0-9]|2[0-3]):([0-5][0-9])$
      example: 10:00-14:00
  responses:
    '401':
      description: You are not authenticated
      content:
        application/json:
          schema:
            description: Error that occurs when you are not authenticated
            type: object
            properties:
              errors:
                type: object
                description: The detail of the error encountered
                properties:
                  authentication:
                    type: string
                    default: User not authenticated
    '403':
      description: |
        You are not allowed to perform this action
      content:
        application/json:
          schema:
            description: >
              Error that occurs when you are authenticated but you are trying to
              perform an action you are not allowed to perform
            type: object
            properties:
              errors:
                type: object
                description: The detail of the error encountered
                properties:
                  authorization:
                    type: string
                    default: Operation not allowed
  securitySchemes:
    ApiKeyAuth:
      description: >
        The authentication system on Partoo API is using API Key that should be
        put in the header of the request (the name of the header is `x-APIKey`).
        An api_key is linked to a user. This user's role will give you different
        access level to the API features.
      type: apiKey
      in: header
      name: x-APIKey

````