API:Changing wiki content

From MediaWiki.org

Jump to: navigation, search
This page is part of the MediaWiki API documentation.
MediaWiki API


Changing wiki content through the API is possible, but must be explicitly enabled by setting $wgEnableWriteAPI = true; in LocalSettings.php. This feature is currently disabled on Wikimedia wikis.

Please see appropriate subsection for detailed information for each module.

  • Edit about the action to create new articles or modify existing ones.
  • Move about the action to rename or move articles.
  • Rollback about the action to rollback the last series of contributions to a page.
  • Delete about the action to delete existing articles.
  • Undelete about the actions to view and restore deleted revisions.
  • Protect about the actions to change the protection levels for a page.
  • Block about the actions to block and unblock a user.

[edit] Possible errors

Some wikis restrict the use of these modules to certain groups of users, or disallow it altogether. All aforementioned modules can return the following errors:

  • code: noapiwrite
    • info: Editing of this wiki through the API is disabled. Make sure the $wgEnableWriteAPI=true; statement is included in the wiki's LocalSettings.php file
  • code: writeapidenied
    • info: You're not allowed to edit this wiki through the API
Personal tools