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

# Add Chat Message

> Add a new message to a chat session



## OpenAPI

````yaml /openapi/rest/openapi-v3-ChatSession.json post /api/v1/ChatSession/{chatSessionId}/Messages
openapi: 3.0.0
info:
  version: v1-REST
  title: SuperOffice REST API v1
  description: SuperOffice REST API - ChatSession
  contact:
    name: SuperOffice DevNet
    url: https://docs.superoffice.com/en/api/index.html
    email: sdk@superoffice.com
servers:
  - url: http://localhost:56350
  - url: https://localhost:56350
security: []
tags: []
externalDocs:
  description: >-
    The SuperOffice DevNet Community has more documentation, examples, and
    discussion forums.
  url: https://community.superoffice.com/en/developer/
paths:
  /api/v1/ChatSession/{chatSessionId}/Messages:
    post:
      tags:
        - ChatSession
      summary: Add Chat Message
      description: Add a new message to a chat session
      operationId: v1ChatSessionEntity_AddChatMessage
      parameters:
        - name: chatSessionId
          in: path
          description: id of the chat session to add message to
          required: true
          schema:
            type: integer
            format: int32
        - name: Accept-Language
          in: header
          description: >-
            Convert string references and multi-language values into a specified
            language (iso2) code.
          required: false
          schema:
            type: string
        - name: SO-Language
          in: header
          description: >-
            Convert string references and multi-language values into a specified
            language (iso2) code. Overrides Accept-Language value.
          required: false
          schema:
            type: string
        - name: SO-Culture
          in: header
          description: >-
            Number, date formatting in a specified culture (iso2 language) code.
            Partially overrides SO-Language/Accept-Language value. Ignored if no
            Language set.
          required: false
          schema:
            type: string
        - name: SO-TimeZone
          in: header
          description: >-
            Specify the timezone code that you would like date/time responses
            converted to.
          required: false
          schema:
            type: string
        - name: SO-AppToken
          in: header
          description: >-
            The application token that identifies the partner app. Used when
            calling Online WebAPI from a server.
          required: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SuperOffice.CRM.Services.ChatMessage'
          text/json:
            schema:
              $ref: '#/components/schemas/SuperOffice.CRM.Services.ChatMessage'
          application/xml:
            schema:
              $ref: '#/components/schemas/SuperOffice.CRM.Services.ChatMessage'
          text/xml:
            schema:
              $ref: '#/components/schemas/SuperOffice.CRM.Services.ChatMessage'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SuperOffice.CRM.Services.ChatMessage'
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/SuperOffice.CRM.Services.ChatMessage'
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/SuperOffice.CRM.Services.ChatMessage'
        description: Message to add
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.ChatMessage'
            text/json:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.ChatMessage'
            application/xml:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.ChatMessage'
            text/xml:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.ChatMessage'
            application/json-patch+json:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.ChatMessage'
            application/merge-patch+json:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.ChatMessage'
      security:
        - SuperOffice_Password: []
          SuperId_Authentication: []
components:
  schemas:
    SuperOffice.CRM.Services.ChatMessage:
      description: "A message in a chat session\r\n<para />\r\nCarrier object for ChatMessage.\r\nServices for the ChatMessage Carrier is available from the <see cref=\"T:SuperOffice.CRM.Services.IChatAgent\">Chat Agent</see>."
      type: object
      properties:
        ChatMessageId:
          format: int32
          description: The primary key (auto-incremented)
          type: integer
        ChatSessionId:
          format: int32
          description: The reference to the associated chat session.
          type: integer
        Type:
          description: The type of the message.
          enum:
            - Invalid
            - ToCustomer
            - ToUser
            - Special
          type: string
        Message:
          description: The message.
          type: string
        Author:
          description: The author of the message.
          type: string
        ReadByCustomer:
          format: int32
          description: Whether the message has been read by the customer or not.
          type: integer
        SpecialType:
          description: >-
            Enum indicating if it is a special message, such as an URL
            redirection, etc.
          enum:
            - None
            - Welcome
            - Url
            - Block
            - NewSession
            - TransferedSession
            - Error
            - SessionDeleted
            - FaqSuccessQuestion
            - ClosedByUser
            - ClosedByCustomer
            - ClosedByIdle
            - TransferRejected
            - ReopenedByCustomer
            - ClickedOption
            - BotMessage
            - Options
            - IllegalFileType
          type: string
        SpecialParam:
          description: Special parameter for the special_type.
          type: string
        WhenPosted:
          format: date-time
          description: When the message was posted (UTC timestamp).
          type: string

````

## Related topics

- [Add Chat Message](/en/api/reference/restful/agent/chat_agent/add-chat-message.md)
- [SuperOffice.WebApi.Data.Chat AddChatMessageRequest](/en/api/reference/webapi/SuperOffice.WebApi.Data.Chat_AddChatMessageRequest.md)
- [NSChatAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSChatAgent.md)
- [Chatbot messages](/en/automation/chatbot/messages.md)
- [SuperOffice.WebApi.Agents.ChatAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.ChatAgent.md)
- [SuperOffice.WebApi.Agents.IChatAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.IChatAgent.md)
