---
title: "Sends a new chat message to the given room"
method: POST
path: "/ocs/v2.php/apps/spreed/api/{apiVersion}/bot/{token}/message"
tags: ["bot"]
---

# Sends a new chat message to the given room

`POST /ocs/v2.php/apps/spreed/api/{apiVersion}/bot/{token}/message`

The author and timestamp are automatically set to the current user/guest and time.

## Path parameters

- `apiVersion` 'v1', required
- `token` string, required

## Headers

- `x-nextcloud-talk-bot-random` string
- `x-nextcloud-talk-bot-signature` string
- `OCS-APIRequest` boolean, required

## Request body

- object
  - `message` string, required — The message to send
  - `referenceId` string — For the message to be able to later identify it again
  - `replyTo` integer — Parent id which this message is a reply to
  - `silent` boolean — If sent silent the chat message will not create any notifications
  - `threadTitle` string — Only supported when not replying, when given will create a thread (requires `threads` capability)
  - `threadId` integer — Thread id which this message is a reply to without quoting a specific message (ignored when $replyTo is given, also requires `threads` capability)

## Response `201`

Message sent successfully

- object
  - `ocs` object, required
    - `meta` OCSMeta, required
      - `status` string, required
      - `statuscode` integer, required
      - `message` string
      - `totalitems` string
      - `itemsperpage` string
    - `data` unknown, required

## Other responses

- `400` — When the replyTo is invalid or message is empty
- `401` — Sending message is not allowed
- `413` — Message too long

## Changes

- **2026-06-17** `bbab49b96f5e` — 2 info
  - added the new optional `header` request parameter `x-nextcloud-talk-bot-random`
  - added the new optional `header` request parameter `x-nextcloud-talk-bot-signature`
- **2026-03-11** `31b09d1bcf85` — 2 info
  - added the new optional request property `threadId`
  - added the new optional request property `threadTitle`

[Change history](https://skmtc.dev/nextcloud/apis/spreed-full/changes/ocs/v2.php/apps/spreed/api/:apiVersion/bot/:token/message/post.md)

---

[API](https://skmtc.dev/nextcloud/apis/spreed-full.md) · [All operations](https://skmtc.dev/nextcloud/apis/spreed-full/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/nextcloud/spreed-full/revisions/41d6458d6d6e/schema)
