# Is there a way to modify Discourse endpoints through plugin?

**URL:** https://meta.discourse.org/t/is-there-a-way-to-modify-discourse-endpoints-through-plugin/105967
**Category:** Development
**Created:** [January 8, 2019, 7:57am UTC](https://meta.discourse.org/t/is-there-a-way-to-modify-discourse-endpoints-through-plugin/105967 "2019-01-08T07:57:17Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Chong\_An\_Chen](https://avatars.discourse-cdn.com/v4/letter/c/59ef9b/32.png) [@Chong\_An\_Chen](https://meta.discourse.org/u/Chong_An_Chen)
#### Post date: [January 8, 2019, 7:57am UTC](https://meta.discourse.org/t/is-there-a-way-to-modify-discourse-endpoints-through-plugin/105967/1 "2019-01-08T07:57:19Z")

</div>

for example, I want to change the result on `/latest.json` endpoint,  
and I found the controller is `list_controller.rb`,  
is there a way to modify related functions through plugin?

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [January 8, 2019, 2:37pm UTC](https://meta.discourse.org/t/is-there-a-way-to-modify-discourse-endpoints-through-plugin/105967/2 "2019-01-08T14:37:55Z")

</div>

There’s almost nothing a plugin can’t do. The question is generally more: is it a good idea ? is it maintainable?

What have you tried so far ?

A good starting point it to look at our [all-the-plugins repo](https://github.com/discourse/all-the-plugins) and search for similar patterns.

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [January 8, 2019, 2:45pm UTC](https://meta.discourse.org/t/is-there-a-way-to-modify-discourse-endpoints-through-plugin/105967/3 "2019-01-08T14:45:29Z")

</div>

It’s best to look at an example, I believe you can amend the serialisers:

Consider this:

> <https://github.com/discourse/discourse/blob/acd1693dac1bff6ff50250d942134bc48a27ff14/app/serializers/topic_list_item_serializer.rb>

With, for example, the Topic List Previews Plugin edits, from here:

[https://github.com/angusmcleod/discourse-topic-previews/blob/master/serializers/topic\_list\_item\_edits.rb](https://github.com/angusmcleod/discourse-topic-previews/blob/master/serializers/topic_list_item_edits.rb)

This appends a load of extra attributes. Try it and take a look.

---

<div class="post-metadata">

### Author: ![Chong\_An\_Chen](https://avatars.discourse-cdn.com/v4/letter/c/59ef9b/32.png) [@Chong\_An\_Chen](https://meta.discourse.org/u/Chong_An_Chen)
#### Post date: [January 8, 2019, 2:49pm UTC](https://meta.discourse.org/t/is-there-a-way-to-modify-discourse-endpoints-through-plugin/105967/4 "2019-01-08T14:49:52Z")

</div>

ok, thank you so much!
