Update a plugin
Body parameters
Must be exactly "plugin".
The name of the plugin
"5 stars"
A description of the plugin
"A better rating experience!"
The entry point URL of the plugin
"https://cdn.rawgit.com/datocms/extensions/master/samples/five-stars/extension.ts"
Turns a private plugin into a Marketplace plugin, installing the specified package from the DatoCMS Marketplace. Only accepted for private, non-legacy plugins, and cannot be combined with other attributes (except enabled). Name, description, URL, version and permissions are replaced with the ones published in the Marketplace, while the existing parameters are preserved.
"datocms-plugin-star-rating-editor"
Global plugin configuration. Plugins can persist whatever information they want in this object to reuse it later. Refer to the CMA for details about technical limits.
{ devMode: true }
The installed version of the plugin (or null if it's a private plugin)
"0.0.4"
Permissions granted to this plugin
Whether the plugin is enabled or not. When disabled, the plugin behaves as if it didn't exist: fields using it as editor/addon fall back to the default editor, and any sidebar panel/page/config screen/asset source it registers does not render.
Returns
Returns a resource object of type plugin.
Examples
PUT https://site-api.datocms.com/plugins/:plugin_id HTTP/1.1Authorization: Bearer YOUR-API-TOKENAccept: application/jsonX-Api-Version: 3Content-Type: application/vnd.api+json
{ "data": { "type": "plugin", "id": "RMAMRffBRlmBuDlQsIWZ0g", "attributes": {} }}curl -g 'https://site-api.datocms.com/plugins/:plugin_id' \ -X PUT \ -H "Authorization: Bearer YOUR-API-TOKEN" \ -H "Accept: application/json" \ -H "X-Api-Version: 3" \ -H "Content-Type: application/vnd.api+json" \ --data-binary '{"data":{"type":"plugin","id":"RMAMRffBRlmBuDlQsIWZ0g","attributes":{}}}'await fetch("https://site-api.datocms.com/plugins/:plugin_id", { method: "PUT", headers: { Authorization: "Bearer YOUR-API-TOKEN", Accept: "application/json", "X-Api-Version": "3", "Content-Type": "application/vnd.api+json", }, body: JSON.stringify({ data: { type: "plugin", id: "RMAMRffBRlmBuDlQsIWZ0g", attributes: {} }, }),});HTTP/1.1 200 OKContent-Type: application/jsonCache-Control: cache-control: max-age=0, private, must-revalidateX-RateLimit-Limit: 30X-RateLimit-Remaining: 28
{ "data": { "type": "plugin", "id": "RMAMRffBRlmBuDlQsIWZ0g", "attributes": { "name": "5 stars", "description": "A better rating experience!", "url": "https://cdn.rawgit.com/datocms/extensions/master/samples/five-stars/extension.ts", "parameters": { "devMode": true }, "package_name": "datocms-plugin-star-rating-editor", "package_version": "0.0.4", "permissions": [ "currentUserAccessToken" ], "enabled": true }, "meta": { "version": "2" } }}