---
title: "Send direct message"
method: POST
path: "/x/dm/{userId}"
tags: ["X Write"]
---

# Send direct message

`POST /x/dm/{userId}`

## Path parameters

- `userId` string, required

## Request body

- object
  - `account` string, required — X account (@username or account ID)
  - `text` string, required
  - `media_ids` string[]
  - `reply_to_message_id` string

## Response `200`

DM sent

- object
  - `messageId` string, required
  - `success` true, required

## Other responses

- `400` — Invalid input
- `401` — Unauthenticated
- `402` — Subscription or usage issue
- `500` — Write operation failed. Possible error codes include x_write_failed, x_write_ambiguous, x_duplicate_action, x_daily_limit (429 — account reached daily posting limit, wait 24 hours), and x_write_unconfirmed (202 — action may have completed but could not be confirmed, verify before retrying).

---

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