Most Flow API read and write interactions are submodules of action=flow. Flow also implements a query property flowinfo and a parsing utility module flow-parsoid-utils.



prop=flowinfo (details below) is one way to check if Flow is enabled on the specified pages.

You can alternatively use prop=info to retrieve page info including content model. The content model will be 'flow-board' if it's enabled. Compare Special:ApiSandbox#action=query&titles=Project:Village+pump&prop=info and Special:ApiSandbox#Extension:StructuredDiscussions/API&prop=info.

In client-side JavaScript (for gadgets and user scripts), call mw.config.get( 'wgPageContentModel' ).

prop=flowinfo (fli)

(main | query | flowinfo)
  • This module is deprecated.
  • This module requires read rights.
  • Source: Flow
  • License: GPL-2.0-or-later

Get basic Structured Discussions information about a page.




(main | flow)

Allows actions to be taken on Structured Discussions pages.

Specific parameters:
Other general parameters are available.

The Structured Discussions submodule to invoke.

Edits a board description.
Edits a post's content.
Edits a topic's title.
Edits a topic summary's content.
Lock or unlock a Structured Discussions topic.
Moderates a Structured Discussions post.
Moderates a Structured Discussions topic.
Creates a new Structured Discussions topic on the given workflow.
Replies to a post.
Retrieve information necessary to undo description edits.
Retrieve information necessary to undo post edit.
Retrieve information necessary to undo topic summary edits.
View a board description.
View a post.
View the revision history of a post.
View a topic.
View the revision history of a topic.
View a topic summary.
View a list of topics.
Deprecated. Deprecated in favor of action=flow&submodule=lock-topic.
This parameter is required.
One of the following values: edit-header, edit-post, edit-title, edit-topic-summary, lock-topic, moderate-post, moderate-topic, new-topic, reply, undo-edit-header, undo-edit-post, undo-edit-topic-summary, view-header, view-post-history, view-post, view-topic-history, view-topic-summary, view-topic, view-topiclist, close-open-topic

The page to take the action on.

Default: Topic:Flow-enabled_page

A token retrieved from action=query&meta=tokens

Default: (empty)

(Since this edit operation has to be an HTTP POST, the link in the generated example above won't work.)



In a reply you're replying to a particular post in a workflow (a topic). Flow objects are identified by UUIDs see Flow/Architecture.

To reply to a topic

  • you'll need a token. Flow recently switched to using the regular 'edit' token for most operations, so you can use mw.api.postWithEditToken to get the editing token if it hasn't been cached yet in the session. it's cached.
  • Issue a flow API request with flowaction=reply, identifying the topic workflow. The parameters for a reply include the topic and the post.
repcontent=My reply, with ''wikitext''.

  • Set render=true if you want the server to respond with the "fully-decorated" HTML to interact with the new post (preview buttons, actions, etc.).
  • UUID format will soon change to be more compact, using 88-bit represented as alphadecimal.
  • Obviously you get the topic and post to respond by making API queries, rather than hardcoding these numbers.

Note that a wiki may store Flow content with $wgFlowContentFormat 'html' or 'wikitext', but in any edit submission you must submit wikitext.

If successful, the server responds with the post-id of the new post, and the HTML to insert into the DOM.

Note this API request doesn't name the page on which the topic appears. Users interact with topics on a Flow board with a wiki page name, but a topic might (eventually) appear on multiple pages, e.g. a user's "subscription feed".

On WMF wikis, Flow stores post content as HTML with embedded Parsoid markup so that something resembling the original wikitext can be reconstituted for editing. This will not be the case on all wikis, others might store as wikitext.

Block requests


When you make a "Block" API request such as &submodule=new-topic, the API normally returns a flow.new-topic.result.topiclist containing updated information about the top 10 topics on the board, including their HTML. This allows the Flow board to redisplay the board contents, but it can be a lot of data.

If you are just trying to add a topic and you're not interested in the board contents, you should pass the flag ntmetadataonly=true (gerrit:180588)

Flow returns the metadata in a top-level flow.newtopic.committed key in the API response. For consistency the information about the new content is returned as topic-page, topic-id, topic-revision-id, post-id, header-post-id (but see phab:T84954), etc.

Editing the board header


If you want to update the Flow board header, it's similar

  • make a GET request action=flow, submodule=view-header, vhformat=wikitext to get the current contents. This will return a flow.view-header.result.header.revision including a UUID of the most recent version of the header in revisionId, and its contents in content.content.
  • make a POST request, action=flow, submodule=edit-header. Set ehprev_revision to the revision returned by the GET request and set ehcontent to your updated wikitext.

The update may fail with error.code = 'prev_revision' if someone else updated this board's header between the two requests; if so the return has a prev_revision.revision_id giving the new latest revision, so you can retry with that. However, you should avoid clobbering the previous editors' work (e.g. by presenting an edit conflict form, or re-running the algorithm if a bot is making the requests, etc.).

Posting a new topic from on-wiki JavaScript


If an on-wiki user script or gadget needs to be post a new topic, the best way is to use MessagePoster. The advantage is that you don't need to know whether the talk pages uses old-style talk pages or Flow. It will work either way (LiquidThreads is not supported).

mw.loader.using( [ 'mediawiki.Title', 'mediawiki.messagePoster' ], function () {
    var title = new mw.Title( 'Talk:MyTalkPage' );
    var posterPromise = mw.messagePoster.factory.create( title );
    posterPromise.done( function ( poster ) {
        poster.post( 'This is the topic title', 'This is the body of a message posted with MessagePoster' );
    } );
} );




(main | flow-parsoid-utils)

Convert text between wikitext and HTML.

Specific parameters:
Other general parameters are available.

Format to convert content from.

This parameter is required.
One of the following values: html, wikitext

Format to convert content to.

This parameter is required.
One of the following values: html, wikitext

Content to be converted.

This parameter is required.

Title of the page. Cannot be used together with pageid.


ID of the page. Cannot be used together with title.

Type: integer