Creating Backup Jobs
You can create a backup job for an organization with the specified ID.
Request
POST https://<hostname>:4443/v5/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 Office 365 organization. For more information on how to get this parameter, see Getting Organizations. |
Request Body
The following table lists available request properties:
Property | Type | Description |
---|---|---|
name | string | Specifies the name of the backup job. |
description | string | Specifies the description of the backup job. |
backupType | backupType | Specifies the type of the backup job:
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. | |
proxyId | string | Specifies the ID of the backup proxy where the repository with backups is located. |
repositoryId | string | Specifies the ID of the repository where the organization backups will be stored. |
runNow | boolean | If set to true, the job will run right after it is created. |
Mind that if you perform the request in Veeam Backup for Microsoft 365 version 6, REST API v5.0 requires the groupsite property instead of the site property for items of the Group type.
Specify the following properties for the backup job schedule:
Property | Type | Description |
---|---|---|
type | string | Specifies the job schedule type:
|
dailyType | string | Specifies the days when the backup job will run:
|
dailyTime | UTC | Specifies the time when the job will start. |
periodicInterval | string | Specifies the time interval between the job runs:
|
backupWindowEnabled | boolean | If set to true, indicates that a backup window feature is enabled for this job. |
backupWindowSettings | Specifies the job's backup window settings. A backup window is a time period within which the job must be completed. | |
retryEnabled | boolean | If set to true, indicates that Veeam Backup for Microsoft Office 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 job retry attempts (minutes). |
For example:
Request Body: "schedulePolicy": { "backupWindowEnabled": true, "backupWindowSettings": { "backupWindow": [ true, true, true, .. true ], "minuteOffset": 0 }, "type": "Daily", "dailyType": "Wednesday", "dailyTime": "08:00:00", "retryEnabled": true, "retryNumber": 3, "retryWaitInterval": 10 }, |
Specify the following property for the job's backup window:
Property | Type | Description |
---|---|---|
backupWindow | boolean | Specifies 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. |
For example:
Request Body: "backupWindowSettings": { "backupWindow": [ true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false ], } |
Response
The server returns the following response to the client.
Response Codes
A successfully completed operation returns a response code 201 Created.
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 /Organizations/{organizationId}/Jobs resource. The resource has the following URL: /Jobs/{jobId}.
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 an entire organization with the ID 9b538005-3e78-4253-a84e-cc40630747cd.
Request: POST https://abc.tech.local:4443/v5/Organizations/9b538005-3e78-4253-a84e-cc40630747cd/Jobs
Request Header: Authorization: Bearer <Access-Token>
Request Body: { "name": "job office365", "description": "", "backupType": "entireOrganization", "schedulePolicy": { "backupWindowEnabled": false, "type": "Daily", "dailyType": "Everyday", "dailyTime": "01:00:00", "retryEnabled": true, "retryNumber": 3, "retryWaitInterval": 10 }, "repositoryId": "2c9079b0-76b4-415f-bca8-de1450cedf79" }
Response: 201 Created
Response Body: { "id": "e8e3e9d5-29ba-41e6-bab7-25387149141f", "name": "job office365", "description": "", "nextRun": "2017-06-01T08:00:00Z", "isEnabled": true, "backupType": "entireOrganization", "lastStatus": "Stopped", "schedulePolicy": { "backupWindowEnabled": false, "type": "Daily", "dailyType": "Everyday", "dailyTime": "01:00:00", "retryEnabled": true, "retryNumber": 3, "retryWaitInterval": 10 }, "_links": { "self": { "href": "https://abc.tech.local:4443/v5/jobs/e8e3e9d5-29ba-41e6-bab7-25287149141f" }, "organization": { "href": "https://abc.tech.local:4443/v5/organizations/9b538005-3e78-4253-a84e-cc40630747cd" }, "backupRepository": { "href": "https://abc.tech.local:4443/v5/backuprepositories/ce18de31-329d-4f0f-b85e-4424cc2e6821" }, "jobsessions": { "href": "https://abc.tech.local:4443/v5/jobs/e8e3e9d5-29ba-42e6-bab7-25387149141f/jobsessions" }, "excludedItems": { "href": "https://abc.tech.local:4443/v5/jobs/e8e3e9d5-29ba-41e6-bab7-25387149141f/excludedItems" } } } |
Example 2
The example shows how to back up selected items of an organization with the ID 9b538005-3e78-4253-a84e-cc40630747cd.
Request: POST https://abc.tech.local:4443/v5/Organizations/9b538005-3e78-4253-a84e-cc40630747cd/Jobs
Request Header: Authorization: Bearer <Access-Token>
Request Body: { "name": "job SelectedItems office365", "description": "", "nextRun": "2017-05-29T22:00:00Z", "isEnabled": true, "backupType": "selectedItems", "selectedItems": [ { "type": "partialOrganization", "mailbox": true, "archiveMailbox": true, "oneDrive": true, "site": true }, { "type": "User", "user": { "id": "b583d2b8-c143-4b98-a769-fc95ebaa45f600000000-0000-0000-0000-000000000000", "displayName": "USER1", "name": "USER1@organization.onmicrosoft.com", "type": "User" }, "mailbox": true, "archiveMailbox": true, "oneDrive": true, "site": true }, { "type": "Group", "group": { "id": "ca4b3d46-640f-4353-b59b-5beff743ca4c00000000-0000-0000-0000-000000000000", "displayName": "user 1550", "name": "user1550@organization.onmicrosoft.com", "managedBy": "USER1", "site": "https://organization.sharepoint.com/sites/SomeSite", "type": "Office365", "locationType": "Cloud" }, "members": true, "memberMailbox": true, "memberArchiveMailbox": false, "memberOneDrive": true, "memberSite": false, "mailbox": true, "site": false }, { "type": "Site", "site": { "id": "94f50108-75b4-4a5e-89ae-5651ee1e3975fdc607c4-6ac6-47d9-a1f3-cbdbc9766174", "url": "https://organization.sharepoint.com/sites/group2", "name": "Group 2", "isCloud": true, "title": "Group 2", "isAvailable": true } } ], "schedulePolicy": { "backupWindowEnabled": false, "type": "Daily", "dailyType": "Everyday", "dailyTime": "01:00:00", "retryEnabled": true, "retryNumber": 3, "retryWaitInterval": 10 }, "repositoryId": "2c9079b0-76b4-415f-bca8-de1450cedf89" }
Response: 201 Created
Response Body: { "id": "2cc74c52-739f-4ea2-827a-c355e7ecc82c", "name": "job SelectedItems office365", "description": "", "nextRun": "2017-05-29T22:00:00Z", "isEnabled": true, "backupType": "selectedItems", "lastStatus": "Stopped", "schedulePolicy": { "backupWindowEnabled": false, "type": "Daily", "dailyType": "Everyday", "dailyTime": "01:00:00", "retryEnabled": true, "retryNumber": 3, "retryWaitInterval": 10 }, "_links": { "self": { "href": "https://abc.tech.local:4443/v5/jobs/2cc74c52-739f-4ea2-827a-c355e7ecc82c" }, "organization": { "href": "https://abc.tech.local:4443/v5/organizations/9b538005-3e78-4253-a84e-cc40630747cd" }, "backupRepository": { "href": "https://abc.tech.local:4443/v5/backuprepositories/ce18de31-329d-4f0f-b85e-4424cc2e6821" }, "jobsessions": { "href": "https://abc.tech.local:4443/v5/jobs/2cc74c52-739f-4ea2-827a-c355e7ecc82c/jobsessions" }, "selectedItems": { "href": "https://abc.tech.local:4443/v5/jobs/2cc74c52-739f-4ea2-827a-c355e7ecc82c/selectedItems" } } } |
Example 3
The example shows how to exclude items when creating a backup job for an organization with the ID 9b538005-3e78-4253-a84e-cc40630747cd.
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/v5/Organizations/9b538005-3e78-4253-a84e-cc40630747cd/Jobs
Request Header: Authorization: Bearer <Access-Token>
Request Body: { "name": "job exludedItems office365", "description": "", "nextRun": "2017-05-29T22:00:00Z", "isEnabled": true, "backupType": "entireOrganization", "schedulePolicy": { "backupWindowEnabled": false, "type": "Daily", "dailyType": "Everyday", "dailyTime": "01:00:00", "retryEnabled": true, "retryNumber": 3, "retryWaitInterval": 10 }, "repositoryId": "2c9079b0-76b4-415f-bca8-de1450cedf79", "excludedItems":[ { "type":"User", "user":{ "id":"aa7dd142-bad0-41ff-8d4a-bae7ba57b50c00000000-0000-0000-0000-000000000000", "displayName":"Administrator", "name":"administrator@abc.onmicrosoft.com", "type":"User" }, "mailbox":true, "oneDrive":false, "archiveMailbox":false, "site":false }, { "type":"User", "user":{ "id":"defe15d6-5df0-4fa0-aeb1-9be225d7c82b00000000-0000-0000-0000-000000000000", "displayName":"Administrator 2", "name":"administrator2@abc.onmicrosoft.com", "type":"User" }, "mailbox":true, "oneDrive":true, "archiveMailbox":true, "site":true } ] }
Response: 201 Created
Response Body: { "id": "2ac74c52-739f-4ea2-827a-c355e7ecc82a", "name": "job excludedItems office365", "description": "", "nextRun": "2017-05-29T22:00:00Z", "isEnabled": true, "backupType": "entireOrganization", "lastStatus": "Stopped", "schedulePolicy": { "backupWindowEnabled": false, "type": "Daily", "dailyType": "Everyday", "dailyTime": "01:00:00", "retryEnabled": true, "retryNumber": 3, "retryWaitInterval": 10 }, "_links": { "self": { "href": "https://abc.tech.local:4443/v5/jobs/2ac74c52-739f-4ea2-827a-c355e7ecc82a" }, "organization": { "href": "https://abc.tech.local:4443/v5/organizations/9b538005-3e78-4253-a84e-cc40630747cd" }, "backupRepository": { "href": "https://abc.tech.local:4443/v5/backuprepositories/ce18de31-329d-4f0f-b85e-4424cc2e6821" }, "jobsessions": { "href": "https://abc.tech.local:4443/v5/jobs/2ac74c52-739f-4ea2-827a-c355e7ecc82a/jobsessions" }, "excludedItems": { "href": "https://abc.tech.local:4443/v5/jobs/2ac74c52-739f-4ea2-827a-c355e7ecc82a/excludedItems" } } } |