# How to create a plugin with backend API calls to populate composer while drafting?

**URL:** https://meta.discourse.org/t/how-to-create-a-plugin-with-backend-api-calls-to-populate-composer-while-drafting/356970
**Category:** Development
**Created:** [March 12, 2025, 2:38pm UTC](https://meta.discourse.org/t/how-to-create-a-plugin-with-backend-api-calls-to-populate-composer-while-drafting/356970 "2025-03-12T14:38:02Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![fabkosta](https://avatars.discourse-cdn.com/v4/letter/f/b3f665/32.png) [@fabkosta](https://meta.discourse.org/u/fabkosta)
#### Post date: [March 12, 2025, 5:21pm UTC](https://meta.discourse.org/t/how-to-create-a-plugin-with-backend-api-calls-to-populate-composer-while-drafting/356970/2 "2025-03-12T17:21:18Z")

</div>

In the meanwhile I found a few resources that I found informative. I really wish these could be put more prominently in the “How to write a plugin” tutorial. For beginners it is not obvious they even exist.

1. Discourse’s own API (not helpful for writing plugins, but still relevant for beginners): [https://docs.discourse.org/](https://docs.discourse.org/)
2. Client Plugin API (not helpful for writing a plugin’s backend, but makes things definitely easier for frontend):  
[A versioned API for client side plugins](https://meta.discourse.org/t/a-versioned-api-for-client-side-plugins/40051)  
[https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/lib/plugin-api.gjs](https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/lib/plugin-api.gjs)

I also understood that Backend Plugin API is essentially Rails or Ruby - but it’s not clear how exactly frontend and backend interact with each other, or where the initial “hook” for the backend is. Sure, there’s a plugin.rb to be placed, but I’m left wondering whether there’s any docs on what’s the entry point into this file. Maybe that’s totally obvious for Ruby on Rails programmers, but I’m not one of them, so it’s a steep entry here.

---

_[View the full topic](https://meta.discourse.org/t/how-to-create-a-plugin-with-backend-api-calls-to-populate-composer-while-drafting/356970)._
