> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://api.docs.modulards.com/modular-ds-public-api/website-actions/safe-update-validation/approve-or-roll-back-a-safe-update/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://api.docs.modulards.com/_mcp/server. # Approve or roll back a safe update POST https://api.modulards.com/api/public/v1/site-actions/{siteAction}/validate Content-Type: application/json Gives your verdict on a safe update that is waiting for your decision (`status` `requires_action`): approve it to keep the update, or roll it back to restore the website as it was. A safe update that nobody decides within 7 days of starting to wait is approved automatically. Returns the site action after the decision, with its details. **Body** - `action` (`approve` or `rollback`, required): your verdict. **Errors** - **404**: the site action does not exist, is not one of your organization's, or is not waiting for a decision. - **422**: `action` is missing or is not `approve` or `rollback`. Reference: https://api.docs.modulards.com/modular-ds-public-api/website-actions/safe-update-validation/approve-or-roll-back-a-safe-update ## Authentication - `Authorization` header (bearer token, required) — Personal access token created in the Modular DS dashboard; read-only tokens can only call GET endpoints. ## Request ### Path parameters - `siteAction` (string, required) ### Body (application/json) This endpoint expects an object. - `action` (string, optional) ## Response ### 200 200 - Safe upgrade approved - `data` (ApiPublicV1SiteActionsSiteActionValidatePostResponsesContentApplicationJsonSchemaData, optional) - `jsonapi` (ApiPublicV1SiteActionsSiteActionValidatePostResponsesContentApplicationJsonSchemaJsonapi, optional) ## Types ### ApiPublicV1SiteActionsSiteActionValidatePostResponsesContentApplicationJsonSchemaData - `attributes` (ApiPublicV1SiteActionsSiteActionValidatePostResponsesContentApplicationJsonSchemaDataAttributes, optional) - `id` (string, optional) - `links` (ApiPublicV1SiteActionsSiteActionValidatePostResponsesContentApplicationJsonSchemaDataLinks, optional) - `type` (string, optional) ### ApiPublicV1SiteActionsSiteActionValidatePostResponsesContentApplicationJsonSchemaJsonapi - `version` (string, optional) ### ApiPublicV1SiteActionsSiteActionValidatePostResponsesContentApplicationJsonSchemaDataAttributes - `clean_cache` (boolean, optional) - `completed_at` (any, optional, nullable) - `created_at` (string, optional) - `created_by` (double, optional) - `is_manual` (boolean, optional) - `managed_items` (list of ApiPublicV1SiteActionsSiteActionValidatePostResponsesContentApplicationJsonSchemaDataAttributesManagedItemsItems, optional) - `origin` (string, optional) - `requires_action` (boolean, optional) - `scheduled_at` (any, optional, nullable) - `site_id` (double, optional) - `started_at` (string, optional) - `status` (string, optional) - `target_site` (ApiPublicV1SiteActionsSiteActionValidatePostResponsesContentApplicationJsonSchemaDataAttributesTargetSite, optional) - `type` (string, optional) - `updated_at` (string, optional) - `visual_regression` (ApiPublicV1SiteActionsSiteActionValidatePostResponsesContentApplicationJsonSchemaDataAttributesVisualRegression, optional) ### ApiPublicV1SiteActionsSiteActionValidatePostResponsesContentApplicationJsonSchemaDataLinks - `self` (string, optional) ### ApiPublicV1SiteActionsSiteActionValidatePostResponsesContentApplicationJsonSchemaDataAttributesManagedItemsItems - `from_version` (string, optional) - `name` (string, optional) - `site_item_id` (double, optional) - `slug` (string, optional) - `to_version` (string, optional) - `type` (string, optional) ### ApiPublicV1SiteActionsSiteActionValidatePostResponsesContentApplicationJsonSchemaDataAttributesTargetSite - `id` (double, optional) - `slug` (string, optional) - `url` (string, optional) ### ApiPublicV1SiteActionsSiteActionValidatePostResponsesContentApplicationJsonSchemaDataAttributesVisualRegression - `change_percentage` (double, optional) - `screenshots` (ApiPublicV1SiteActionsSiteActionValidatePostResponsesContentApplicationJsonSchemaDataAttributesVisualRegressionScreenshots, optional) - `success_path` (string, optional) - `threshold` (double, optional) ### ApiPublicV1SiteActionsSiteActionValidatePostResponsesContentApplicationJsonSchemaDataAttributesVisualRegressionScreenshots - `after` (string, optional) - `before` (string, optional) - `diff` (string, optional) ## Examples ### 200 - Safe upgrade approved **Response** ```json { "data": { "attributes": { "clean_cache": true, "completed_at": null, "created_at": "2026-09-20T09:00:00.000000Z", "created_by": 501, "is_manual": false, "managed_items": [ { "from_version": "8.9.5", "name": "WooCommerce", "site_item_id": 301, "slug": "woocommerce", "to_version": "8.10.0", "type": "plugin" } ], "origin": "agent", "requires_action": false, "scheduled_at": null, "site_id": 12, "started_at": "2026-09-20T09:00:00.000000Z", "status": "in_progress", "target_site": { "id": 12, "slug": "shop", "url": "https://shop.example.com" }, "type": "manager.safe_upgrade", "updated_at": "2026-09-20T09:12:00.000000Z", "visual_regression": { "change_percentage": 1.2, "screenshots": { "after": "https://cdn.modulards.com/safe-upgrade/504/after.png?signature=abc", "before": "https://cdn.modulards.com/safe-upgrade/504/before.png?signature=abc", "diff": "https://cdn.modulards.com/safe-upgrade/504/diff.png?signature=abc" }, "success_path": "/", "threshold": 5 } }, "id": "504", "links": { "self": "{{base_url}}/api/public/v1/site-actions/504" }, "type": "site-actions" }, "jsonapi": { "version": "1.1" } } ``` **SDK Code** ```python 200 - Safe upgrade approved import requests url = "https://api.modulards.com/api/public/v1/site-actions/siteAction/validate" headers = {"Authorization": "Bearer "} response = requests.post(url, headers=headers) print(response.json()) ``` ```javascript 200 - Safe upgrade approved const url = 'https://api.modulards.com/api/public/v1/site-actions/siteAction/validate'; const options = {method: 'POST', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go 200 - Safe upgrade approved package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.modulards.com/api/public/v1/site-actions/siteAction/validate" req, _ := http.NewRequest("POST", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby 200 - Safe upgrade approved require 'uri' require 'net/http' url = URI("https://api.modulards.com/api/public/v1/site-actions/siteAction/validate") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java 200 - Safe upgrade approved import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.modulards.com/api/public/v1/site-actions/siteAction/validate") .header("Authorization", "Bearer ") .asString(); ``` ```php 200 - Safe upgrade approved request('POST', 'https://api.modulards.com/api/public/v1/site-actions/siteAction/validate', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp 200 - Safe upgrade approved using RestSharp; var client = new RestClient("https://api.modulards.com/api/public/v1/site-actions/siteAction/validate"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift 200 - Safe upgrade approved import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.modulards.com/api/public/v1/site-actions/siteAction/validate")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` ### Approve or roll back a safe update **Request** ```json { "action": "approve" } ``` **Response** ```json { "data": { "attributes": { "clean_cache": true, "completed_at": null, "created_at": "2026-09-20T09:00:00.000000Z", "created_by": 501, "is_manual": false, "managed_items": [ { "from_version": "8.9.5", "name": "WooCommerce", "site_item_id": 301, "slug": "woocommerce", "to_version": "8.10.0", "type": "plugin" } ], "origin": "agent", "requires_action": false, "scheduled_at": null, "site_id": 12, "started_at": "2026-09-20T09:00:00.000000Z", "status": "in_progress", "target_site": { "id": 12, "slug": "shop", "url": "https://shop.example.com" }, "type": "manager.safe_upgrade", "updated_at": "2026-09-20T09:12:00.000000Z", "visual_regression": { "change_percentage": 1.2, "screenshots": { "after": "https://cdn.modulards.com/safe-upgrade/504/after.png?signature=abc", "before": "https://cdn.modulards.com/safe-upgrade/504/before.png?signature=abc", "diff": "https://cdn.modulards.com/safe-upgrade/504/diff.png?signature=abc" }, "success_path": "/", "threshold": 5 } }, "id": "504", "links": { "self": "{{base_url}}/api/public/v1/site-actions/504" }, "type": "site-actions" }, "jsonapi": { "version": "1.1" } } ``` **SDK Code** ```python Approve or roll back a safe update import requests url = "https://api.modulards.com/api/public/v1/site-actions/siteAction/validate" payload = { "action": "approve" } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Approve or roll back a safe update const url = 'https://api.modulards.com/api/public/v1/site-actions/siteAction/validate'; const options = { method: 'POST', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"action":"approve"}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Approve or roll back a safe update package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.modulards.com/api/public/v1/site-actions/siteAction/validate" payload := strings.NewReader("{\n \"action\": \"approve\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Approve or roll back a safe update require 'uri' require 'net/http' url = URI("https://api.modulards.com/api/public/v1/site-actions/siteAction/validate") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"action\": \"approve\"\n}" response = http.request(request) puts response.read_body ``` ```java Approve or roll back a safe update import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.modulards.com/api/public/v1/site-actions/siteAction/validate") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"action\": \"approve\"\n}") .asString(); ``` ```php Approve or roll back a safe update request('POST', 'https://api.modulards.com/api/public/v1/site-actions/siteAction/validate', [ 'body' => '{ "action": "approve" }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp Approve or roll back a safe update using RestSharp; var client = new RestClient("https://api.modulards.com/api/public/v1/site-actions/siteAction/validate"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"action\": \"approve\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Approve or roll back a safe update import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = ["action": "approve"] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.modulards.com/api/public/v1/site-actions/siteAction/validate")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```