# Private Message Send API

**URL:** <https://meta.discourse.org/t/private-message-send-api/27593>\
**Category:** Support\
**Created:** [April 15, 2015, 12:44pm UTC](https://meta.discourse.org/t/private-message-send-api/27593 "2015-04-15T12:44:59Z")\
**Posts on this page:** 1\
**Showing post:** 21

<div class="post-metadata">

**Author:** ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)\
**Post date:** [April 26, 2021, 4:20pm UTC](https://meta.discourse.org/t/private-message-send-api/27593/21 "2021-04-26T16:20:59Z")

</div>

Are you setting the archetype? In the future if you include the request you are sending, it’ll be easier to help you.

The following example works for me:

```plaintext
curl https://$DISCOURSE_HOSTNAME/posts \
  -H "api-key: $DISCOURSE_API_KEY" \
  --data 'title=Testing PM creation&archetype=private_message&target_recipients=user1,user2' \
  --data-urlencode 'raw=PM body, long enough to meet site rules & may be complex ♥'

```

ℹ if you are using an `all_users` API key you also need to specify `api-username`

---

_[View the full topic](https://meta.discourse.org/t/private-message-send-api/27593)._
