---
title: "POST /users/{userID}/messages"
method: POST
path: "/users/{userID}/messages"
tags: ["message"]
---

# POST /users/{userID}/messages

`POST /users/{userID}/messages`

DMチャンネルにメッセージを投稿します。

## Query parameters

- `embed` integer

## Request body

- SendMessage
  - `text` string, required — Markdown形式のメッセージ本文

## Response `201`

投稿に成功しました。
投稿されたメッセージが返されます。

- Message
  - `messageId` string, uuid — メッセージUUID
  - `userId` string, uuid — 投稿者UUID
  - `parentChannelId` string — 投稿先チャンネルUUID
  - `content` string — メッセージ本体
  - `createdAt` string, date-time — メッセージ投稿日時
  - `updatedAt` string, date-time — メッセージ更新日時
  - `pin` boolean — ピン留めされているかどうか
  - `reported` boolean — 自分が通報しているかどうか
  - `stampList` MessageStamp[] — メッセージスタンプ配列
    - `userId` string, uuid — ユーザーUUID
    - `stampId` string, uuid — スタンプUUID
    - `count` integer — 押された個数
    - `createdAt` string, date-time — 最初に押した日時
    - `updatedAt` string, date-time — 最後に押した日時

## Other responses

- `404` — +| 投稿に失敗しました。 指定したユーザーは存在しません。

## Changes

- **2019-09-19** `a26b77b707da` — 1 info
  - added the new optional `query` request parameter `embed`
- **2019-09-09** `f291e1b35a23` — 1 breaking
  - request body became required
- **2019-07-24** `66a69a1387ed` — 1 info
  - api operation id `postDirectMessage` was added
- **2019-07-05** `6956f2622a20` — 6 info
  - the endpoint scheme security `traqOAuth2` was added to the API
  - endpoint reactivated
  - added optional request body
  - added the non-success response with the status `404`
  - …2 more

[Change history](https://skmtc.dev/traptitech/apis/traq-api/changes/users/:userID/messages/post.md)

---

[API](https://skmtc.dev/traptitech/apis/traq-api.md) · [All operations](https://skmtc.dev/traptitech/apis/traq-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/traptitech/traq-api/revisions/78d32137c921/schema)
