Timed Topic Field Explanations on the API

For my project I would like to programmatically create scheduled topics. I was thinking of using the timed topic api endpoint, but I’m a little confused about some of the fields.

  • id path parameter - straightforward, topic id that’s being scheduled
  • time - what format is this supposed to be in? All it says is “string”.
  • status_type - not sure what its possible values is . i would think it would be similar to the status enum in the update status api but the example on the timer is “publish_to_category”, which isn’t an option in the enum.
  • based_on_last_post - I have no idea what this boolean flag means
  • category_id - straightforward

app/models/topic_timer.rb:

close
open
publish_to_category
delete
reminder
bump
delete_replies

Found some comment in code:

  • An integer, which is the number of hours from now to update the topic’s status.
  • A timestamp, like “2013-11-25 13:00”, when the topic’s status should update.
  • A timestamp with timezone in JSON format. (e.g., “2013-11-26T21:00:00.000Z”)
  • based_on_last_post: True if time should be based on timestamp of the last post.
2 Likes

Thanks reference to the comments: https://github.com/discourse/discourse/blob/0863c36221130b161d63562a58ac97171475dca5/app/models/topic.rb#L1293

set_or_create_timer method in models/topic.rb contains the logic supporting this API

1 Like