topics

Documentation for discourse JSON objects

License: MIT

topics.NotificationLevel

Discourse Topic Notification Levels

Kind: static enum property of topics
Read only: true
Properties

Name Default Description
muted 0 Topic is Muted, no notifications will be generated
regular 1 Topic has no special notification status
tracking 2 New posts/read position are tracked but new post notifications aren't generated
watching 3 New Posts trigger notifications

topics.NotificationReason

Discourse Topic Notification Reasons

Kind: static enum property of topics
Read only: true
Properties

Name Default Description
created_topic 1 User created the topic
user_changed 2 User set the notification type themselves
user_interacted 3 Notification status was set by user interaction
created_post 4 Notification status was set because user posted in topic
auto_watch 5 Notification was set because user has autowatch set
auto_watch_category 6 Notification was set because user has autowatch set for category
auto_mute_category 7 Notification was set because user has automute set for category
auto_track_category 8 Notification was set because user has autotrack set for category
plugin_changed 9 Notification was set by plugin

topics.Archetype

Discourse Archetype

Kind: static enum property of topics
Read only: true
Properties

Name Default Description
regular regular Regular Archetype
private_message private_message Private Message Archetype

topics.Participant ⇐ external.users.UserSummary

Discourse Topic Participant

Kind: static property of topics
Extends: external.users.UserSummary

Param Type Description
post_count number Number of posts user has made in topic

topics.PostStream : object

Stream of posts

Kind: static typedef of topics

Param Type Description
posts Array.<external.posts.Post> A single chunk of posts from thread
stream Array.<number> Post Ids for all posts in thread

topics.TopicSummary : object

Discourse Topic Summary

Kind: static typedef of topics

Param Type Description
id number Topic Id.
title string Topic Title
fancy_title string HTML encoded title
slug string URL safe slug of topic title
posts_count number Count of posts in topic
reply_count number Count of replies to Topic OP
highest_post_number number Post Number of the most recent post
image_url string | null Unsure, appears to always be null
created_at string ISO formatted creation datetime
last_posted_at string ISO formatted datetime of latest post
bumped boolean Topic has been bumped (what does this mean?)
bumped_at string ISO formatted datetime of last bump
unseen boolean Has topic been seen by current user?
last_read_post_number number Post Number of last read post by current user
unread number Number of posts that have not been read that were created before last visit to topic
new_posts number Number of posts created since last visit to topic
pinned boolean Is topic pinned?
unpinned string | null ISO formatted timestamp that the current user dismissed the pin on the topic
visible boolean Is topic visible?
closed boolean Is topic closed?
archived boolean Is topic archived?
bookmarked boolean Are there any bookmarks in the topic?
liked boolean Has topic been liked by current user?
like_count number Count of likes in the topic
views number Count of topic views
category_id number Id of the category the post belongs to
notification_level NotificationLevel Topic notification level
archetype Archetype Topic Archetype

Discourse Topic Link

Kind: static typedef of topics

Param Type Description
url string Url of the link
title string Title of the link (may be scraped from the linked page)
fancy_title string HTML safe title
internal boolean Is link internal to this discourse instance?
attachment boolean Is this link an attachment?
reflection boolean Is this an incoming, internal link?
clicks number Number of times link has been visited
user_id number Use Id of the posting user
domain string Domain of the link

topics.TopicDetails : object

Discourse Topic Details

Kind: static typedef of topics

Param Type Description
auto_close_at string | null ISO formatted time that topic will autoclose at
auto_close_hours number | null Number of hours before topic closes relative to topic creation
auto_close_based_on_last_post boolean If set auto_close_hours is relative to latest post
created_by external.users.UserSummary User that created topic
last_poster external.users.UserSummary User that created last post
participants Array.<Participant> Topic Top Participants
suggested_topics Array.<TopicSummary> Suggested topics for this topic
links Array.<Link> Links posted within the topic
notification_level NotificationLevel Topic notification level
notification_reason_id NotificationReason Reason for value of notification_level
can_edit boolean Can current user edit topic title?
can_invite_to boolean Can current user issue invitations to topic?
can_create_post boolean Can current user reply to topic?
can_reply_as_new_topic boolean Can current user reply as new topic?
can_flag_topic boolean Can current user issue flags against topic?

topics.Topic : object

Discourse Topic

Available at /t/slug/<topic id>/<post number>.json

Kind: static typedef of topics

Param Type Description
post_stream PostStream Stream of posts that were loaded for this request
id number Topic Id.
title string Topic Title
fancy_title string HTML encoded title
posts_count number Count of posts in topic
created_at string ISO formatted creation datetime
views number Count of topic views
reply_count number Count of replies to Topic OP
participant_count number Count of unique users that participate in this topic
has_summary boolean Does the topic have a summary?
word_count number Unsure, Word count of what?
deleted_at strung | null ISO formatted datetime the topic was deleted
pending_posts_count number Unsure, seems to always be zero
user_id number User Id of the Topic Owner
draft string | null Raw of in progress draft
draft_key string Key to use when composing draft
draft_sequence number Unsure, seems to be ordinal for number of drafts in topic
posted boolean Unsure, seems to always be true
unpinned string | null ISO formatted timestamp that the current user dismissed the pin on the topic
pinned_globally boolean Has topic been pinned globally?
pinned boolean Is topic pinned?
pinned_at string | null ISO formatted datetime topic was pinned
details TopicDetails Details about this topic
deleted_by string | null Username of the deleting user
actions_summary Array.<external.posts.ActionSummary> Summary of actions on Topic
chunk_size number Number of posts that belong in each chunk of posts