# Post anonymously via API?

**URL:** https://meta.discourse.org/t/post-anonymously-via-api/159759
**Category:** Development
**Tags:** rest-api
**Created:** [August 4, 2020, 8:56am UTC](https://meta.discourse.org/t/post-anonymously-via-api/159759 "2020-08-04T08:56:03Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Orachun\_Udomkasemsub](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/orachun_udomkasemsub/32/186390_2.png) [@Orachun\_Udomkasemsub](https://meta.discourse.org/u/Orachun_Udomkasemsub)
#### Post date: [August 4, 2020, 8:56am UTC](https://meta.discourse.org/t/post-anonymously-via-api/159759/1 "2020-08-04T08:56:03Z")

</div>

Hi,

Is it possible to post anonymously via API? I’m browsing through API doc but can’t find how to do so.

Thanks.

---

<div class="post-metadata">

### Author: ![osioke](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/osioke/32/238946_2.png) [@osioke](https://meta.discourse.org/u/osioke)
#### Post date: [August 5, 2020, 9:30am UTC](https://meta.discourse.org/t/post-anonymously-via-api/159759/2 "2020-08-05T09:30:20Z")

</div>

Hmm… First time I am seeing this, but I believe it will be possible, but require a 2-step. So you’d first enable [anonymous mode via the API](https://meta.discourse.org/search?context=topic&context_id=159759&q=anonymous%20api&skip_context=true), then post using the anonymous account via the API.

You might need to do some trial and error to figure it out, see [Reverse engineer the Discourse API](https://meta.discourse.org/t/how-to-reverse-engineer-the-discourse-api/20576/) for some tips.

---

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [August 5, 2020, 12:39pm UTC](https://meta.discourse.org/t/post-anonymously-via-api/159759/3 "2020-08-05T12:39:14Z")

</div>

Yes, you can post anonymously via the API. You will either have to use an “all users” api key or a “user specific” api key for the actual anonymous username, not the original username of the user.

```plaintext
curl -i -sS -X POST "http://localhost:3000/posts.json" \
-H "Content-Type: multipart/form-data;" \
-H "Api-Key: 48656cfb5197594c71525452e78a403208c4d1a123f60408b765d9c6bd1a9450" \
-H "Api-Username: anonymous1" \
-F "title=b5d39ea5124 4684a27917c d1b81ea2e9e" \
-F "raw=6d9392121129f0ce504583d74e056f5d fe4cf67228216d302509deeca33f0ebc 690106384b6a4204151572e9d4e9da45"

HTTP/1.1 200 OK

```

---

<div class="post-metadata">

### Author: ![Orachun\_Udomkasemsub](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/orachun_udomkasemsub/32/186390_2.png) [@Orachun\_Udomkasemsub](https://meta.discourse.org/u/Orachun_Udomkasemsub)
#### Post date: [August 6, 2020, 11:03am UTC](https://meta.discourse.org/t/post-anonymously-via-api/159759/4 "2020-08-06T11:03:09Z")

</div>

Thanks for the response.  
Is there anyway that the admin knows who has posted the anonymous post?

---

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [August 6, 2020, 3:25pm UTC](https://meta.discourse.org/t/post-anonymously-via-api/159759/5 "2020-08-06T15:25:03Z")

</div>

I don’t think that info is exposed in the UI anywhere. Looks like you can use a [data explorer](https://meta.discourse.org/t/32566?silent=true) query though:

> [@Finding originating account of anonymous posts](https://meta.discourse.org/t/finding-originating-account-of-anonymous-posts/111067/8):
>
> There’s a good reason why that feature is disabled by default. You should have a really good reason to enable it and you should trust them to not abuse that feature. Maybe use a higher anonymous\_posting\_min\_trust\_level? You can use the following query in the [Data Explorer](https://meta.discourse.org/t/32566?silent=true) if you really need to find out who’s who. But, if you need to use it on a regular basis you should really ask yourself if your community members are ready for the anonymous posting feature. Choose the right query depending on…

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [September 5, 2020, 3:25pm UTC](https://meta.discourse.org/t/post-anonymously-via-api/159759/6 "2020-09-05T15:25:28Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
