jsondiscourse

Changing a discourse topic slug via api


We’re moving a Wordpress Sabai Discussion forum to Discourse.

Within Sabai, a title can be substantially different from the slug.

I’ve tried passing in a different slug and tried a topic_slug on a POST. I’ve tried passing in a different slug and tried a topic_slug on a PUT. The slug is not changing.

Example {“title”: “This is a test question for the system”, “slug”:“test-question”}

With the discourse API how can you make the slug to be substantially different from the title?


Solution

  • From Régis Hanol https://meta.discourse.org/u/zogstrip/summary

    https://meta.discourse.org/t/changing-a-topic-slug-via-api/101893/2?u=csmu

    The slug is automatically generated from the title of the topic.

    I don’t think there’s a way to set the slug via the API.