MediaWiki API help

This is an auto-generated MediaWiki API documentation page.

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

(main | wbsetsitelink)
  • This module requires read rights.
  • This module requires write rights.
  • This module only accepts POST requests.
  • Source: Wikibase Repository
  • License: GPL-2.0+

Associates an article on a wiki with a Wikibase item or removes an already made such association.

Parameters:
id

The identifier for the entity, including the prefix. Use either 'id' or 'site' and 'title' together.

site

An identifier for the site on which the page resides. Use together with 'title' to make a complete sitelink.

One of the following values: aawiki, abwiki, acewiki, adywiki, afwiki, afwikiquote, akwiki, alswiki, alswikiquote, amwiki, amwikiquote, angwiki, angwikiquote, angwikisource, anwiki, arcwiki, arwiki, arwikinews, arwikiquote, arwikisource, arzwiki, astwiki, astwikiquote, aswiki, aswikisource, avwiki, aywiki, azbwiki, azwiki, azwikiquote, azwikisource, barwiki, bat_smgwiki, bawiki, bclwiki, be_x_oldwiki, bewiki, bewikiquote, bewikisource, bgwiki, bgwikinews, bgwikiquote, bgwikisource, bhwiki, biwiki, bjnwiki, bmwiki, bmwikiquote, bnwiki, bnwikisource, bowiki, bpywiki, brwiki, brwikiquote, brwikisource, bswiki, bswikinews, bswikiquote, bswikisource, bugwiki, bxrwiki, cawiki, cawikinews, cawikiquote, cawikisource, cbk_zamwiki, cdowiki, cebwiki, cewiki, chowiki, chrwiki, chwiki, chywiki, ckbwiki, commonswiki, cowiki, cowikiquote, crhwiki, crwiki, crwikiquote, csbwiki, cswiki, cswikinews, cswikiquote, cswikisource, cuwiki, cvwiki, cywiki, cywikiquote, cywikisource, dawiki, dawikiquote, dawikisource, dewiki, dewikinews, dewikiquote, dewikisource, dewikivoyage, diqwiki, dsbwiki, dvwiki, dzwiki, eewiki, elwiki, elwikinews, elwikiquote, elwikisource, elwikivoyage, emlwiki, enwiki, enwikinews, enwikiquote, enwikisource, enwikivoyage, eowiki, eowikinews, eowikiquote, eowikisource, eswiki, eswikinews, eswikiquote, eswikisource, eswikivoyage, etwiki, etwikiquote, etwikisource, euwiki, euwikiquote, extwiki, fawiki, fawikinews, fawikiquote, fawikisource, fawikivoyage, ffwiki, fiu_vrowiki, fiwiki, fiwikinews, fiwikiquote, fiwikisource, fjwiki, fowiki, fowikisource, frpwiki, frrwiki, frwiki, frwikinews, frwikiquote, frwikisource, frwikivoyage, furwiki, fywiki, gagwiki, ganwiki, gawiki, gawikiquote, gdwiki, glkwiki, glwiki, glwikiquote, glwikisource, gnwiki, gomwiki, gotwiki, guwiki, guwikiquote, guwikisource, gvwiki, hakwiki, hawiki, hawwiki, hewiki, hewikinews, hewikiquote, hewikisource, hewikivoyage, hifwiki, hiwiki, hiwikiquote, howiki, hrwiki, hrwikiquote, hrwikisource, hsbwiki, htwiki, htwikisource, huwiki, huwikinews, huwikiquote, huwikisource, hywiki, hywikiquote, hywikisource, hzwiki, iawiki, idwiki, idwikiquote, idwikisource, iewiki, igwiki, iiwiki, ikwiki, ilowiki, iowiki, iswiki, iswikiquote, iswikisource, itwiki, itwikinews, itwikiquote, itwikisource, itwikivoyage, iuwiki, jamwiki, jawiki, jawikinews, jawikiquote, jawikisource, jbowiki, jvwiki, kaawiki, kabwiki, kawiki, kawikiquote, kbdwiki, kgwiki, kiwiki, kjwiki, kkwiki, kkwikiquote, klwiki, kmwiki, knwiki, knwikiquote, knwikisource, koiwiki, kowiki, kowikinews, kowikiquote, kowikisource, krcwiki, krwiki, krwikiquote, kshwiki, kswiki, kswikiquote, kuwiki, kuwikiquote, kvwiki, kwwiki, kwwikiquote, kywiki, kywikiquote, ladwiki, lawiki, lawikiquote, lawikisource, lbewiki, lbwiki, lbwikiquote, lezwiki, lgwiki, lijwiki, liwiki, liwikiquote, liwikisource, lmowiki, lnwiki, lowiki, lrcwiki, ltgwiki, ltwiki, ltwikiquote, ltwikisource, lvwiki, maiwiki, map_bmswiki, mdfwiki, mgwiki, mhrwiki, mhwiki, minwiki, miwiki, mkwiki, mkwikisource, mlwiki, mlwikiquote, mlwikisource, mnwiki, mowiki, mrjwiki, mrwiki, mrwikiquote, mrwikisource, mswiki, mtwiki, muswiki, mwlwiki, myvwiki, mywiki, mznwiki, nahwiki, napwiki, nawiki, nawikiquote, nds_nlwiki, ndswiki, ndswikiquote, newiki, newwiki, ngwiki, nlwiki, nlwikinews, nlwikiquote, nlwikisource, nlwikivoyage, nnwiki, nnwikiquote, novwiki, nowiki, nowikinews, nowikiquote, nowikisource, nrmwiki, nsowiki, nvwiki, nywiki, ocwiki, omwiki, orwiki, orwikisource, oswiki, pagwiki, pamwiki, papwiki, pawiki, pcdwiki, pdcwiki, pflwiki, pihwiki, piwiki, plwiki, plwikinews, plwikiquote, plwikisource, plwikivoyage, pmswiki, pnbwiki, pntwiki, pswiki, ptwiki, ptwikinews, ptwikiquote, ptwikisource, ptwikivoyage, quwiki, quwikiquote, rmwiki, rmywiki, rnwiki, roa_rupwiki, roa_tarawiki, rowiki, rowikinews, rowikiquote, rowikisource, rowikivoyage, ruewiki, ruwiki, ruwikinews, ruwikiquote, ruwikisource, ruwikivoyage, rwwiki, sahwiki, sahwikisource, sawiki, sawikiquote, sawikisource, scnwiki, scowiki, scwiki, sdwiki, sdwikinews, sewiki, sgwiki, shwiki, simplewiki, simplewikiquote, siwiki, skwiki, skwikiquote, skwikisource, slwiki, slwikiquote, slwikisource, smwiki, snwiki, sowiki, sqwiki, sqwikinews, sqwikiquote, srnwiki, srwiki, srwikinews, srwikiquote, srwikisource, sswiki, stqwiki, stwiki, suwiki, suwikiquote, svwiki, svwikinews, svwikiquote, svwikisource, svwikivoyage, swwiki, szlwiki, tawiki, tawikinews, tawikiquote, tawikisource, tetwiki, tewiki, tewikiquote, tewikisource, tgwiki, thwiki, thwikinews, thwikiquote, thwikisource, tiwiki, tkwiki, tkwikiquote, tlwiki, tnwiki, towiki, tpiwiki, trwiki, trwikinews, trwikiquote, trwikisource, tswiki, ttwiki, ttwikiquote, tumwiki, twwiki, tyvwiki, tywiki, udmwiki, ugwiki, ugwikiquote, ukwiki, ukwikinews, ukwikiquote, ukwikisource, ukwikivoyage, urwiki, urwikiquote, uzwiki, uzwikiquote, vecwiki, vecwikisource, vepwiki, vewiki, viwiki, viwikiquote, viwikisource, viwikivoyage, vlswiki, vowiki, vowikiquote, warwiki, wawiki, wikidatawiki, wowiki, wowikiquote, wuuwiki, xalwiki, xhwiki, xmfwiki, yiwiki, yiwikisource, yowiki, zawiki, zawikiquote, zeawiki, zh_classicalwiki, zh_min_nanwiki, zh_min_nanwikiquote, zh_min_nanwikisource, zh_yuewiki, zhwiki, zhwikinews, zhwikiquote, zhwikisource, zhwikivoyage, zuwiki
title

