Creating Backup Jobs
You can create a backup job for an organization with the specified ID.
Request
POST https://<hostname>:4443/v6/Organizations/{organizationId}/Jobs |
Request Headers
The request header must contain an authorization token of the current session.
Request Parameters
The following parameter must be specified in the URL of the request:
Parameter | Type | Description |
---|---|---|
organizationId | string | Specifies the identification number of the Microsoft 365 organization. For more information on how to get this parameter, see Getting Organizations. |
Request Body
The request body must contain the following properties:
Property | Type | Description |
---|---|---|
name | string | Specifies a name of the backup job. |
description | string | Specifies a description of the backup job. |
backupType | string | Specifies the type of the backup job. The following types are available:
Note: For the backup job of the SelectedItems type, you must specify a collection of objects you want to back up. For more information about properties that you must specify for different types of backup and excluded items, see backupitemType and excludeditemType. |
schedulePolicy | Specifies the backup job scheduling options. | |
repositoryId | string | Specifies the ID of the repository where the organization backups will be stored. |
runNow | boolean | If set to true, indicates that the job will run right after it is created. |
isEnabled | boolean | If set to true, indicates that the backup job is enabled. |
Specify the following properties for the backup job schedule policy:
Property | Type | Description |
---|---|---|
type | string | Specifies the backup job schedule type. The following types are available:
|
dailyType | string | Specifies the days when the backup job will run. The following values are available:
|
dailyTime | UTC | Specifies the time to start the backup job. |
periodicallyEvery | string | Specifies the time interval between the job runs. The following values are available:
|
backupWindowEnabled | boolean | If set to true, indicates that a backup window feature is enabled for this job. |
scheduleEnabled | boolean | If set to true, indicates that a schedule feature is enabled for this job. Use this property only with the periodicallyEvery property and the time interval specified in hours. |
backupWindowSettings | Specifies the settings of the job backup window. A backup window is a time period within which the backup job must be completed. | |
periodicallyWindowSettings | Specifies allowed and prohibited hours for the backup job to run. Use this property only with the periodicallyEvery property and the time interval specified in hours. | |
periodicallyOffsetMinutes | integer | Specifies a number of minutes for which you want to shift starting of the backup job within an hour if several backup jobs are scheduled to be started simultaneously. Use this property only with the periodicallyEvery property and the time interval specified in hours. |
retryEnabled | boolean | If set to true, indicates that Veeam Backup for Microsoft 365 will attempt to restart a backup job if it fails for some reason. |
retryNumber | integer | Specifies the number of attempts to run the backup job. |
retryWaitInterval | integer | Specifies the time intervals between the backup job retry attempts (in minutes). |
Specify the following properties for the backup window:
Property | Type | Description |
---|---|---|
backupWindow | boolean[] | Defines an hourly scheme for the backup window. The scheduling scheme consists of 168 boolean elements. These elements can be logically divided into 7 groups by 24. Each group represents a day of the week starting from Sunday. Each element represents a backup hour:
|
minuteOffset | integer | Specifies the current minute offset from the UTC time. |
If you configure the backup job to run periodically every N hours, specify the following properties for the schedule:
Property | Type | Description |
---|---|---|
backupWindow | boolean[] | Defines an hourly scheme for the backup job to run. The scheduling scheme consists of 168 boolean elements. These elements can be logically divided into 7 groups by 24. Each group represents a day of the week starting from Sunday. Each element represents a backup hour:
|
minuteOffset | integer | Specifies the current minute offset from the UTC time. |
Response
The server returns the following response to the client.
Response Codes
A successfully completed operation returns a response code 200 OK.
Response Headers
The response to this request contains the following headers. The response may also include additional standard HTTPS headers.
Header | Description |
---|---|
Content-length | The length of the response body. |
Content-type | The media type and syntax of the response body message: application/json; charset=utf-8 |
Response Body
In the response body, the server returns a resource representation of the /Jobs/{jobId} resource. For more information, see Getting Backup Jobs.
For more information about properties that you get for different types of backup and excluded items, see backupitemType and excludeditemType.
Examples
Example 1
The example shows how to back up the entire organization with the ID e60dfb9c-ac58-4463-879f-9855ac35576b.
Request: POST https://abc.tech.local:4443/v6/Organizations/e60dfb9c-ac58-4463-879f-9855ac35576b/Jobs
Request Header: Authorization: Bearer <Access-Token>
Request Body: { "name": "Entire Organization Backup", "description": "", "backupType": "EntireOrganization", "schedulePolicy": { "backupWindowEnabled": false, "scheduleEnabled": false, "type": "Daily", "dailyType": "Everyday", "dailyTime": "01:00:00", "retryEnabled": true, "retryNumber": 3, "retryWaitInterval": 10 }, "repositoryId": "5f7c94d0-c339-46f1-9b0f-2b9763ba83de", "runNow": false, "isEnabled": true }
Response: 200 OK
Response Body: { "description": "", "backupType": "EntireOrganization", "schedulePolicy": { "scheduleEnabled": false, "backupWindowEnabled": false, "retryEnabled": true, "retryNumber": 3, "retryWaitInterval": 10 }, "id": "9519e2d9-c97f-41e9-8427-02e85687a67a", "repositoryId": "5f7c94d0-c339-46f1-9b0f-2b9763ba83de", "name": "Entire Organization Backup", "isEnabled": true, "lastStatus": "Stopped", "_links": { "self": { "href": "/v6/jobs/9519e2d9-c97f-41e9-8427-02e85687a67a" }, "copyJob": { "href": "/v6/jobs/9519e2d9-c97f-41e9-8427-02e85687a67a/copyJob" }, "organization": { "href": "/v6/organizations/e60dfb9c-ac58-4463-879f-9855ac35576b" }, "backupRepository": { "href": "/v6/backuprepositories/5f7c94d0-c339-46f1-9b0f-2b9763ba83de" }, "jobsessions": { "href": "/v6/jobs/9519e2d9-c97f-41e9-8427-02e85687a67a/jobsessions" }, "excludedItems": { "href": "/v6/jobs/9519e2d9-c97f-41e9-8427-02e85687a67a/excludedItems" } } } |
Example 2
The example shows how to back up selected items of the organization with the ID e60dfb9c-ac58-4463-879f-9855ac35576b.
For more information about properties that you must specify for different types of backup items, see backupitemType.
Request: POST https://abc.tech.local:4443/v6/Organizations/e60dfb9c-ac58-4463-879f-9855ac35576b/Jobs
Request Header: Authorization: Bearer <Access-Token>
Request Body: { "name": "Selected Items Backup", "description": "", "isEnabled": true, "runNow": false, "backupType": "SelectedItems", "selectedItems": [ { "type": "PartialOrganization", "mailbox": true, "oneDrive": true, "archiveMailbox": true, "sites": true, "teams": true }, { "type": "User", "user": { "id": "9bdd0fca-7210-450e-bfeb-c0dca2e1b36c00000000-0000-0000-0000-000000000000", "displayName": "User1", "name": "user1@abc.onmicrosoft.com", "type": "User", "locationType": "Cloud" }, "mailbox": true, "archiveMailbox": true, "oneDrive": true, "personalSite": true }, { "type": "Group", "mailbox": true, "groupSite": true, "group": { "id": "0eb7e684-b568-4487-8fe5-1c92cd13e91500000000-0000-0000-0000-000000000000", "displayName": "Group2", "name": "group2@abc.onmicrosoft.com", "managedBy": "administrator", "site": "https://abc.sharepoint.com/sites/group2", "type": "Office365", "locationType": "Cloud" }, "members": true, "memberMailbox": true, "memberArchiveMailbox": false, "memberOnedrive": true, "memberSite": false }, { "type": "Site", "site": { "id": "f8956d6b-73b3-4ce2-bca7-66896490de7770e7bee3-08ea-48ac-ba1a-16863f06e1e2", "url": "https://abc-my.sharepoint.com/personal/john_doe_abc_onmicrosoft_com", "name": "John Doe", "isCloud": true, "isPersonal": true, "title": "John Doe Site" } ], "schedulePolicy": { "backupWindowEnabled": false, "scheduleEnabled": false, "type": "Daily", "dailyType": "Everyday", "dailyTime": "01:00:00", "retryEnabled": true, "retryNumber": 3, "retryWaitInterval": 10 }, "repositoryId": "5f7c94d0-c339-46f1-9b0f-2b9763ba83de" }
Response: 200 OK
Response Body: { "description": "", "backupType": "SelectedItems", "schedulePolicy": { "scheduleEnabled": false, "backupWindowEnabled": false, "retryEnabled": true, "retryNumber": 3, "retryWaitInterval": 10 }, "id": "40b18684-f30e-4169-9100-e0161ff7f8ad", "repositoryId": "5f7c94d0-c339-46f1-9b0f-2b9763ba83de", "name": "Selected Items Backup", "isEnabled": true, "lastStatus": "Stopped", "_links": { "self": { "href": "/v6/jobs/40b18684-f30e-4169-9100-e0161ff7f8ad" }, "copyJob": { "href": "/v6/jobs/40b18684-f30e-4169-9100-e0161ff7f8ad/copyJob" }, "organization": { "href": "/v6/organizations/e60dfb9c-ac58-4463-879f-9855ac35576b" }, "backupRepository": { "href": "/v6/backuprepositories/5f7c94d0-c339-46f1-9b0f-2b9763ba83de" }, "jobsessions": { "href": "/v6/jobs/40b18684-f30e-4169-9100-e0161ff7f8ad/jobsessions" }, "excludedItems": { "href": "/v6/jobs/40b18684-f30e-4169-9100-e0161ff7f8ad/excludedItems" }, "selectedItems": { "href": "/v6/jobs/40b18684-f30e-4169-9100-e0161ff7f8ad/selectedItems" } } } |
Example 3
The example shows how to exclude items when performing back up of the entire organization with the ID e60dfb9c-ac58-4463-879f-9855ac35576b.
For more information about properties that you must specify for different types of the excluded items, see excludeditemType.
Request: POST https://abc.tech.local:4443/v6/Organizations/e60dfb9c-ac58-4463-879f-9855ac35576b/Jobs
Request Header: Authorization: Bearer <Access-Token>
Request Body: { "name": "Entire Organization with Excluded Items", "description": "", "backupType": "EntireOrganization", "schedulePolicy": { "backupWindowEnabled": false, "scheduleEnabled": false, "type": "Daily", "dailyType": "Everyday", "dailyTime": "01:00:00", "retryEnabled": true, "retryNumber": 3, "retryWaitInterval": 10 }, "repositoryId": "5f7c94d0-c339-46f1-9b0f-2b9763ba83de", "runNow": false, "isEnabled": true, "excludedItems":[ { "type": "User", "user": { "id": "9bdd0fca-7210-450e-bfeb-c0dca2e1b36c00000000-0000-0000-0000-000000000000", "displayName": "User1", "name": "user1@abc.onmicrosoft.com", "type": "User", "locationType": "Cloud" }, "mailbox": true, "archiveMailbox": true, "oneDrive": true, "personalSite": true } ] }
Response: 200 OK
Response Body: { "description": "", "backupType": "EntireOrganization", "schedulePolicy": { "scheduleEnabled": false, "backupWindowEnabled": false, "retryEnabled": true, "retryNumber": 3, "retryWaitInterval": 10 }, "id": "a387d9d9-5d02-4543-880a-c1c3c494eeda", "repositoryId": "5f7c94d0-c339-46f1-9b0f-2b9763ba83de", "name": "Entire Organization with Excluded Items", "isEnabled": true, "lastStatus": "Stopped", "_links": { "self": { "href": "/v6/jobs/a387d9d9-5d02-4543-880a-c1c3c494eeda" }, "copyJob": { "href": "/v6/jobs/a387d9d9-5d02-4543-880a-c1c3c494eeda/copyJob" }, "organization": { "href": "/v6/organizations/e60dfb9c-ac58-4463-879f-9855ac35576b" }, "backupRepository": { "href": "/v6/backuprepositories/5f7c94d0-c339-46f1-9b0f-2b9763ba83de" }, "jobsessions": { "href": "/v6/jobs/a387d9d9-5d02-4543-880a-c1c3c494eeda/jobsessions" }, "excludedItems": { "href": "/v6/jobs/a387d9d9-5d02-4543-880a-c1c3c494eeda/excludedItems" } } } |