---
title: "Send message"
method: POST
path: "/chat-app/messages/{chatId}"
tags: ["💬 Chat App"]
---

# Send message

`POST /chat-app/messages/{chatId}`

## Request

- Base URL: `https://api.freeapi.app/api/v1`
- URL: `https://api.freeapi.app/api/v1/chat-app/messages/{chatId}`
- Auth: none declared
- TypeScript: <https://skmtc.dev/hiteshchoudhary-ssesph/apis/freeapi/docs/chat-app/messages/:chatId/post.ts> (a function with typed inputs; its response is checked against the schema)

This API endpoint enables logged-in users to send messages to a specific chat identified by the provided `chatId` in the path variable.

By making a `POST` request to this endpoint, developers can seamlessly integrate message transmission functionality into their applications, allowing users to engage in real-time conversations within the designated chat. User can send image files as `attachments` as well (maximum 5 attachments are allowed)

## Request body `multipart/form-data`

- object
  - `attachments` string, binary: Image file maximum 5 images allowed. Pass multiple `attachments` keys to send multiple images.
  - `content` string

## Response `201`

Send message

- object
  - `data` object
    - `__v` number
    - `_id` string
    - `attachments` object[]
      - `_id` string
      - `localPath` string
      - `url` string
    - `chat` string
    - `content` string
    - `createdAt` string
    - `sender` object
      - `_id` string
      - `avatar` object
        - `_id` string
        - `localPath` string
        - `url` string
      - `email` string
      - `username` string
    - `updatedAt` string
  - `message` string
  - `statusCode` number
  - `success` boolean

---

[API](https://skmtc.dev/hiteshchoudhary-ssesph/apis/freeapi.md) - [All operations](https://skmtc.dev/hiteshchoudhary-ssesph/apis/freeapi/llms.txt) - [OpenAPI document](https://skmtc.dev/hiteshchoudhary-ssesph/apis/freeapi/revisions/a9f3a290e4dc?raw)
