> 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/backups/website-backups/create-backups/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://api.docs.modulards.com/_mcp/server. # Create backups POST https://api.modulards.com/api/public/v1/site-backups Content-Type: application/json Creates one manual backup for each website you list in `sites`, over each website's configured areas unless `included` names them. Exclusions always come from the website's backup settings. Each created backup starts in phase `in_progress` and takes minutes: follow it with "List backups" (`filter[id][]`) or "Retrieve a backup" and read `phase`; only `done` is a usable copy. The work finishes later: see [Writes and asynchronous operations](https://api.docs.modulards.com/writes-and-asynchronous-operations). Websites that cannot be processed are reported in `meta.skipped`, each with a `reason_code` and a message, and do not fail the call. Their `backup_id` is always null. A website is skipped as `SITE_UNREACHABLE` (not connected), `UNSUPPORTED` (no backup global configuration), `CONFLICT` (a backup or a restoration is already running) or `PERMISSION_DENIED` (a website your token cannot reach, with a null `site_name`). Your organization's plan must include manual backups and your role must be allowed to create them; without either the request answers 404. **Body** - `sites` (array of integers, required): ids of the websites to act on, 1 to 50. - `included` (array of strings, optional): areas to copy instead of the configured ones: `database`, `core`, `plugins`, `themes`, `mu_plugins`, `content`, `uploads`. **Errors** - **409**: the organization's storage quota is exhausted and no overage add-on is active. Nothing is created. - **422**: `sites` is missing, empty, has more than 50 ids or contains an id that is not a website; an `included` value is invalid. Reference: https://api.docs.modulards.com/modular-ds-public-api/backups/website-backups/create-backups ## 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. - `included` (list of string, optional) - `sites` (list of double, optional) ## Response ### 202 202 Accepted - one copy created, one website skipped - `data` (list of ApiPublicV1SiteBackupsPostResponsesContentApplicationJsonSchemaDataItems, optional) - `jsonapi` (ApiPublicV1SiteBackupsPostResponsesContentApplicationJsonSchemaJsonapi, optional) - `meta` (ApiPublicV1SiteBackupsPostResponsesContentApplicationJsonSchemaMeta, optional) ## Types ### ApiPublicV1SiteBackupsPostResponsesContentApplicationJsonSchemaDataItems - `attributes` (ApiPublicV1SiteBackupsPostResponsesContentApplicationJsonSchemaDataItemsAttributes, optional) - `id` (string, optional) - `links` (ApiPublicV1SiteBackupsPostResponsesContentApplicationJsonSchemaDataItemsLinks, optional) - `type` (string, optional) ### ApiPublicV1SiteBackupsPostResponsesContentApplicationJsonSchemaJsonapi - `version` (string, optional) ### ApiPublicV1SiteBackupsPostResponsesContentApplicationJsonSchemaMeta - `skipped` (list of ApiPublicV1SiteBackupsPostResponsesContentApplicationJsonSchemaMetaSkippedItems, optional) ### ApiPublicV1SiteBackupsPostResponsesContentApplicationJsonSchemaDataItemsAttributes - `attempts` (integer, optional) — Number of attempts made: 1 for the first run, plus one for each retry. A failed or stalled backup is retried automatically, up to 3 times (4 attempts in all), within 24 hours of its creation; after that it stays failed and reads 4. - `backup_type` (enum, optional) — full or incremental. - Allowed values: `full`, `incremental` - `comment` (string, optional, nullable) — Note written on the backup. - `created_at` (string, optional) - `is_favorite` (boolean, optional) — True for a master backup, kept out of the retention policy. - `method` (enum, optional) — How the backup started: manual, or automatic for scheduled ones. force_first is the first automatic backup of a website. - Allowed values: `manual`, `automatic`, `force_first` - `phase` (enum, optional) — State to read: in_progress while it runs, done for a usable backup, failed when it did not complete. - Allowed values: `in_progress`, `done`, `failed`, `excluded` - `restored_at` (datetime, optional, nullable) — When the backup was last restored; null if it never was. - `site_id` (integer, optional) — Id of the website the backup belongs to. - `size` (integer, optional) — Size of the backup, in bytes. - `status` (string, optional) — Raw processing step behind phase. - `updated_at` (string, optional) ### ApiPublicV1SiteBackupsPostResponsesContentApplicationJsonSchemaDataItemsLinks - `self` (string, optional) ### ApiPublicV1SiteBackupsPostResponsesContentApplicationJsonSchemaMetaSkippedItems - `backup_id` (integer, optional, nullable) — Always null: a refused website has no backup. - `message` (string, optional) — Human-readable explanation. - `reason_code` (enum, optional) — Why it was refused: SITE_UNREACHABLE, UNSUPPORTED, CONFLICT or PERMISSION_DENIED. - Allowed values: `SITE_UNREACHABLE`, `UNSUPPORTED`, `CONFLICT`, `PERMISSION_DENIED` - `site_id` (integer, optional) — Id of a website that was refused. - `site_name` (string, optional, nullable) — Name of that website; null when the id is outside your token's reach. ## Examples ### 202 Accepted - one copy created, one website skipped **Response** ```json { "data": [ { "attributes": { "attempts": 0, "backup_type": "full", "comment": null, "created_at": "2026-09-14T16:00:00.000000Z", "is_favorite": false, "method": "manual", "phase": "in_progress", "restored_at": null, "site_id": 12, "size": 0, "status": "pending", "updated_at": "2026-09-14T16:00:00.000000Z" }, "id": "9001", "links": { "self": "{{base_url}}/api/public/v1/site-backups/9001" }, "type": "site-backups" } ], "jsonapi": { "version": "1.1" }, "meta": { "skipped": [ { "backup_id": null, "message": "This site is not connected; connect it before creating a backup.", "reason_code": "SITE_UNREACHABLE", "site_id": 13, "site_name": "Blog" } ] } } ``` **SDK Code** ```python 202 Accepted - one copy created, one website skipped import requests url = "https://api.modulards.com/api/public/v1/site-backups" headers = {"Authorization": "Bearer "} response = requests.post(url, headers=headers) print(response.json()) ``` ```javascript 202 Accepted - one copy created, one website skipped const url = 'https://api.modulards.com/api/public/v1/site-backups'; 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 copy created, one website skipped package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.modulards.com/api/public/v1/site-backups" 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 copy created, one website skipped require 'uri' require 'net/http' url = URI("https://api.modulards.com/api/public/v1/site-backups") 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 copy created, 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-backups") .header("Authorization", "Bearer ") .asString(); ``` ```php 202 Accepted - one copy created, one website skipped request('POST', 'https://api.modulards.com/api/public/v1/site-backups', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp 202 Accepted - one copy created, one website skipped using RestSharp; var client = new RestClient("https://api.modulards.com/api/public/v1/site-backups"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift 202 Accepted - one copy created, one website skipped import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.modulards.com/api/public/v1/site-backups")! 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() ``` ### Create backups **Request** ```json { "included": [ "database", "core" ], "sites": [ 12, 13 ] } ``` **Response** ```json { "data": [ { "attributes": { "attempts": 0, "backup_type": "full", "comment": null, "created_at": "2026-09-14T16:00:00.000000Z", "is_favorite": false, "method": "manual", "phase": "in_progress", "restored_at": null, "site_id": 12, "size": 0, "status": "pending", "updated_at": "2026-09-14T16:00:00.000000Z" }, "id": "9001", "links": { "self": "{{base_url}}/api/public/v1/site-backups/9001" }, "type": "site-backups" } ], "jsonapi": { "version": "1.1" }, "meta": { "skipped": [ { "backup_id": null, "message": "This site is not connected; connect it before creating a backup.", "reason_code": "SITE_UNREACHABLE", "site_id": 13, "site_name": "Blog" } ] } } ``` **SDK Code** ```python Create backups import requests url = "https://api.modulards.com/api/public/v1/site-backups" payload = { "included": ["database", "core"], "sites": [12, 13] } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Create backups const url = 'https://api.modulards.com/api/public/v1/site-backups'; const options = { method: 'POST', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"included":["database","core"],"sites":[12,13]}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Create backups package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.modulards.com/api/public/v1/site-backups" payload := strings.NewReader("{\n \"included\": [\n \"database\",\n \"core\"\n ],\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 Create backups require 'uri' require 'net/http' url = URI("https://api.modulards.com/api/public/v1/site-backups") 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 \"included\": [\n \"database\",\n \"core\"\n ],\n \"sites\": [\n 12,\n 13\n ]\n}" response = http.request(request) puts response.read_body ``` ```java Create backups import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.modulards.com/api/public/v1/site-backups") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"included\": [\n \"database\",\n \"core\"\n ],\n \"sites\": [\n 12,\n 13\n ]\n}") .asString(); ``` ```php Create backups request('POST', 'https://api.modulards.com/api/public/v1/site-backups', [ 'body' => '{ "included": [ "database", "core" ], "sites": [ 12, 13 ] }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp Create backups using RestSharp; var client = new RestClient("https://api.modulards.com/api/public/v1/site-backups"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"included\": [\n \"database\",\n \"core\"\n ],\n \"sites\": [\n 12,\n 13\n ]\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Create backups import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = [ "included": ["database", "core"], "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-backups")! 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() ```