{"openapi":"3.0.3","info":{"title":"Spanning Backup for Office 365 API","description":"The Spanning API allows administrators to manage Spanning Backup for Office 365 user licenses. The API endpoint is region-specific; substitute **us** or **eu** for *xx* in the URL documented for each API request.\n\n| Region         | API Region Code | Full API Endpoint URL                  |\n|----------------|-----------------|----------------------------------------|\n| Australia      | ap              | https://o365-api-ap.spanningbackup.com |\n| Canada         | ca              | https://o365-api-ca.spanningbackup.com |\n| European Union | eu              | https://o365-api-eu.spanningbackup.com |\n| United States  | us              | https://o365-api-us.spanningbackup.com |\n| United Kingdom | uk              | https://o365-api-uk.spanningbackup.com |\n| Africa         | af              | https://o365-api-af.spanningbackup.com |\n","contact":{"name":"Support","email":"https://one.kaseya.com/support"},"version":"1.0.0"},"components":{"securitySchemes":{"Basic Auth":{"type":"http","scheme":"basic","description":"When using a HTTP request library, specify your E-Mail address in the username field, and API Key in the password field."}},"schemas":{}},"paths":{"/external/tenant":{"get":{"summary":"Get tenant information","tags":["Tenant"],"security":[{"Basic Auth":[]}],"responses":{"200":{"description":"Successful Response\n| Field         | Type | Description                   |\n|---|---|---|\n| licenses | number | The number of licenses in the tenant. |\n| archivedLicenses | number | The number of archived licenses in the tenant. |\n| licensesType | string | The licenses type in the tenant: STANDARD. |\n| users | number | The number of users in this tenant. |\n| assigned | number | The number of assigned users in the tenant. |\n| assignedStandard | number | The number of assigned users of standard type in the tenant. |\n| assignedArchive | number | The number of assigned users of archive type in the tenant. |\n| sharedMailboxes | number | The number of shared mailboxes in the tenant. |\n| assignedSharedMailboxes | number | The number of assigned shared mailboxes in the tenant |\n| assignedSharedMailboxesStandard | number | The number of assigned shared mailboxes of standard type in the tenant. |\n| assignedSharedMailboxesArchive | number | The number of assigned shared mailboxes of archive type in the tenant. |\n| status | string | The status of the tenant. |\n","content":{"application/json":{"schema":{"type":"object","properties":{"licenses":{"type":"number","example":100,"description":"The number of licenses in the tenant."},"archivedLicenses":{"type":"number","example":50,"description":"The number of archived licenses in the tenant."},"licensesType":{"type":"string","example":"STANDARD","description":"The licenses type in the tenant: STANDARD."},"users":{"type":"number","example":75,"description":"The number of users in this tenant."},"assigned":{"type":"number","example":75,"description":"The number of assigned users in this tenant."},"assignedStandard":{"type":"number","example":60,"description":"The number of assigned users of standard type in the tenant."},"assignedArchive":{"type":"number","example":15,"description":"The number of assigned users of archive type in the tenant."},"sharedMailboxes":{"type":"number","example":25,"description":"The number of shared mailboxes in the tenant."},"assignedSharedMailboxes":{"type":"number","example":25,"description":"The number of assigned shared mailboxes in the tenant."},"assignedSharedMailboxesStandard":{"type":"number","example":15,"description":"The number of assigned shared mailboxes of standard type in the tenant."},"assignedSharedMailboxesArchive":{"type":"number","example":10,"description":"The number of assigned shared mailboxes of archive type in the tenant."},"status":{"type":"string","enum":["active","paid"],"example":"paid","description":"The status of the tenant"}}}}}},"401":{"description":"An error occurred while token verification. Contact https://one.kaseya.com/support if you would like additional information.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}}}}}},"403":{"description":"Login has been rejected. Contact https://one.kaseya.com/support if you would like additional information.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"AccessDenied"}}}}}},"404":{"description":"Tenant Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"TenantNotFound"}}}}}},"429":{"description":"Too many requests was send from IP address. See response headers for retry info.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later."}}}}}}}}},"/external/users/{userPrincipalName}":{"get":{"summary":"Get user information","tags":["User"],"description":"Summary not older than 30 days from now is available.","parameters":[{"schema":{"type":"number"},"in":"query","name":"start","required":false,"description":"The 13 digit start timestamp of backups summary. Default value is today."},{"schema":{"type":"number"},"in":"query","name":"end","required":false,"description":"The 13 digit end timestamp of backups summary. Default value is today."},{"schema":{"type":["boolean","null"]},"in":"query","name":"status","required":false,"description":"Return backups summary in response or not. Default value is true."},{"schema":{"type":"string"},"in":"path","name":"userPrincipalName","required":true,"description":"An Office 365 user principal name."}],"security":[{"Basic Auth":[]}],"responses":{"200":{"description":"Successful response\n| Field | Type | Description |\n|---|---|---|\n| userPrincipalName | string | O365 principal name for this user |\n| email | string | E-Mail address for this user |\n| displayName | string | Display Name for this user |\n| assigned | boolean | The user is assigned a Spanning Backup Standard license |\n| isAdmin | boolean | The user is a Spanning Administrator |\n| isDeleted | boolean | The user is deleted in the tenant's Azure AD |\n| isArchive | boolean | The user is assigned a Spanning Backup Archived license |\n| tags | array | List of the user modifiers |","content":{"application/json":{"schema":{"type":"object","properties":{"userPrincipalName":{"type":"string","example":"user1@example.com","description":"O365 principal name for this user"},"email":{"type":"string","example":"user1@example.com","description":"E-Mail address for this user"},"displayName":{"type":"string","example":"user1@example.com","description":"Display Name for this user"},"msId":{"type":"string","example":"xyz-abc-ezz"},"assigned":{"type":"boolean","example":true,"description":"The user is assigned a Spanning Backup Standard license"},"isAdmin":{"type":"boolean","example":true,"description":"The user is a Spanning Administrator"},"isDeleted":{"type":"boolean","example":true,"description":"The user is deleted in the tenant's Azure AD"},"isArchive":{"type":"boolean","example":true,"description":"The user is assigned a Spanning Backup Archived license"},"tags":{"type":"array","description":"List of the user modifiers","items":{"type":"string","enum":["User","Shared Mailbox","Global Admin","Spanning Admin","Archived (read-only)","No Microsoft License","Deleted From Microsoft"]}},"backupSummary":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","example":"04/21/2021"},"type":{"type":"string","example":"MAIL"},"backup":{"type":"object","properties":{"total":{"type":"number","example":1},"partial":{"type":"number","example":2},"failed":{"type":"number","example":3},"successful":{"type":"number","example":4},"data":{"type":"object","properties":{"created":{"type":"number","example":5},"deleted":{"type":"number","example":6},"failed":{"type":"number","example":7},"total":{"type":"number","example":8},"attempts":{"type":"number","example":9}}}}}}}}}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"The difference between start and end can not be more than 30 days."},"message":{"type":"string","example":"The difference between start and end can not be more than 30 days."}}}}}},"401":{"description":"An error occurred while token verification. Contact https://one.kaseya.com/support if you would like additional information.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}}}}}},"403":{"description":"Login has been rejected. Contact https://one.kaseya.com/support if you would like additional information.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"AccessDenied"}}}}}},"404":{"description":"Tenant user is not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"TenantNotFound"}}}}}},"429":{"description":"Too many requests was send from IP address. See response headers for retry info.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later."}}}}}}}}},"/external/users":{"get":{"summary":"Get tenant users","tags":["User"],"parameters":[{"schema":{"type":"boolean"},"in":"query","name":"inActiveDirectory","required":false,"description":"When specified, limits results to users who do (not) have an Active Directory account."},{"schema":{"type":"number"},"in":"query","name":"start","required":false,"description":"The 13 digit start timestamp of backups summary. Default value is today."},{"schema":{"type":"number"},"in":"query","name":"end","required":false,"description":"The 13 digit end timestamp of backups summary. Default value is today."},{"schema":{"type":["boolean","null"]},"in":"query","name":"status","required":false,"description":"Return backups summary in response or not. Default value is true."},{"schema":{"type":"number"},"in":"query","name":"size","required":false,"description":"The page size value. Default value is 50. Maximum allowed size is 1000."},{"schema":{"type":"string"},"in":"query","name":"msIdOffset","required":false,"description":"A Microsoft id to use as a secondary paging offset. This must be set if sortPropOffset is set."},{"schema":{"type":"string"},"in":"query","name":"sortPropOffset","required":false,"description":"Sort column value to use as a primary paging offset. This must be set if msIdOffset is set."}],"security":[{"Basic Auth":[]}],"responses":{"200":{"description":"Successful response\n| Field | Type | Description |\n|---|---|---|\n| nextLink | string | The url to the next set of users. |\n| users | Object[] | An array of JSON user information objects for the tenant. |","content":{"application/json":{"schema":{"type":"object","properties":{"nextLink":{"type":"string","description":"The url to the next set of users.","example":"http://localhost:10100/users?msIdOffset=ms_id1&sortPropOffset=name123&size=100&inActiveDirectory=false&status=true&start=10&end=20"},"users":{"type":"array","description":"An array of JSON user information objects for the tenant.","items":{"type":"object","properties":{"userPrincipalName":{"type":"string","example":"user1@example.com"},"email":{"type":"string","example":"user1@example.com"},"displayName":{"type":"string","example":"user1@example.com"},"msId":{"type":"string","example":"xyz-abc-ezz"},"assigned":{"type":"boolean","example":true},"isAdmin":{"type":"boolean","example":true},"isDeleted":{"type":"boolean","example":true},"isArchive":{"type":"boolean","example":true},"tags":{"type":"array","description":"List of the user modifiers","items":{"type":"string","enum":["User","Shared Mailbox","Global Admin","Spanning Admin","Archived (read-only)","No Microsoft License","Deleted From Microsoft"]}},"backupSummary":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","example":"04/21/2021"},"type":{"type":"string","example":"MAIL"},"backup":{"type":"object","properties":{"total":{"type":"number","example":1},"partial":{"type":"number","example":2},"failed":{"type":"number","example":3},"successful":{"type":"number","example":4},"data":{"type":"object","properties":{"created":{"type":"number","example":5},"deleted":{"type":"number","example":6},"failed":{"type":"number","example":7},"total":{"type":"number","example":8},"attempts":{"type":"number","example":9}}}}}}}}}}}}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"The difference between start and end can not be more than 7 days."},"message":{"type":"string","example":"The difference between start and end can not be more than 7 days."}}}}}},"401":{"description":"An error occurred while token verification. Contact https://one.kaseya.com/support if you would like additional information.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"AccessDenied"}}}}}},"403":{"description":"Login has been rejected. Contact https://one.kaseya.com/support if you would like additional information.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"AccessDenied"}}}}}},"404":{"description":"Tenant user is not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"TenantNotFound"}}}}}},"429":{"description":"Too many requests was send from IP address. See response headers for retry info.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later."}}}}}}}}},"/external/users/assign":{"post":{"summary":"Assign users","tags":["User"],"description":"If the specified users have not yet been synchronized to Spanning Backup from Azure Active Directory, Spanning Backup will attempt to synchronize the users at the time of the API request and will assign a license (or licenses) if successful. If a single user is not found in the list of users, that user will be omitted from the response list. If all users are not found the result will be a 404.\n\nRequest body:\n| Field | Type | Description |\n|---|---|---|\n| userPrincipalNames | string[] | A string array of Office 365 user principal names. Maximum size is 500. |\n| licenseType | string | The type of license that should be allocated to users. |","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["userPrincipalNames"],"properties":{"userPrincipalNames":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"string"},"description":"A string array of Office 365 user principal names. Maximum size is 500."},"licenseType":{"type":"string","enum":["ARCHIVE","STANDARD"],"description":"The type of license that should be allocated to users."}}}}},"required":true},"security":[{"Basic Auth":[]}],"responses":{"200":{"description":"Successful response\n| Field | Type | Description |\n|---|---|---|\n| userPrincipalNames | string[] | The user principal names that were assigned. |\n| licensed | boolean | True if at least one user is assigned a license. This value will also be true if the user already had a license. |","content":{"application/json":{"schema":{"type":"object","properties":{"userPrincipalNames":{"type":"array","items":{"type":"string"},"description":"The user principal names that were assigned.","example":["user1@test.com","user2@test.com"]},"licensed":{"type":"boolean","description":"True if at least one user is assigned a license. This value will also be true if the user already had a license.","example":true}}}}}},"401":{"description":"An error occurred while token verification. Contact https://one.kaseya.com/support if you would like additional information.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"AccessDenied"}}}}}},"403":{"description":"Login has been rejected. Contact https://one.kaseya.com/support if you would like additional information.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"AccessDenied"}}}}}},"404":{"description":"The users were not found in the tenant.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Users were not found"}}}}}},"429":{"description":"Too many requests was send from IP address. See response headers for retry info.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later."}}}}}}}}},"/external/users/unassign":{"post":{"summary":"Unassign users","tags":["User"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["userPrincipalNames"],"properties":{"userPrincipalNames":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"string"},"description":"A string array of Office 365 user principal names. Maximum size is 500."}}}}},"required":true},"security":[{"Basic Auth":[]}],"responses":{"200":{"description":"Successful response\n| Field | Type | Description |\n|---|---|---|\n| userPrincipalNames | string[] | The user principal names that were un-assigned. |\n| licensed | boolean | False if all users are not assigned a license. This value will also be false if the users did not have a license prior to the call to unassign a license. |","content":{"application/json":{"schema":{"type":"object","properties":{"userPrincipalNames":{"type":"array","items":{"type":"string"},"description":"The user principal names that were un-assigned.","example":["user1@test.com","user2@test.com"]},"licensed":{"type":"boolean","description":"False if all users are not assigned a license. This value will also be false if the users did not have a license prior to the call to unassign a license.","example":true}}}}}},"401":{"description":"An error occurred while token verification. Contact https://one.kaseya.com/support if you would like additional information.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"AccessDenied"}}}}}},"403":{"description":"Login has been rejected. Contact https://one.kaseya.com/support if you would like additional information.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"AccessDenied"}}}}}},"404":{"description":"The users were not found in the tenant.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Users were not found"}}}}}},"429":{"description":"Too many requests was send from IP address. See response headers for retry info.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later."}}}}}}}}},"/external/tenant/backups/summary":{"get":{"summary":"Get tenant backups summary","tags":["Tenant"],"description":"Summary not older than 30 days from now is available.","parameters":[{"schema":{"type":"number","nullable":true},"in":"query","name":"start","required":false,"description":"The 13 digit start timestamp of backups summary. Default value is today."},{"schema":{"type":"number","nullable":true},"in":"query","name":"end","required":false,"description":"The 13 digit end timestamp of backups summary. Default value is today."}],"security":[{"Basic Auth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"MM/DD/YYYY","example":"12/25/2024"},"type":{"type":"string","enum":["CALENDAR","CONTACT","DRIVE","MAIL","SHAREPOINT","SPSITE","TEAMS_CHANNEL"],"example":"MAIL"},"userId":{"type":"number"},"backup":{"type":"object","properties":{"total":{"type":"number","example":1},"partial":{"type":"number","example":2},"failed":{"type":"number","example":3},"successful":{"type":"number","example":4},"data":{"type":"object","properties":{"created":{"type":"number","example":5},"deleted":{"type":"number","example":6},"failed":{"type":"number","example":7},"total":{"type":"number","example":8},"attempts":{"type":"number","example":9}}}}}}}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"The difference between start and end can not be more than 30 days."},"message":{"type":"string","example":"The difference between start and end can not be more than 30 days."}}}}}},"401":{"description":"An error occurred while token verification. Contact https://one.kaseya.com/support if you would like additional information.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized"}}}}}},"403":{"description":"Login has been rejected. Contact https://one.kaseya.com/support if you would like additional information.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"AccessDenied"}}}}}},"429":{"description":"Too many requests was send from IP address. See response headers for retry info.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Too many requests, please try again later."}}}}}}}}}},"servers":[{"description":"Africa Server","url":"https://o365-api-af.spanningbackup.com"},{"description":"Australia Server","url":"https://o365-api-ap.spanningbackup.com"},{"description":"Canada Server","url":"https://o365-api-ca.spanningbackup.com"},{"description":"European Union","url":"https://o365-api-eu.spanningbackup.com"},{"description":"United Kingdom","url":"https://o365-api-uk.spanningbackup.com"},{"description":"United States","url":"https://o365-api-us.spanningbackup.com"}]}