# Timed Topic Field Explanations on the API

**URL:** https://meta.discourse.org/t/timed-topic-field-explanations-on-the-api/170551
**Category:** Development
**Tags:** rest-api
**Created:** [November 18, 2020, 11:04pm UTC](https://meta.discourse.org/t/timed-topic-field-explanations-on-the-api/170551 "2020-11-18T23:04:32Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mbaker341997](https://avatars.discourse-cdn.com/v4/letter/m/c6cbf5/32.png) [@mbaker341997](https://meta.discourse.org/u/mbaker341997)
#### Post date: [November 18, 2020, 11:04pm UTC](https://meta.discourse.org/t/timed-topic-field-explanations-on-the-api/170551/1 "2020-11-18T23:04:32Z")

</div>

For my project I would like to programmatically create scheduled topics. I was thinking of using the [timed topic api endpoint](https://docs.discourse.org/#tag/Topics/paths/~1t~1%7Bid%7D~1timer/post), 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](https://docs.discourse.org/#tag/Topics/paths/~1t~1%7Bid%7D~1status/put) 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

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [November 19, 2020, 10:30am UTC](https://meta.discourse.org/t/timed-topic-field-explanations-on-the-api/170551/2 "2020-11-19T10:30:49Z")

</div>

> [@mbaker341997](#):
>
> status\_type

`app/models/topic_timer.rb`:

```plaintext
close
open
publish_to_category
delete
reminder
bump
delete_replies

```

> [@mbaker341997](#):
>
> time - what format is this supposed to be in? All it says is “string”.

> [@mbaker341997](#):
>
> based\_on\_last\_post - I have no idea what this boolean flag means

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.

---

<div class="post-metadata">

### Author: ![mbaker341997](https://avatars.discourse-cdn.com/v4/letter/m/c6cbf5/32.png) [@mbaker341997](https://meta.discourse.org/u/mbaker341997)
#### Post date: [November 19, 2020, 4:54pm UTC](https://meta.discourse.org/t/timed-topic-field-explanations-on-the-api/170551/3 "2020-11-19T16:54:28Z")

</div>

Thanks reference to the comments: [discourse/app/models/topic.rb at 0863c36221130b161d63562a58ac97171475dca5 · discourse/discourse · GitHub](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
