API:Changing wiki content
From MediaWiki.org
![]() |
This page is part of the MediaWiki API documentation. |
Language: | English • Deutsch • español • 日本語 • polski |
---|
Quick overview:
- Quick start guide
- FAQ
- Tutorial
- Formats
- Error reporting
- Restricting usage
- Authentication
- Queries
- Search suggestions
- Expanding templates and rendering
- Purging pages' caches
- Parameter information
- Changing wiki content
- Watchlist feed
- Extensions
- Using the API in MediaWiki and extensions
- Miscellaneous
- Implementation
- Client code
Changing wiki content through the API is enabled by default as of MediaWiki 1.14; it can be disabled by setting $wgEnableWriteAPI = false; in LocalSettings.php. In MediaWiki 1.13 and earlier, you have to explicitly enable the write API with $wgEnableWriteAPI = true;
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 action to view and restore deleted revisions.
- Protect about the action to change the protection levels for a page.
- Block about the actions to block and unblock a user.
- Watch about the action to watch and unwatch pages.
- E-mail about the action to send e-mail to other users.
- Patrol about the action to patrol changes.
- Import about the action to import pages from other wikis.
- User group membership about the action to add and remove users to and from groups.
- Upload about the action to upload files.
[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
- info: Editing of this wiki through the API is disabled. Make sure the
- code: writeapidenied
- info: You're not allowed to edit this wiki through the API