> 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/updater/installed-items/sync-site-items/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://api.docs.modulards.com/_mcp/server. # Sync site items POST https://api.modulards.com/api/public/v1/site-items/sync Content-Type: application/json Asks the websites you list in `sites` to report again which plugins, themes and WordPress version they have installed, and updates Modular DS with the answer. Use it after you changed a website directly in WordPress. It creates one site action per website that passes the checks. The work finishes later: see [Writes and asynchronous operations](https://api.docs.modulards.com/writes-and-asynchronous-operations). Follow the site actions with "List site actions". Websites that cannot be processed are reported in `meta.skipped`, each with a `reason_code` and a message, and do not fail the call. A website is skipped when it is not connected (`SITE_UNREACHABLE`), when its inventory was synchronized recently (`ALREADY_APPLIED`), when it already has too many pending or running actions (`CONFLICT`), or when you have no access to it (`PERMISSION_DENIED`). **Body** - `sites` (array of integers, required): ids of the websites to act on, 1 to 50. **Errors** - **422**: `sites` is missing, empty, has more than 50 ids, or contains an id that matches no website. Reference: https://api.docs.modulards.com/modular-ds-public-api/updater/installed-items/sync-site-items ## Authentication - `Authorization` header (bearer token, required) — Personal access token created in the Modular DS dashboard; read-only tokens can only call GET endpoints. ## Request ### Body (application/json) This endpoint expects an object. - `sites` (list of double, optional) ## Response ### 202 202 Accepted - one sync launched, one website skipped - `data` (list of ApiPublicV1SiteItemsSyncPostResponsesContentApplicationJsonSchemaDataItems, optional) - `jsonapi` (ApiPublicV1SiteItemsSyncPostResponsesContentApplicationJsonSchemaJsonapi, optional) - `meta` (ApiPublicV1SiteItemsSyncPostResponsesContentApplicationJsonSchemaMeta, optional) ## Types ### ApiPublicV1SiteItemsSyncPostResponsesContentApplicationJsonSchemaDataItems - `attributes` (ApiPublicV1SiteItemsSyncPostResponsesContentApplicationJsonSchemaDataItemsAttributes, optional) - `id` (string, optional) - `links` (ApiPublicV1SiteItemsSyncPostResponsesContentApplicationJsonSchemaDataItemsLinks, optional) - `type` (string, optional) ### ApiPublicV1SiteItemsSyncPostResponsesContentApplicationJsonSchemaJsonapi - `version` (string, optional) ### ApiPublicV1SiteItemsSyncPostResponsesContentApplicationJsonSchemaMeta - `skipped` (list of ApiPublicV1SiteItemsSyncPostResponsesContentApplicationJsonSchemaMetaSkippedItems, optional) ### ApiPublicV1SiteItemsSyncPostResponsesContentApplicationJsonSchemaDataItemsAttributes - `completed_at` (any, optional, nullable) - `created_at` (string, optional) - `created_by` (double, optional) - `origin` (string, optional) - `site_id` (double, optional) - `started_at` (any, optional, nullable) - `status` (string, optional) - `type` (string, optional) - `updated_at` (string, optional) ### ApiPublicV1SiteItemsSyncPostResponsesContentApplicationJsonSchemaDataItemsLinks - `self` (string, optional) ### ApiPublicV1SiteItemsSyncPostResponsesContentApplicationJsonSchemaMetaSkippedItems - `message` (string, optional) — Human-readable explanation of the reason. - `reason_code` (string, optional) — Why the website was skipped, for example SITE_UNREACHABLE, UNSUPPORTED, NOT_FOUND, PERMISSION_DENIED, CONFLICT or ALREADY_APPLIED. - `site_action_id` (any, optional, nullable) — Always null: no site action was created for a skipped website. - `site_id` (integer, optional) — Id of the website that was skipped. - `site_name` (string, optional, nullable) — Name of the website that was skipped; null when you have no access to it. ## Examples ### 202 Accepted - one sync launched, one website skipped **Response** ```json { "data": [ { "attributes": { "completed_at": null, "created_at": "2026-09-21T09:00:00.000000Z", "created_by": 501, "origin": "agent", "site_id": 12, "started_at": null, "status": "pending", "type": "manager.update", "updated_at": "2026-09-21T09:00:00.000000Z" }, "id": "5001", "links": { "self": "{{base_url}}/api/public/v1/site-actions/5001" }, "type": "site-actions" } ], "jsonapi": { "version": "1.1" }, "meta": { "skipped": [ { "message": "This website is not connected; connect it first.", "reason_code": "SITE_UNREACHABLE", "site_action_id": null, "site_id": 13, "site_name": "Blog" } ] } } ``` **SDK Code** ```python 202 Accepted - one sync launched, one website skipped import requests url = "https://api.modulards.com/api/public/v1/site-items/sync" headers = {"Authorization": "Bearer "} response = requests.post(url, headers=headers) print(response.json()) ``` ```javascript 202 Accepted - one sync launched, one website skipped const url = 'https://api.modulards.com/api/public/v1/site-items/sync'; 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 202 Accepted - one sync launched, one website skipped package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.modulards.com/api/public/v1/site-items/sync" 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 202 Accepted - one sync launched, one website skipped require 'uri' require 'net/http' url = URI("https://api.modulards.com/api/public/v1/site-items/sync") 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 202 Accepted - one sync launched, one website skipped import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.modulards.com/api/public/v1/site-items/sync") .header("Authorization", "Bearer ") .asString(); ``` ```php 202 Accepted - one sync launched, one website skipped request('POST', 'https://api.modulards.com/api/public/v1/site-items/sync', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp 202 Accepted - one sync launched, one website skipped using RestSharp; var client = new RestClient("https://api.modulards.com/api/public/v1/site-items/sync"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift 202 Accepted - one sync launched, one website skipped import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.modulards.com/api/public/v1/site-items/sync")! 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() ``` ### Sync site items **Request** ```json { "sites": [ 12, 13 ] } ``` **Response** ```json { "data": [ { "attributes": { "completed_at": null, "created_at": "2026-09-21T09:00:00.000000Z", "created_by": 501, "origin": "agent", "site_id": 12, "started_at": null, "status": "pending", "type": "manager.update", "updated_at": "2026-09-21T09:00:00.000000Z" }, "id": "5001", "links": { "self": "{{base_url}}/api/public/v1/site-actions/5001" }, "type": "site-actions" } ], "jsonapi": { "version": "1.1" }, "meta": { "skipped": [ { "message": "This website is not connected; connect it first.", "reason_code": "SITE_UNREACHABLE", "site_action_id": null, "site_id": 13, "site_name": "Blog" } ] } } ``` **SDK Code** ```python Sync site items import requests url = "https://api.modulards.com/api/public/v1/site-items/sync" payload = { "sites": [12, 13] } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Sync site items const url = 'https://api.modulards.com/api/public/v1/site-items/sync'; const options = { method: 'POST', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"sites":[12,13]}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Sync site items package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.modulards.com/api/public/v1/site-items/sync" payload := strings.NewReader("{\n \"sites\": [\n 12,\n 13\n ]\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 Sync site items require 'uri' require 'net/http' url = URI("https://api.modulards.com/api/public/v1/site-items/sync") 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 \"sites\": [\n 12,\n 13\n ]\n}" response = http.request(request) puts response.read_body ``` ```java Sync site items import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.modulards.com/api/public/v1/site-items/sync") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"sites\": [\n 12,\n 13\n ]\n}") .asString(); ``` ```php Sync site items request('POST', 'https://api.modulards.com/api/public/v1/site-items/sync', [ 'body' => '{ "sites": [ 12, 13 ] }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp Sync site items using RestSharp; var client = new RestClient("https://api.modulards.com/api/public/v1/site-items/sync"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"sites\": [\n 12,\n 13\n ]\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Sync site items import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = ["sites": [12, 13]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.modulards.com/api/public/v1/site-items/sync")! 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() ```