MediaWiki API help

This is an auto-generated MediaWiki API documentation page.

Documentation and examples: https://www.mediawiki.org/wiki/Special:MyLanguage/API:Main_page

action=import

(main | import)
  • This module requires read rights.
  • This module requires write rights.
  • This module only accepts POST requests.
  • Source: MediaWiki
  • License: GPL-2.0-or-later

Import a page from another wiki, or from an XML file.

Note that the HTTP POST must be done as a file upload (i.e. using multipart/form-data) when sending a file for the xml parameter.

Specific parameters:
Other general parameters are available.
summary

Log entry import summary.

xml

Uploaded XML file.

Must be posted as a file upload using multipart/form-data.
interwikiprefix

For uploaded imports: interwiki prefix to apply to unknown usernames (and known users if assignknownusers is set).

interwikisource

For interwiki imports: wiki to import from.

One of the following values: commons, de, es, fr, it, meta, nost, outreachwiki, pl, test2wiki
interwikipage

For interwiki imports: page to import.

fullhistory

For interwiki imports: import the full history, not just the current version.

Type: boolean (details)
templates

For interwiki imports: import all included templates as well.

Type: boolean (details)
namespace

Import to this namespace. Cannot be used together with rootpage.

One of the following values: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 100, 101, 118, 119, 126, 127, 710, 711, 828, 829, 1728, 1729
assignknownusers

Assign edits to local users where the named user exists locally.

Type: boolean (details)
rootpage

Import as subpage of this page. Cannot be used together with namespace.

tags

Change tags to apply to the entry in the import log and to the null revision on the imported pages.

Values (separate with | or alternative): AFCH, AWB, Addition of protection template to non-protected page, AntiVandal script, Deputy, JWB, Newcomer task, New user adding protection template, ProveIt edit, RedWarn, Ultraviolet, WPCleaner, WikiLoop Battlefield, bot trial, changing time or duration, convenient-discussions, editProtectedHelper, excessive whitespace, fixed lint errors, huggle, invalid-timedtext-edit, large non-free file, massmove, moveToDraft, new user moving page out of userspace, pageswap, possible birth or death date change, pronoun-change, rapid date format changes, self-published-blog, self-published source, shortdesc helper, talk banner shell conversion, twinkle
token

A "csrf" token retrieved from action=query&meta=tokens

This parameter is required.