# Can't send PM via API (HTTPUnprocessableEntity 422)

**URL:** https://meta.discourse.org/t/cant-send-pm-via-api-httpunprocessableentity-422/55017
**Category:** Development
**Tags:** rest-api
**Created:** [January 1, 2017, 4:04am UTC](https://meta.discourse.org/t/cant-send-pm-via-api-httpunprocessableentity-422/55017 "2017-01-01T04:04:24Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![AstonJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/astonj/32/215041_2.png) [@AstonJ](https://meta.discourse.org/u/AstonJ)
#### Post date: [January 1, 2017, 6:03pm UTC](https://meta.discourse.org/t/cant-send-pm-via-api-httpunprocessableentity-422/55017/6 "2017-01-01T18:03:55Z")

</div>

The full code is in the first post (use Ruby with IRB to run it).

Sam has said that PMs are just posts and it’s fine to use the API:

> [@Private Message Send API](https://meta.discourse.org/t/private-message-send-api/27593/5):
>
> A PM is just a type of post, you can create a PM just fine using the API. In fact we are using the API on this very site to create PMs. PM stands for personal message by the way

🙂

---

_[View the full topic](https://meta.discourse.org/t/cant-send-pm-via-api-httpunprocessableentity-422/55017)._
