Jetpack's HTTP API is built as an extension to the WP-API. Thus, you may find additional information on approaching the API in the WP API Docs.
The API requests rely on cookie-based authentication and a specific nonce for requests to be authorized.
The WP REST API infrastructure requires a nonce for authorizing of the request itself.
Ensure to use the X-WP-Nonce
header on your request.
X-WP-Nonce: e1cff122e1
The nonce is being served on the Jetpack admin page by usage of the wp_localize_script mechanism for passing values from PHP code to the JS scope. It's created for the action wp_rest
and made available in the Jetpack Admin Page as:
window.Initial_State.WP_API_nonce;
The root URL for the the API is found on the same page as:
window.Initial_State.WP_API_root;
WP-API-compatible capabilities document for the endpoints registered by Jetpack.
GET /wp-json/jetpack/v4
All endpoints return and accept JSON. Make sure you add the proper content-type
header to your PUT/POST requests sending JSON objects.
'Content-type': 'application/json'
Operations related to Jetpack's connection to WordPress.com
Fetch Jetpack's current connection status.
Fetch a fresh WordPress.com URL for connecting the Jetpack installation.
Fetch the data of the current's user WordPress.com account.
Disconnect the Jetpack installation from WordPress.com servers.
This endpoint does not take Body parameters
Check if the site has SSL enabled.
This endpoint does not take Body parameters
Get a list of all Jetpacks modules, its description, other properties and the module's options
Get a single module description and properties by its slug.
URL parameters
module-slug
: {String} The identifier of the module to get info about.Activate or deactivate a module by its slug
Accepts a JSON object in the body like:
{
"active": true
}
URL parameters
module-slug
: {String} The identifier of the module on which to act.Body parameters
active
: {Boolean} Send false to deactivate the module.Activate several modules at a time by their slug
Body parameters
modules
: {Array} An array of strings of identifiers of the modules to activate{
"modules": [ "protect", "monitor", "likes" ]
}
Update an option's value for a module
URL parameters
module-slug
: {String} The identifier of the module on which to act.Body parameters
Accepts a JSON object in the body like:
{
"option-key": "new-option-value"
}
Fetch a list of Jetpack settings not related to a particular module.
Update a setting value
Body parameters
Accepts a JSON object in the body like:
{
"setting-key": "new-setting-value"
}
Activate Jumpstart turning on some options and settings to a recommended state.
This endpoint does not take Body parameters
Deactivate Jumpstart reverting options to their default state.
This endpoint does not take Body parameters
Reset Jetpack module options or Jetpack modules activation state to default values.
URL parameters
options_or_modules
: {String} Available values:
"options"
: all the modules' options will be re-set to their default values."modules"
: the modules activation state will be reset to their defaults.This endpoint does not take Body parameters
Operations related to the site's users linked to WordPress.com accounts.
Unlink current user from the related WordPress.com account.
This endpoint does not take Body parameters
Operations related to information about the site.
Dismiss a Jetpack notice by Id.
URL parameters
notice
: {String} The identifier of the notice to dismiss. Possible values:
"feedback_dash_request"
"welcome"
.** HTTP Status codes**
404
- When :notice
is not valid or absentGet current site data
Get count of blocked attacks by Protect.
Get from the Monitor module, the last time the site was down.
Get services that this site is verified with.
Get number of updated available for currently installed WordPress plugins.
Get stats from Akismet filtered spam.
get date of last backup or status and information about actions for user to take.