Title of the page to associate. Use together with 'site' to make a complete sitelink.

baserevid

The numeric identifier for the revision to base the modification on. This is used for detecting conflicts during save.

Type: integer
summary

Summary for the edit. Will be prepended by an automatically generated comment. The length limit of the autocomment together with the summary is 260 characters. Be aware that everything above that limit will be cut off.

token

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

This parameter is required.
bot

Mark this edit as bot. This URL flag will only be respected if the user belongs to the group "bot".

Type: boolean (details)
linksite

The identifier of the site on which the article to link resides

This parameter is required.
One of the following values: aawiki, abwiki, acewiki, adywiki, afwiki, afwikiquote, akwiki, alswiki, alswikiquote, amwiki, amwikiquote, angwiki, angwikiquote, angwikisource, anwiki, arcwiki, arwiki, arwikinews, arwikiquote, arwikisource, arzwiki, astwiki, astwikiquote, aswiki, aswikisource, avwiki, aywiki, azbwiki, azwiki, azwikiquote, azwikisource, barwiki, bat_smgwiki, bawiki, bclwiki, be_x_oldwiki, bewiki, bewikiquote, bewikisource, bgwiki, bgwikinews, bgwikiquote, bgwikisource, bhwiki, biwiki, bjnwiki, bmwiki, bmwikiquote, bnwiki, bnwikisource, bowiki, bpywiki, brwiki, brwikiquote, brwikisource, bswiki, bswikinews, bswikiquote, bswikisource, bugwiki, bxrwiki, cawiki, cawikinews, cawikiquote, cawikisource, cbk_zamwiki, cdowiki, cebwiki, cewiki, chowiki, chrwiki, chwiki, chywiki, ckbwiki, commonswiki, cowiki, cowikiquote, crhwiki, crwiki, crwikiquote, csbwiki, cswiki, cswikinews, cswikiquote, cswikisource, cuwiki, cvwiki, cywiki, cywikiquote, cywikisource, dawiki, dawikiquote, dawikisource, dewiki, dewikinews, dewikiquote, dewikisource, dewikivoyage, diqwiki, dsbwiki, dvwiki, dzwiki, eewiki, elwiki, elwikinews, elwikiquote, elwikisource, elwikivoyage, emlwiki, enwiki, enwikinews, enwikiquote, enwikisource, enwikivoyage, eowiki, eowikinews, eowikiquote, eowikisource, eswiki, eswikinews, eswikiquote, eswikisource, eswikivoyage, etwiki, etwikiquote, etwikisource, euwiki, euwikiquote, extwiki, fawiki, fawikinews, fawikiquote, fawikisource, fawikivoyage, ffwiki, fiu_vrowiki, fiwiki, fiwikinews, fiwikiquote, fiwikisource, fjwiki, fowiki, fowikisource, frpwiki, frrwiki, frwiki, frwikinews, frwikiquote, frwikisource, frwikivoyage, furwiki, fywiki, gagwiki, ganwiki, gawiki, gawikiquote, gdwiki, glkwiki, glwiki, glwikiquote, glwikisource, gnwiki, gomwiki, gotwiki, guwiki, guwikiquote, guwikisource, gvwiki, hakwiki, hawiki, hawwiki, hewiki, hewikinews, hewikiquote, hewikisource, hewikivoyage, hifwiki, hiwiki, hiwikiquote, howiki, hrwiki, hrwikiquote, hrwikisource, hsbwiki, htwiki, htwikisource, huwiki, huwikinews, huwikiquote, huwikisource, hywiki, hywikiquote, hywikisource, hzwiki, iawiki, idwiki, idwikiquote, idwikisource, iewiki, igwiki, iiwiki, ikwiki, ilowiki, iowiki, iswiki, iswikiquote, iswikisource, itwiki, itwikinews, itwikiquote, itwikisource, itwikivoyage, iuwiki, jamwiki, jawiki, jawikinews, jawikiquote, jawikisource, jbowiki, jvwiki, kaawiki, kabwiki, kawiki, kawikiquote, kbdwiki, kgwiki, kiwiki, kjwiki, kkwiki, kkwikiquote, klwiki, kmwiki, knwiki, knwikiquote, knwikisource, koiwiki, kowiki, kowikinews, kowikiquote, kowikisource, krcwiki, krwiki, krwikiquote, kshwiki, kswiki, kswikiquote, kuwiki, kuwikiquote, kvwiki, kwwiki, kwwikiquote, kywiki, kywikiquote, ladwiki, lawiki, lawikiquote, lawikisource, lbewiki, lbwiki, lbwikiquote, lezwiki, lgwiki, lijwiki, liwiki, liwikiquote, liwikisource, lmowiki, lnwiki, lowiki, lrcwiki, ltgwiki, ltwiki, ltwikiquote, ltwikisource, lvwiki, maiwiki, map_bmswiki, mdfwiki, mgwiki, mhrwiki, mhwiki, minwiki, miwiki, mkwiki, mkwikisource, mlwiki, mlwikiquote, mlwikisource, mnwiki, mowiki, mrjwiki, mrwiki, mrwikiquote, mrwikisource, mswiki, mtwiki, muswiki, mwlwiki, myvwiki, mywiki, mznwiki, nahwiki, napwiki, nawiki, nawikiquote, nds_nlwiki, ndswiki, ndswikiquote, newiki, newwiki, ngwiki, nlwiki, nlwikinews, nlwikiquote, nlwikisource, nlwikivoyage, nnwiki, nnwikiquote, novwiki, nowiki, nowikinews, nowikiquote, nowikisource, nrmwiki, nsowiki, nvwiki, nywiki, ocwiki, omwiki, orwiki, orwikisource, oswiki, pagwiki, pamwiki, papwiki, pawiki, pcdwiki, pdcwiki, pflwiki, pihwiki, piwiki, plwiki, plwikinews, plwikiquote, plwikisource, plwikivoyage, pmswiki, pnbwiki, pntwiki, pswiki, ptwiki, ptwikinews, ptwikiquote, ptwikisource, ptwikivoyage, quwiki, quwikiquote, rmwiki, rmywiki, rnwiki, roa_rupwiki, roa_tarawiki, rowiki, rowikinews, rowikiquote, rowikisource, rowikivoyage, ruewiki, ruwiki, ruwikinews, ruwikiquote, ruwikisource, ruwikivoyage, rwwiki, sahwiki, sahwikisource, sawiki, sawikiquote, sawikisource, scnwiki, scowiki, scwiki, sdwiki, sdwikinews, sewiki, sgwiki, shwiki, simplewiki, simplewikiquote, siwiki, skwiki, skwikiquote, skwikisource, slwiki, slwikiquote, slwikisource, smwiki, snwiki, sowiki, sqwiki, sqwikinews, sqwikiquote, srnwiki, srwiki, srwikinews, srwikiquote, srwikisource, sswiki, stqwiki, stwiki, suwiki, suwikiquote, svwiki, svwikinews, svwikiquote, svwikisource, svwikivoyage, swwiki, szlwiki, tawiki, tawikinews, tawikiquote, tawikisource, tetwiki, tewiki, tewikiquote, tewikisource, tgwiki, thwiki, thwikinews, thwikiquote, thwikisource, tiwiki, tkwiki, tkwikiquote, tlwiki, tnwiki, towiki, tpiwiki, trwiki, trwikinews, trwikiquote, trwikisource, tswiki, ttwiki, ttwikiquote, tumwiki, twwiki, tyvwiki, tywiki, udmwiki, ugwiki, ugwikiquote, ukwiki, ukwikinews, ukwikiquote, ukwikisource, ukwikivoyage, urwiki, urwikiquote, uzwiki, uzwikiquote, vecwiki, vecwikisource, vepwiki, vewiki, viwiki, viwikiquote, viwikisource, viwikivoyage, vlswiki, vowiki, vowikiquote, warwiki, wawiki, wikidatawiki, wowiki, wowikiquote, wuuwiki, xalwiki, xhwiki, xmfwiki, yiwiki, yiwikisource, yowiki, zawiki, zawikiquote, zeawiki, zh_classicalwiki, zh_min_nanwiki, zh_min_nanwikiquote, zh_min_nanwikisource, zh_yuewiki, zhwiki, zhwikinews, zhwikiquote, zhwikisource, zhwikivoyage, zuwiki
linktitle

