---
title: "Send a message to a conversation"
method: POST
path: "/conversations/{conversationId}/messages"
tags: ["Conversations"]
---

# Send a message to a conversation

`POST /conversations/{conversationId}/messages`

## Request

- Base URL: `https://messenger-public-api.cogfy.com`
- URL: `https://messenger-public-api.cogfy.com/conversations/{conversationId}/messages`
- Auth: API key in header `api-key`
- TypeScript: <https://skmtc.dev/indigohive/apis/cogfy-messenger-public-api/docs/conversations/:conversationId/messages/post.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `conversationId` string, required

## Request body

- object
  - `content` string: Message content. Required for text messages, optional for media messages.
  - `type` 'text' | 'image' | 'document', required: Message type
  - `media` object
    - `name` string: Media file name. Optional.
    - `mimeType` string: Media MIME type. Required for media messages.
    - `base64` string: Media file content in base64 encoding. Required for media messages.

## Response `201`

Message sent successfully

- object
  - `id` string, uuid: Message ID

## Other responses

- `400`: Bad request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Conversation not found
- `500`: Internal server error

---

[API](https://skmtc.dev/indigohive/apis/cogfy-messenger-public-api.md) - [All operations](https://skmtc.dev/indigohive/apis/cogfy-messenger-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/indigohive/apis/cogfy-messenger-public-api/revisions/30bd33ee45c9?raw)
