Delete description

DELETE /core/v1/{project}/{language}/page/{title}/description

Deletes a page description. A page description is a short, plain-text phrase summarizing the page’s topic.

Examples

curl

# Delete the description of a user sandbox page on English Wikipedia
$ curl -X DELETE https://api.wikimedia.org/core/v1/wikipedia/en/page/User%3AYOUR_USERNAME%2Fsandbox/description \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Python

# Python 3
# Delete the description of a user sandbox page on English Wikipedia

import requests
import json

url = 'https://api.wikimedia.org/core/v1/wikipedia/en/page/User%3AYOUR_USERNAME%2Fsandbox/description'
headers = {
    'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
    'User-Agent': 'YOUR_APP_NAME (YOUR_EMAIL_OR_CONTACT_PAGE)'
}

response = requests.put( url, headers=headers )
output = response.json()
print(output)

PHP

<?php
// Delete the description of a user sandbox page on English Wikipedia

$url = 'https://api.wikimedia.org/core/v1/wikipedia/en/page/User%3AYOUR_USERNAME%2Fsandbox/description';
$token = 'YOUR_ACCESS_TOKEN';
$authorization = 'Authorization: Bearer ' . $token;

$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, $url );
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'DELETE' );
curl_setopt( $ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json' , $authorization ));
curl_setopt( $ch, CURLOPT_USERAGENT, 'YOUR_APP_NAME (YOUR_EMAIL_OR_CONTACT_PAGE)' );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
$output = curl_exec( $ch );
curl_close( $ch );
echo( $output );
?>

JavaScript

// Delete the description of a user sandbox page on English Wikipedia

let url = 'https://api.wikimedia.org/core/v1/wikipedia/en/page/User%3AYOUR_USERNAME%2Fsandbox/description';
let response = await fetch( url,
    {
        method: 'DELETE',
        headers: {
            'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
            'Api-User-Agent': 'YOUR_APP_NAME (YOUR_EMAIL_OR_CONTACT_PAGE)'
        }
    }
);
response.json()
    .then(console.log).catch(console.error);

Parameters

project

required path

Project name. For example: wikipedia (encyclopedia articles), commons (images, audio, and video), wiktionary (dictionary entries). List all projects.
language

required path

Language code. For example: ar (Arabic), en (English), es (Spanish). List supported languages.
Note: This endpoint does not support commons or other multilingual projects.
title

required string

Wiki page title with spaces replaced with underscores

Headers

Authorization

required

Include an access token using the Bearer authentication scheme. For more information about obtaining an access token, visit Authentication.
Accept-Language

optional

Some Wikimedia projects include content in more than one script. For example, Kurdish Wikipedia includes content in both Latin and Arabic scripts. For languages that support multiple scripts, use this header to specify the script. For example, Accept-Language: ku-arab to request the Kurdish language in Arabic script. Defaults to the wiki's primary script.
Supported languages
Language (local) Language (English) Code Variant Code
Qırımtatarca Crimean Tatar crh Latin latn
Cyrillic cyrl
贛語 Gan gan Simplified hans
Traditional hant
ᐃᓄᒃᑎᑐᑦ Inuktitut iu Latin latn
Syllabics cans
Қазақша Kazakh kk Latin latn
Cyrillic cyrl
Arabic arab
Kurdî / كوردی Kurdish ku Latin latn
Arabic arab
Српски / Srpski Serbian sr Latin el
Cyrillic ec
Тоҷикӣ Tajik tg Latin latn
Cyrillic cyrl
O‘zbek Uzbek uz Latin latin
Cyrillic cyrl
中文 Chinese zh Simplified zh-hans
Simplified, China zh-cn
Simplified, Singapore zh-sg
Simplified, Malaysia zh-my
Traditional hant
Traditional, Taiwan zh-tw
Traditional, Hong Kong zh-hk
Traditional, Macau zh-mo

Responses

204 Success: Description deleted. Returns no response data.
401 Error: Missing token. Include an access token in an Authorization request header using the Bearer authentication scheme.
Example
{
  "httpCode": 401,
  "httpReason": "Jwt is missing"
}