ScrollX Tag Page

Api:Forum Topics

0 sourcesWiki updated 12/30/2025
Browse all Api:Forum Topics images →

About Api:Forum Topics

Table of Contents

The following includes the details of how to interface with the forum topic records through the API.

01 Record field format

[hr]

NameTypeDetails
[code]id[/code]integer>0
[code]title[/code]string
[code]category_id[/code]integer[0,1,2]
[code]response_count[/code]integer
[code]min_level[/code]integerCorresponds to the level of user (API:Users).
[code]is_deleted[/code]boolean
[code]is_sticky[/code]boolean
[code]is_locked[/code]boolean
[code]creator_id[/code]integer>0
[code]updater_id[/code]integer>0
[code]created_at[/code]timestamp
[code]updated_at[/code]timestamp

Category ID

ValueDescription
0General
1Tags
2Bugs & features

Min level

Min level is an integer when stored in the database, but is used and presented by Danbooru as an enum. Unrestricted access, i.e. a min level of 0, is "None". Every other ID is the user level, with it's name being the titlecase version of that level's name. For example, a min level for Gold members is 30, and is presented to the user as "Gold".

02 Associated attributes

[hr]

The following is the list of relations that can be included in the API results (see Help:Common URL Parameters for more info):

NameTypeNumberAvailabilityDetails
[code]creator[/code]usersinglerequiredUser that created the forum topic.
[code]updater[/code]usersinglerequiredUser that last updated the forum topic.
[code]original_post[/code]forum postsinglerequiredThe first forum post of a forum topic.

03 Index

[hr]

Returns multiple forum topic records.

HTTP MethodGET
Base URL[code]/forum_topics.json[/code]
Typeread request
DescriptionThe default order is updated at descending.

Search attributes

Search parameters take the following format (see Help:Common URL Parameters for more info):

[code]

search[FIELD]=VALUE

[/code]

The following are the base fields along with their associated type. Check the syntax pages for all of the available variations.

  • Number syntax
  • [code]id[/code]
  • [code]response_count[/code]
  • [code]created_at[/code]
  • [code]updated_at[/code]
  • Text syntax
  • [code]title[/code]
  • Enum syntax
  • [code]category[/code]
  • Due to issue #6158, "Bugs & Features" is not searchable when using the search field [code]category[/code].
  • Use [code]category_id[/code] and the value of [code]2[/code] instead.
  • [code]min_level[/code]
  • User syntax
  • [code]creator[/code]
  • [code]updater[/code]
  • Boolean syntax
  • [code]is_deleted[/code]
  • [code]is_sticky[/code]
  • [code]is_locked[/code]
  • Chaining syntax
  • [code]forum_posts[/code]
  • [code]bulk_update_requests[/code]
  • [code]tag_aliases[/code]
  • [code]tag_implications[/code]

Special search parameters

The following are additional search fields.

  • [code]status[/code] - The status of an attached BUR. Can be: pending, approved, rejected.
  • [code]is_private[/code] - Shows topics that have a min level set or not (Help:Boolean Syntax).
  • [code]is_read[/code] - Shows topics that have been read by the user or not (Help:Boolean Syntax).

Search order

Using the search parameter [code]order[/code] with one of the following values changes the order of the results.

  • [code]sticky[/code] - Shows sticky topics first, sorted by updated at second.
  • [code]id[/code] - Orders by ID desc.
  • [code]custom[/code] - Help:Common URL Parameters
  • In order to use this order, [code]search[id][/code] must also be set with a list of comma-separated IDs.

04 Show

[hr]

Returns a single forum topic record.

HTTP MethodGET
Base URL[code]/forum_topics/$id.json[/code]
Typeread request
Description[code]$id[/code] is the forum topic ID.

05 Create

[hr]

Creates a single forum topic record.

HTTP MethodPOST
Base URL[code]/forum_topics.json[/code]
Typewrite request

Create parameters

Forum topic parameters take the following format (see Help:API Write Requests for more info):

[code]

forum_topic[FIELD]=VALUE

[/code]

  • Required:
  • [code]title[/code]
  • [code]category_id[/code] - Can be: 0, 1, 2.
  • [code]category[/code]
  • Alternate to [code]category_id[/code].
  • Can be
  • Optional
  • [code]original_post_attributes[body][/code] - DText that will be used to create a forum post entry at the same time.
  • Is a hash value, so the final parameter format is [code]forum_topic[original_post_attributes][body][/code]

Restricted to Moderator+

  • Optional
  • [code]min_level[/code] - Can be: 0, 40, 50
  • [code]is_sticky[/code]
  • [code]is_locked[/code]

06 Update

[hr]

Updates a single forum topic record.

HTTP MethodPUT/PATCH
Base URL[code]/forum_topics/$id.json[/code]
Typewrite request
Description[code]$id[/code] is the forum topic ID.

Update parameters

Accepts the same parameters as the Create action. All parameters are optional.

Original post attributes

Besides those, the Update action also accepts the following additional optional parameters. These can be used to update the opening post of a forum topic if the user is capable of doing that (original poster or Moderator+).

  • [code]original_post_attributes[id][/code] - The ID of the the first post on a topic.
  • [code]original_post_attributes[body][/code] - The body of the first post on a topic.

The final format of these parameters look like the following:

[code]

forum_topic[original_post_attributes][id]=VALUE

[/code]

The [code]id[/code] parameter is required if updating the opening post, and it must match the actual ID of the opening post, i.e. it is not changeable.

07 Delete

[hr]

Deletes a single forum topic record.

HTTP MethodDELETE
Base URL[code]/forum_topics/$id.json[/code]
Typewrite request
Description[code]$id[/code] is the forum topic ID. Restricted to Moderator+.

08 Undelete

[hr]

Undeletes a single forum topic record.

HTTP MethodPOST
Base URL[code]/forum_topics/$id/undelete.json[/code]
Typewrite request
Description[code]$id[/code] is the forum topic ID. Restricted to moderator+.

09 Mark all as read

[hr]

Marks every topic as being read.

HTTP MethodPOST
Base URL[code]/forum_topics/mark_all_as_read.json[/code]
Typewrite request

10 See also

[hr]

[hr]

Controller<https://github.com/danbooru/danbooru/blob/master/app/controllers/forum_topics_controller.rb>
Model<https://github.com/danbooru/danbooru/blob/master/app/models/forum_topic.rb>
Policy<https://github.com/danbooru/danbooru/blob/master/app/policies/forum_topic_policy.rb>

Api:Forum Topics Gallery

0 visible posts on page 1