Change ownership of "Made this a banner on" or Closed on" (small action posts)

AI-generated summary

In a Dev category discussion tagged with rest-api, users explore whether ownership of small action posts (like ā€œMade this a banner onā€ or ā€œClosed onā€) can be changed. Jonathan5 initiates the query, and ondrej notes that ownership can’t be changed directly — the post would need to be deleted and recreated. JammyDodger suggests using the API, citing a prior thread, and later confirms via Postman that changing ownership of such posts is indeed possible. Jonathan5 seeks clarification, and JammyDodger provides a step-by-step guide using Postman’s UI, including setting headers and form-data with the post_id and target username. Jonathan5 asks if Postman can be used without paying; JammyDodger confirms a free version exists and mentions curl as an alternative. Canapin adds that tools like Insomnia are free alternatives and provides a curl example for API interaction. The consensus is that while the UI doesn’t support ownership changes, the API does — via tools like Postman, Insomnia, or curl.

Is it possible to change ownership of these pseudo-posts? (Or whatever they are called!)

Thanks.

The small action posts? You can’t change the ownership of those as far as I know. The small action would have to be deleted and the topic opened and closed again (for example) with whoever you want to own the small action closing the topic.

This is a curiosity contribution… :slightly_smiling_face:

Even though there’s not an admin wrench on the small action posts, they still get a post id - is it possible to change ownership of them through the API?

Thanks for the idea. I’ve never used the API before but would be happy to give it a go if someone would confirm that it would work here… :slight_smile:

Would I just type this at the command line?

curl -X POST "http://forum.example.com/t/[TOPIC_ID]/change-owner.json" \
-H "Content-Type: multipart/form-data;" \
-H "Api-Key: ................." \
-H "Api-Username: ..............." \
-F "post_ids[]=[POST_ID]" \
-F "username=[NEW_USERNAME]"

I can work out the [TOPIC_ID] from the URL, the API key/username from Settings-API, and [POST_ID] from looking at Chrome’s dev tools.

I’m afraid I’m punching above my weight on this one. :slightly_smiling_face: I’ve also not used the API yet, but I hope someone else can chime in. :crossed_fingers:

Just to circle back to this one via the scenic route… :slight_smile: but I have finally gotten round to using Postman and have successfully managed to change ownership of a small action post using the API :partying_face: :balloon: :birthday:

Could you possibly expand on this? Thanks.

I’ll try :slight_smile:

I grabbed the link of the topic where the small action post is, and popped /change-owner.json on the end, and added it to the top bar as a POST request (and entered my API-Key API-Username, plus Content-Type into the Headers tab):

I then looked up the post_id of the small action post I wanted to change in the post.json (eg. /t/tag-test-topic-one/762/2.json) and added the post_ids[] and username Keys and Values to the body tab, under ā€˜form-data’:

Then clicked the ā€˜Send’ button. :tada:

Cool. I’ve found Plans & Pricing | Postman API Platform and wonder – is it possible to do what you describe above without paying for their plans? I don’t think I could justify any expense for this small task :slight_smile:

I didn’t pay for it, so I think there must be a free option. :slight_smile: Maybe this page?

Though that’s only one way. I think you can also use curl to make requests from a terminal, though this I have not mastered yet. :person_shrugging:

There are many free software for making API requests like Postman. I use Insomnia. A matter of preferences and availability depending on your OS, mostly.

Here’s a simple example with curl from command line:

curl -X POST "https://your-discourse.com/posts.json" -H "Content-Type: application/json" -H "Api-Key: YOUR_API_KEY" -H "Api-Username: YOUR_USERNAME" -d "{\"title\": \"Test topic creation with the API\", \"raw\": \"And here's the topic's content\", \"category\": CATEGORY_ID }"