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

# Send Message

> Sends a new message in a chat.



## OpenAPI

````yaml api-reference/v01.12.00/openapi-v01.12.00.json POST /workers/{id}/chats/{chat_id}/messages
openapi: 3.0.0
info:
  title: Roosted
  version: 0.1.12
  contact:
    name: Support
    url: https://support.roostedhr.com/support/home
    email: support@roostedhr.com
  description: |-
    Enterprise API

    Sandbox keys and Production keys are requested from support
servers:
  - url: https://api.roostedhr.com/api/1_12
  - url: https://sandbox.roostedhr.com/api/1_12
security:
  - X-API-KEY: []
tags:
  - name: Announcements
  - name: Areas
  - name: Clients
  - name: Company
  - name: Configuration
  - name: Events
  - name: Locations
  - name: Payroll Groups
  - name: Rate Cards
  - name: Shifts
  - name: Skillsets
  - name: Time Tracking
  - name: Wage Rules
  - name: Workers
paths:
  /workers/{id}/chats/{chat_id}/messages:
    parameters:
      - schema:
          type: string
        name: id
        in: path
        required: true
        description: Worker ID
      - schema:
          type: string
        name: chat_id
        in: path
        required: true
        description: Chat ID
    post:
      tags:
        - Workers
      summary: Send Message
      description: Sends a new message in a chat.
      operationId: post-chat-message
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - message
              properties:
                message:
                  type: string
                  description: Message content to send.
            examples:
              Send a message:
                value:
                  message: Hello there
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Message ID.
                  message:
                    type: string
                    description: Message content.
                  sender_id:
                    type: string
                    description: ID of the message sender.
                  sender_name:
                    type: string
                    description: Name of the message sender.
                  date_created:
                    type: string
                    format: date-time
                    description: Timestamp when the message was sent.
                  read:
                    type: string
                    description: Whether the message has been read.
              examples:
                Success:
                  value:
                    id: rxsVGOYHC9u
                    message: Hello there
                    sender_id: '3158'
                    sender_name: Chris Davis
                    date_created: '2024-01-05T17:10:00.000Z'
                    read: '1'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                  error:
                    type: string
                    description: Human-readable error message.
              examples:
                Chat is locked:
                  value:
                    code: WRK-3500
                    error: Chat is locked
                Message is required:
                  value:
                    code: WRK-3500
                    error: Message is required
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                  error:
                    type: string
                    description: Human-readable error message.
              examples:
                Invalid or missing API key:
                  value:
                    code: ATH-100
                    error: Invalid or missing API key
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                  error:
                    type: string
                    description: Human-readable error message.
              examples:
                Insufficient permissions to manage chats:
                  value:
                    code: WRK-3200
                    error: Insufficient permissions to manage chats
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                  error:
                    type: string
                    description: Human-readable error message.
              examples:
                Worker not found:
                  value:
                    code: WRK-300
                    error: Worker not found
                Chat not found:
                  value:
                    code: WRK-3400
                    error: Chat not found
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                  error:
                    type: string
                    description: Human-readable error message.
              examples:
                Failed to send message:
                  value:
                    code: WRK-3300
                    error: Failed to send message
components:
  securitySchemes:
    X-API-KEY:
      name: X-API-KEY
      type: apiKey
      in: header

````