The title of the article to link. If this parameter is an empty string or both linktitle and badges are not set, the link will be removed.

badges

The IDs of items to be set as badges. They will replace the current ones. If this parameter is not set, the badges will not be changed

Values (separate with |):
Examples:
Add a sitelink "Hydrogen" for English page with ID "Q42", if the sitelink does not exist
api.php?action=wbsetsitelink&id=Q42&linksite=enwiki&linktitle=Hydrogen [open in sandbox]
Add a sitelink "Hydrogen" for English page with ID "Q42", if the sitelink does not exist with an edit summary of "World domination will be mine soon!"
api.php?action=wbsetsitelink&id=Q42&linksite=enwiki&linktitle=Hydrogen&summary=World%20domination%20will%20be%20mine%20soon! [open in sandbox]
Add a sitelink "Wasserstoff" for the German page on item with the link for the English page to "Hydrogen", if the sitelink does not exist
api.php?action=wbsetsitelink&site=enwiki&title=Hydrogen&linksite=dewiki&linktitle=Wasserstoff [open in sandbox]
Removes the German sitelink from the item
api.php?action=wbsetsitelink&site=enwiki&title=Hydrogen&linksite=dewiki [open in sandbox]
Add a sitelink "Wodór" for the Polish page on item with the link for the English page to "Hydrogen" with one badge pointing to the item with ID "Q149"
api.php?action=wbsetsitelink&site=enwiki&title=Hydrogen&linksite=plwiki&linktitle=Wodór&badges=Q149 [open in sandbox]
Change badges for the link to the Polish page from the item with ID "Q42" to two badges pointing to the items with IDs "Q2" and "Q149" without providing the link title
api.php?action=wbsetsitelink&id=Q42&linksite=plwiki&badges=Q2|Q149 [open in sandbox]
Change the link to the Polish page from the item with ID "Q42" without changing badges
api.php?action=wbsetsitelink&id=Q42&linksite=plwiki&linktitle=Warszawa [open in sandbox]
Change the link to the Polish page from the item with ID "Q42" and remove all of its badges
api.php?action=wbsetsitelink&id=Q42&linksite=plwiki&linktitle=Wodór&badges= [open in sandbox]