All URIs are relative to https://your-docspace.onlyoffice.com
| Method | HTTP request | Description |
|---|---|---|
| cancel_backup | POST /api/2.0/backup/cancelbackup | Cancel the running backup |
| create_backup_schedule | POST /api/2.0/backup/createbackupschedule | Create the backup schedule |
| delete_backup | DELETE /api/2.0/backup/deletebackup/{id} | Delete the backup |
| delete_backup_history | DELETE /api/2.0/backup/deletebackuphistory | Delete the backup history |
| delete_backup_schedule | DELETE /api/2.0/backup/deletebackupschedule | Delete the backup schedule |
| get_backup_history | GET /api/2.0/backup/getbackuphistory | Get the backup history |
| get_backup_progress | GET /api/2.0/backup/getbackupprogress | Get the backup progress |
| get_backup_schedule | GET /api/2.0/backup/getbackupschedule | Get the backup schedule |
| get_backups_count | GET /api/2.0/backup/getbackupscount | Get the number of backups |
| get_backups_counts | GET /api/2.0/backup/getbackupscountbypaid | Get free and paid backup counts |
| get_backups_service_state | GET /api/2.0/backup/getservicestate | Check whether backups are enabled |
| get_restore_progress | GET /api/2.0/backup/getrestoreprogress | Get the restoring progress |
| start_backup | POST /api/2.0/backup/startbackup | Start the backup |
| start_backup_restore | POST /api/2.0/backup/startrestore | Start the restoring process |
BooleanWrapper cancel_backup()
Drops the backup job of the current portal from the queue, which cancels it if it is still running.
The caller needs the portal settings permission. It answers false, not an error, when there is nothing
to cancel, so the result says whether a job was actually dropped rather than whether the call
succeeded.
This affects backup jobs only: a restoring job cannot be cancelled through the API. The cancelled job
leaves the queue, so a following GET api/2.0/backup/getbackupprogress reports no job at all rather
than a job with the Canceled status.
For more information, see api.onlyoffice.com.
This endpoint does not need any parameter.
Basic, OAuth2, ApiKeyBearer, asc_auth_key, Bearer, OpenId
import docspace_api_sdk
from docspace_api_sdk.models.boolean_wrapper import BooleanWrapper
from docspace_api_sdk.rest import ApiException
from pprint import pprint
configuration = docspace_api_sdk.Configuration(
host = "https://your-docspace.onlyoffice.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization (JWT): Bearer
configuration = docspace_api_sdk.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with docspace_api_sdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = docspace_api_sdk.BackupApi(api_client)
try:
# Cancel the running backup
api_response = api_instance.cancel_backup()
print("The response of BackupApi->cancel_backup:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling BackupApi->cancel_backup: %s\n" % e)- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | True if a backup job was dropped from the queue, false if there was nothing to cancel | * X-RateLimit-Limit - * X-RateLimit-Remaining - * X-RateLimit-Reset - |
| 403 | No permissions to perform this action | - |
| 401 | Unauthorized | - |
| 429 | Too Many Requests. | * Retry-After - |
| 500 | Internal Server Error. | - |
| 502 | Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON. | - |
| 503 | Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
BooleanWrapper create_backup_schedule(create_backup_schedule_request_dto=create_backup_schedule_request_dto)
Sets the backup schedule of the current portal. A portal keeps at most one schedule, so this replaces
the existing one rather than adding a second, and dump writes the schedule of the whole server
instead, which requires the space access permission and works on a standalone installation only.
Scheduled backups have to be allowed by the pricing plan of a portal that is not a standalone
installation.
cronParams is a period plus a time rather than a cron string: hour is the hour of the day from 0
to 23, and day has to be given for EveryWeek, where it is the day of the week from 1 to 7 with
Sunday as 1, and for EveryMonth, where it is the day of the month from 1 to 31. It is left out for
EveryDay, and a weekly or monthly schedule sent without it is rejected with 400 instead of falling
back to a default.
backupsStored is the number of scheduled copies to keep, from 1 to 30, and it defaults to 1. Older
copies are removed by a background cleaner, and only the ones this schedule created: archives made by
POST api/2.0/backup/startbackup are not counted and not removed. A portal whose subscription stops
covering backups has its schedule deleted by the scheduler, not suspended, and its administrators are
notified that the scheduled backup failed.
The keys expected in storageParams are the same as for POST api/2.0/backup/startbackup, except
that they are sent as an array of key and value pairs here and returned as an object by
GET api/2.0/backup/getbackupschedule.
For more information, see api.onlyoffice.com.
| Name | Type | Description | Notes |
|---|---|---|---|
| create_backup_schedule_request_dto | CreateBackupScheduleRequestDto | [optional] |
Basic, OAuth2, ApiKeyBearer, asc_auth_key, Bearer, OpenId
import docspace_api_sdk
from docspace_api_sdk.models.boolean_wrapper import BooleanWrapper
from docspace_api_sdk.models.create_backup_schedule_request_dto import CreateBackupScheduleRequestDto
from docspace_api_sdk.rest import ApiException
from pprint import pprint
configuration = docspace_api_sdk.Configuration(
host = "https://your-docspace.onlyoffice.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization (JWT): Bearer
configuration = docspace_api_sdk.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with docspace_api_sdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = docspace_api_sdk.BackupApi(api_client)
create_backup_schedule_request_dto = docspace_api_sdk.CreateBackupScheduleRequestDto() # CreateBackupScheduleRequestDto | (optional)
try:
# Create the backup schedule
api_response = api_instance.create_backup_schedule(create_backup_schedule_request_dto=create_backup_schedule_request_dto)
print("The response of BackupApi->create_backup_schedule:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling BackupApi->create_backup_schedule: %s\n" % e)- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | True if the schedule was saved | * X-RateLimit-Limit - * X-RateLimit-Remaining - * X-RateLimit-Reset - |
| 400 | The request body cannot be read, cronParams is missing, its period is not a defined value, its hour or day is out of range for the period, which includes a weekly or monthly schedule sent without day, the number of the stored copies is outside 1-30, storageType is not a storage the backups can be written to, a ThirdPartyConsumer schedule has no known module, the folderId or filePath key the storage type needs is missing, the folderId of a Documents schedule is not a number, a dump was requested on a portal that is not a standalone installation, or storageParams repeats a key or, on a dump, contains tenantId |
- |
| 402 | The portal subscription does not cover scheduled backups, has expired or has not been paid | - |
| 403 | No permissions to perform this action | - |
| 404 | The target folder was not found | - |
| 500 | A key or value of storageParams is null, or Local storage was requested on a portal that is not a standalone installation |
- |
| 401 | Unauthorized | - |
| 429 | Too Many Requests. | * Retry-After - |
| 502 | Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON. | - |
| 503 | Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
BooleanWrapper delete_backup(id)
Deletes one backup: first its history record, then the archive in the storage the record points at.
The ID is the one listed by GET api/2.0/backup/getbackuphistory, which is also the taskId the
backup was started with.
Deleting a backup of the whole server rather than of one portal additionally requires the space
access permission. A record that belongs to another portal is left untouched and the call still
answers true, so the result confirms that the request was accepted rather than that anything was
deleted - check with GET api/2.0/backup/getbackuphistory if it matters.
The record is removed before the archive, so when the storage can no longer be reached the archive
stays behind with nothing pointing at it. An ID that no backup has ever had is answered with 404.
For more information, see api.onlyoffice.com.
| Name | Type | Description | Notes |
|---|---|---|---|
| id | UUID | The ID of the backup to delete, taken from the route. It is the id of a record listed by GET api/2.0/backup/getbackuphistory, which is also the taskId the backup was started with. |
Basic, OAuth2, ApiKeyBearer, asc_auth_key, Bearer, OpenId
import docspace_api_sdk
from docspace_api_sdk.models.boolean_wrapper import BooleanWrapper
from docspace_api_sdk.rest import ApiException
from pprint import pprint
configuration = docspace_api_sdk.Configuration(
host = "https://your-docspace.onlyoffice.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization (JWT): Bearer
configuration = docspace_api_sdk.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with docspace_api_sdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = docspace_api_sdk.BackupApi(api_client)
id = UUID('11111111-1111-1111-1111-111111111111') # UUID | The ID of the backup to delete, taken from the route. It is the `id` of a record listed by `GET api/2.0/backup/getbackuphistory`, which is also the `taskId` the backup was started with.
try:
# Delete the backup
api_response = api_instance.delete_backup(id)
print("The response of BackupApi->delete_backup:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling BackupApi->delete_backup: %s\n" % e)- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | True once the request has been accepted, whether or not a backup was deleted | * X-RateLimit-Limit - * X-RateLimit-Remaining - * X-RateLimit-Reset - |
| 402 | The portal subscription has expired or has not been paid | - |
| 403 | No permissions to perform this action | - |
| 404 | There is no backup record with this ID | - |
| 401 | Unauthorized | - |
| 429 | Too Many Requests. | * Retry-After - |
| 500 | Internal Server Error. | - |
| 400 | Bad Request. | - |
| 502 | Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON. | - |
| 503 | Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
BooleanWrapper delete_backup_history(dump=dump)
Deletes every backup of the current portal, both the history records and the archives themselves, and
leaves the backup schedule alone. dump clears the backups of the whole server instead and requires
the space access permission.
The records are walked one by one and a failure on any of them is swallowed, so the result is always
true even when some archives could not be deleted: it does not mean the history is now empty. Call
GET api/2.0/backup/getbackuphistory afterwards to see what is left.
Each record is removed before its archive, so an archive whose deletion fails stays in the storage
with nothing pointing at it.
For more information, see api.onlyoffice.com.
| Name | Type | Description | Notes |
|---|---|---|---|
| dump | bool | Applies the operation to the whole server rather than to the current portal, which requires the space access permission and works on a standalone installation only. Server-wide backups and schedules are kept apart from the ones of a portal, so the two values address different data. | [optional] |
Basic, OAuth2, ApiKeyBearer, asc_auth_key, Bearer, OpenId
import docspace_api_sdk
from docspace_api_sdk.models.boolean_wrapper import BooleanWrapper
from docspace_api_sdk.rest import ApiException
from pprint import pprint
configuration = docspace_api_sdk.Configuration(
host = "https://your-docspace.onlyoffice.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization (JWT): Bearer
configuration = docspace_api_sdk.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with docspace_api_sdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = docspace_api_sdk.BackupApi(api_client)
dump = false # bool | Applies the operation to the whole server rather than to the current portal, which requires the space access permission and works on a standalone installation only. Server-wide backups and schedules are kept apart from the ones of a portal, so the two values address different data. (optional)
try:
# Delete the backup history
api_response = api_instance.delete_backup_history(dump=dump)
print("The response of BackupApi->delete_backup_history:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling BackupApi->delete_backup_history: %s\n" % e)- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | True once every record has been walked, whether or not all of them were deleted | * X-RateLimit-Limit - * X-RateLimit-Remaining - * X-RateLimit-Reset - |
| 402 | The portal subscription has expired or has not been paid | - |
| 403 | No permissions to perform this action | - |
| 401 | Unauthorized | - |
| 429 | Too Many Requests. | * Retry-After - |
| 500 | Internal Server Error. | - |
| 400 | Bad Request. | - |
| 502 | Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON. | - |
| 503 | Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
BooleanWrapper delete_backup_schedule(dump=dump)
Deletes the backup schedule of the current portal, which stops the scheduled backups; dump deletes
the schedule of the whole server instead and requires the space access permission. The archives the
schedule has already produced are kept and stay listed by
GET api/2.0/backup/getbackuphistory - delete them through
DELETE api/2.0/backup/deletebackup/{id} if they are no longer wanted.
The result is always true, including when there was no schedule to delete, so it confirms that the
portal now has none rather than that anything was removed. The deletion is written to the audit trail
either way.
For more information, see api.onlyoffice.com.
| Name | Type | Description | Notes |
|---|---|---|---|
| dump | bool | Applies the operation to the whole server rather than to the current portal, which requires the space access permission and works on a standalone installation only. Server-wide backups and schedules are kept apart from the ones of a portal, so the two values address different data. | [optional] |
Basic, OAuth2, ApiKeyBearer, asc_auth_key, Bearer, OpenId
import docspace_api_sdk
from docspace_api_sdk.models.boolean_wrapper import BooleanWrapper
from docspace_api_sdk.rest import ApiException
from pprint import pprint
configuration = docspace_api_sdk.Configuration(
host = "https://your-docspace.onlyoffice.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization (JWT): Bearer
configuration = docspace_api_sdk.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with docspace_api_sdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = docspace_api_sdk.BackupApi(api_client)
dump = false # bool | Applies the operation to the whole server rather than to the current portal, which requires the space access permission and works on a standalone installation only. Server-wide backups and schedules are kept apart from the ones of a portal, so the two values address different data. (optional)
try:
# Delete the backup schedule
api_response = api_instance.delete_backup_schedule(dump=dump)
print("The response of BackupApi->delete_backup_schedule:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling BackupApi->delete_backup_schedule: %s\n" % e)- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | True once the portal has no backup schedule, whether or not one had to be deleted | * X-RateLimit-Limit - * X-RateLimit-Remaining - * X-RateLimit-Reset - |
| 402 | The portal subscription has expired or has not been paid | - |
| 403 | No permissions to perform this action | - |
| 401 | Unauthorized | - |
| 429 | Too Many Requests. | * Retry-After - |
| 500 | Internal Server Error. | - |
| 400 | Bad Request. | - |
| 502 | Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON. | - |
| 503 | Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
BackupHistoryRecordArrayWrapper get_backup_history(dump=dump)
Lists the backups of the current portal whose archive is still present in the storage it was written
to. The records come back in no particular order, so sort them by createdOn if the newest one is
wanted. dump lists the backups of the whole server instead and requires the space access
permission.
Despite being a read operation, this prunes the history as it goes: a record whose archive is no
longer in its storage is deleted outright, so the list can shrink between two calls without anybody
deleting anything. A record whose storage can no longer be reached at all - a disconnected
third-party account, for instance - is neither returned nor deleted, so it stays invisible while
still occupying the history.
The id of a record is the same value as the taskId that
POST api/2.0/backup/startbackup returned for it, and it is what
DELETE api/2.0/backup/deletebackup/{id} and the backupId of
POST api/2.0/backup/startrestore expect.
For more information, see api.onlyoffice.com.
| Name | Type | Description | Notes |
|---|---|---|---|
| dump | bool | Applies the operation to the whole server rather than to the current portal, which requires the space access permission and works on a standalone installation only. Server-wide backups and schedules are kept apart from the ones of a portal, so the two values address different data. | [optional] |
BackupHistoryRecordArrayWrapper
Basic, OAuth2, ApiKeyBearer, asc_auth_key, Bearer, OpenId
import docspace_api_sdk
from docspace_api_sdk.models.backup_history_record_array_wrapper import BackupHistoryRecordArrayWrapper
from docspace_api_sdk.rest import ApiException
from pprint import pprint
configuration = docspace_api_sdk.Configuration(
host = "https://your-docspace.onlyoffice.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization (JWT): Bearer
configuration = docspace_api_sdk.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with docspace_api_sdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = docspace_api_sdk.BackupApi(api_client)
dump = false # bool | Applies the operation to the whole server rather than to the current portal, which requires the space access permission and works on a standalone installation only. Server-wide backups and schedules are kept apart from the ones of a portal, so the two values address different data. (optional)
try:
# Get the backup history
api_response = api_instance.get_backup_history(dump=dump)
print("The response of BackupApi->get_backup_history:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling BackupApi->get_backup_history: %s\n" % e)- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | The backups whose archive is still stored | * X-RateLimit-Limit - * X-RateLimit-Remaining - * X-RateLimit-Reset - |
| 402 | The portal subscription has expired or has not been paid | - |
| 403 | No permissions to perform this action | - |
| 401 | Unauthorized | - |
| 429 | Too Many Requests. | * Retry-After - |
| 500 | Internal Server Error. | - |
| 400 | Bad Request. | - |
| 502 | Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON. | - |
| 503 | Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
BackupProgressWrapper get_backup_progress(dump=dump)
Reports the state of the backup job of the current portal, and is the operation to poll after
POST api/2.0/backup/startbackup. The queue holds one job per portal, so no job ID is passed in;
dump asks for the state of the server-wide job instead and requires the space access permission.
When there is no such job - none was ever started, or the finished one has already been dropped from
the queue - the call still answers 200, but the body carries no response member at all, so a client
has to treat the payload as optional rather than expect an empty object.
While the job runs, isCompleted is false, error and link are empty strings and progress grows
from 0 to 100. Once it stops, isCompleted turns true and status says how it ended: a non-empty
error is the only report of a failure, warning is set when the archive was written but some files
could not be read or when the job was cancelled, and link becomes the download link to the stored
archive.
For more information, see api.onlyoffice.com.
| Name | Type | Description | Notes |
|---|---|---|---|
| dump | bool | Applies the operation to the whole server rather than to the current portal, which requires the space access permission and works on a standalone installation only. Server-wide backups and schedules are kept apart from the ones of a portal, so the two values address different data. | [optional] |
Basic, OAuth2, ApiKeyBearer, asc_auth_key, Bearer, OpenId
import docspace_api_sdk
from docspace_api_sdk.models.backup_progress_wrapper import BackupProgressWrapper
from docspace_api_sdk.rest import ApiException
from pprint import pprint
configuration = docspace_api_sdk.Configuration(
host = "https://your-docspace.onlyoffice.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization (JWT): Bearer
configuration = docspace_api_sdk.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with docspace_api_sdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = docspace_api_sdk.BackupApi(api_client)
dump = false # bool | Applies the operation to the whole server rather than to the current portal, which requires the space access permission and works on a standalone installation only. Server-wide backups and schedules are kept apart from the ones of a portal, so the two values address different data. (optional)
try:
# Get the backup progress
api_response = api_instance.get_backup_progress(dump=dump)
print("The response of BackupApi->get_backup_progress:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling BackupApi->get_backup_progress: %s\n" % e)- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | The state of the backup job, or an empty payload when there is no such job | * X-RateLimit-Limit - * X-RateLimit-Remaining - * X-RateLimit-Reset - |
| 403 | No permissions to perform this action | - |
| 401 | Unauthorized | - |
| 429 | Too Many Requests. | * Retry-After - |
| 500 | Internal Server Error. | - |
| 400 | Bad Request. | - |
| 502 | Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON. | - |
| 503 | Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ScheduleWrapper get_backup_schedule(dump=dump)
Returns the backup schedule of the current portal. A portal keeps at most one schedule, so no ID is
passed in, and when none is set the call still answers 200 with a body that carries no response
member at all. dump asks for the schedule of the whole server instead of the one of this portal and
requires the space access permission.
The answer cannot be sent back unchanged: storageParams is returned as an object keyed by parameter
name, while POST api/2.0/backup/createbackupschedule expects an array of key and value pairs. For
every storage type except ThirdPartyConsumer the folderId key of the answer is built from the
stored base path rather than read back from the saved parameters, and a schedule that keeps an
unlimited number of copies reports backupsStored as null instead of 0.
For more information, see api.onlyoffice.com.
| Name | Type | Description | Notes |
|---|---|---|---|
| dump | bool | Applies the operation to the whole server rather than to the current portal, which requires the space access permission and works on a standalone installation only. Server-wide backups and schedules are kept apart from the ones of a portal, so the two values address different data. | [optional] |
Basic, OAuth2, ApiKeyBearer, asc_auth_key, Bearer, OpenId
import docspace_api_sdk
from docspace_api_sdk.models.schedule_wrapper import ScheduleWrapper
from docspace_api_sdk.rest import ApiException
from pprint import pprint
configuration = docspace_api_sdk.Configuration(
host = "https://your-docspace.onlyoffice.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization (JWT): Bearer
configuration = docspace_api_sdk.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with docspace_api_sdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = docspace_api_sdk.BackupApi(api_client)
dump = false # bool | Applies the operation to the whole server rather than to the current portal, which requires the space access permission and works on a standalone installation only. Server-wide backups and schedules are kept apart from the ones of a portal, so the two values address different data. (optional)
try:
# Get the backup schedule
api_response = api_instance.get_backup_schedule(dump=dump)
print("The response of BackupApi->get_backup_schedule:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling BackupApi->get_backup_schedule: %s\n" % e)- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | The backup schedule, or an empty payload when none is set | * X-RateLimit-Limit - * X-RateLimit-Remaining - * X-RateLimit-Reset - |
| 402 | The portal subscription has expired or has not been paid | - |
| 403 | No permissions to perform this action | - |
| 401 | Unauthorized | - |
| 429 | Too Many Requests. | * Retry-After - |
| 500 | Internal Server Error. | - |
| 400 | Bad Request. | - |
| 502 | Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON. | - |
| 503 | Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Int32Wrapper get_backups_count(var_from=var_from, to=to, paid=paid)
Counts the backups of the current portal that were created within a period, and paid chooses which
kind is counted: false, the default, counts the ones covered by the free monthly allowance, and true
counts the ones charged to the portal wallet.
The period defaults to the current calendar month - from becomes the first day of the month at
00:00 UTC and to becomes the moment of the call. Both bounds are UTC and inclusive, and a from
later than to is rejected. Called with no parameters at all, this returns exactly the figure the
free monthly allowance is measured against.
The count is over history records rather than over stored archives, so it includes backups that have
already been deleted; use GET api/2.0/backup/getbackuphistory to see what can still be restored.
For more information, see api.onlyoffice.com.
| Name | Type | Description | Notes |
|---|---|---|---|
| var_from | datetime | The start of the period, in UTC and inclusive. It defaults to the first day of the current calendar month at 00:00 UTC, and it has to be no later than to. |
[optional] |
| to | datetime | The end of the period, in UTC and inclusive. It defaults to the moment of the call. | [optional] |
| paid | bool | Counts the backups charged to the portal wallet when true, and the ones covered by the free monthly allowance when false, which is the default. It is read only by GET api/2.0/backup/getbackupscount and is ignored by GET api/2.0/backup/getbackupscountbypaid, which always reports both. |
[optional] |
Basic, OAuth2, ApiKeyBearer, asc_auth_key, Bearer, OpenId
import docspace_api_sdk
from docspace_api_sdk.models.int32_wrapper import Int32Wrapper
from docspace_api_sdk.rest import ApiException
from pprint import pprint
configuration = docspace_api_sdk.Configuration(
host = "https://your-docspace.onlyoffice.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization (JWT): Bearer
configuration = docspace_api_sdk.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with docspace_api_sdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = docspace_api_sdk.BackupApi(api_client)
var_from = '2026-03-01T00:00:00Z' # datetime | The start of the period, in UTC and inclusive. It defaults to the first day of the current calendar month at 00:00 UTC, and it has to be no later than `to`. (optional)
to = '2026-03-31T23:59:59Z' # datetime | The end of the period, in UTC and inclusive. It defaults to the moment of the call. (optional)
paid = false # bool | Counts the backups charged to the portal wallet when true, and the ones covered by the free monthly allowance when false, which is the default. It is read only by `GET api/2.0/backup/getbackupscount` and is ignored by `GET api/2.0/backup/getbackupscountbypaid`, which always reports both. (optional)
try:
# Get the number of backups
api_response = api_instance.get_backups_count(var_from=var_from, to=to, paid=paid)
print("The response of BackupApi->get_backups_count:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling BackupApi->get_backups_count: %s\n" % e)- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | The number of backups created within the period | * X-RateLimit-Limit - * X-RateLimit-Remaining - * X-RateLimit-Reset - |
| 400 | The start of the period is later than its end, or from, to or paid cannot be parsed |
- |
| 403 | No permissions to perform this action | - |
| 401 | Unauthorized | - |
| 429 | Too Many Requests. | * Retry-After - |
| 500 | Internal Server Error. | - |
| 502 | Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON. | - |
| 503 | Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
BackupsCountResultWrapper get_backups_counts(var_from=var_from, to=to, paid=paid)
Counts the backups of the current portal created within a period and splits the result into the ones
covered by the free monthly allowance and the ones charged to the portal wallet, which saves calling
GET api/2.0/backup/getbackupscount twice.
The paid query parameter is accepted but not read here: the answer always carries both figures. The
period behaves as it does for GET api/2.0/backup/getbackupscount - it defaults to the current
calendar month, both bounds are UTC and inclusive, and a from later than to is rejected.
The counts are over history records rather than over stored archives, so they include backups that
have already been deleted.
For more information, see api.onlyoffice.com.
| Name | Type | Description | Notes |
|---|---|---|---|
| var_from | datetime | The start of the period, in UTC and inclusive. It defaults to the first day of the current calendar month at 00:00 UTC, and it has to be no later than to. |
[optional] |
| to | datetime | The end of the period, in UTC and inclusive. It defaults to the moment of the call. | [optional] |
| paid | bool | Counts the backups charged to the portal wallet when true, and the ones covered by the free monthly allowance when false, which is the default. It is read only by GET api/2.0/backup/getbackupscount and is ignored by GET api/2.0/backup/getbackupscountbypaid, which always reports both. |
[optional] |
Basic, OAuth2, ApiKeyBearer, asc_auth_key, Bearer, OpenId
import docspace_api_sdk
from docspace_api_sdk.models.backups_count_result_wrapper import BackupsCountResultWrapper
from docspace_api_sdk.rest import ApiException
from pprint import pprint
configuration = docspace_api_sdk.Configuration(
host = "https://your-docspace.onlyoffice.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization (JWT): Bearer
configuration = docspace_api_sdk.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with docspace_api_sdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = docspace_api_sdk.BackupApi(api_client)
var_from = '2026-03-01T00:00:00Z' # datetime | The start of the period, in UTC and inclusive. It defaults to the first day of the current calendar month at 00:00 UTC, and it has to be no later than `to`. (optional)
to = '2026-03-31T23:59:59Z' # datetime | The end of the period, in UTC and inclusive. It defaults to the moment of the call. (optional)
paid = false # bool | Counts the backups charged to the portal wallet when true, and the ones covered by the free monthly allowance when false, which is the default. It is read only by `GET api/2.0/backup/getbackupscount` and is ignored by `GET api/2.0/backup/getbackupscountbypaid`, which always reports both. (optional)
try:
# Get free and paid backup counts
api_response = api_instance.get_backups_counts(var_from=var_from, to=to, paid=paid)
print("The response of BackupApi->get_backups_counts:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling BackupApi->get_backups_counts: %s\n" % e)- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | The number of free and of paid backups created within the period | * X-RateLimit-Limit - * X-RateLimit-Remaining - * X-RateLimit-Reset - |
| 400 | The start of the period is later than its end, or from, to or paid cannot be parsed |
- |
| 403 | No permissions to perform this action | - |
| 401 | Unauthorized | - |
| 429 | Too Many Requests. | * Retry-After - |
| 500 | Internal Server Error. | - |
| 502 | Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON. | - |
| 503 | Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
BackupServiceStateWrapper get_backups_service_state()
Reports whether the paid backup service is switched on for the current portal. This is a wallet
setting of the portal, not the health of the backup service or of the worker that runs the jobs, so a
false answer does not mean backups are unavailable and a true one does not mean they are working.
While it is on, backups beyond the free monthly allowance are charged to the portal wallet. While it
is off and that allowance is used up, POST api/2.0/backup/startbackup and
POST api/2.0/backup/createbackupschedule answer 402.
Starting a backup once the allowance is used up switches the service on by itself, as soon as a
billing session opens for the portal, so this flag can change without anybody editing the portal
settings.
For more information, see api.onlyoffice.com.
This endpoint does not need any parameter.
Basic, OAuth2, ApiKeyBearer, asc_auth_key, Bearer, OpenId
import docspace_api_sdk
from docspace_api_sdk.models.backup_service_state_wrapper import BackupServiceStateWrapper
from docspace_api_sdk.rest import ApiException
from pprint import pprint
configuration = docspace_api_sdk.Configuration(
host = "https://your-docspace.onlyoffice.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization (JWT): Bearer
configuration = docspace_api_sdk.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with docspace_api_sdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = docspace_api_sdk.BackupApi(api_client)
try:
# Check whether backups are enabled
api_response = api_instance.get_backups_service_state()
print("The response of BackupApi->get_backups_service_state:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling BackupApi->get_backups_service_state: %s\n" % e)- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Whether the paid backup service is switched on for this portal | * X-RateLimit-Limit - * X-RateLimit-Remaining - * X-RateLimit-Reset - |
| 403 | No permissions to perform this action | - |
| 401 | Unauthorized | - |
| 429 | Too Many Requests. | * Retry-After - |
| 500 | Internal Server Error. | - |
| 502 | Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON. | - |
| 503 | Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
BackupProgressWrapper get_restore_progress(dump=dump)
Reports the state of the restoring job, and is the operation to poll after
POST api/2.0/backup/startrestore. It is the only operation of this service that needs no
authorization and the only one that stays reachable while the portal is being restored, which is
exactly the state a client polls it in - every other operation of the service answers 403 then.
dump is read as three states rather than as a flag: omit it to get whichever restoring job concerns
this portal, including a server-wide one, pass false to get the job of this portal only, and pass true
to get the server-wide job; on a portal that is not a standalone installation the value is forced to
false. When there is no matching job the call still answers 200, but the body carries no response
member at all.
isCompleted is the field to poll, a non-empty error is the only report of a failure, and neither
link nor warning is ever filled in for a restoring job.
For more information, see api.onlyoffice.com.
| Name | Type | Description | Notes |
|---|---|---|---|
| dump | bool | Which restoring job to look for, read as three states rather than as a flag: leave it out for whichever job concerns this portal, including a server-wide one, send false for the job of this portal alone, and send true for the server-wide job. On a portal that is not a standalone installation the value is forced to false. | [optional] |
Basic, OAuth2, ApiKeyBearer, asc_auth_key, Bearer, OpenId
import docspace_api_sdk
from docspace_api_sdk.models.backup_progress_wrapper import BackupProgressWrapper
from docspace_api_sdk.rest import ApiException
from pprint import pprint
configuration = docspace_api_sdk.Configuration(
host = "https://your-docspace.onlyoffice.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization (JWT): Bearer
configuration = docspace_api_sdk.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with docspace_api_sdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = docspace_api_sdk.BackupApi(api_client)
dump = false # bool | Which restoring job to look for, read as three states rather than as a flag: leave it out for whichever job concerns this portal, including a server-wide one, send false for the job of this portal alone, and send true for the server-wide job. On a portal that is not a standalone installation the value is forced to false. (optional)
try:
# Get the restoring progress
api_response = api_instance.get_restore_progress(dump=dump)
print("The response of BackupApi->get_restore_progress:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling BackupApi->get_restore_progress: %s\n" % e)- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | The state of the restoring job, or an empty payload when there is no such job | * X-RateLimit-Limit - * X-RateLimit-Remaining - * X-RateLimit-Reset - |
| 429 | Too Many Requests. | * Retry-After - |
| 500 | Internal Server Error. | - |
| 400 | Bad Request. | - |
| 502 | Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON. | - |
| 503 | Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
BackupProgressWrapper start_backup(start_backup_request_dto=start_backup_request_dto)
Queues a backup of the current portal and returns straight away: the archive itself is written by the
separate backup worker service, which picks the job up from an integration event, so the response
reports a progress of 0 and the Created status, and its taskId is the handle to poll with
GET api/2.0/backup/getbackupprogress. The caller needs the portal settings permission, and
dump - a backup of the whole server instead of this one portal - additionally requires the space
access permission and is rejected outside a standalone installation.
The keys expected in storageParams depend on storageType: Documents takes an integer folderId,
ThridpartyDocuments takes a provider-specific non-integer folderId, Local takes filePath and
works on a standalone installation only, ThirdPartyConsumer takes module together with the settings
of that consumer, and DataStore takes no keys at all; the subdir key is added by the operation
itself and must not be sent.
A portal that has already used up the free backups of the current calendar month is charged through the
paid backup service instead, and the call is rejected with 402 when that service is not available to it.
For more information, see api.onlyoffice.com.
| Name | Type | Description | Notes |
|---|---|---|---|
| start_backup_request_dto | StartBackupRequestDto | [optional] |
Basic, OAuth2, ApiKeyBearer, asc_auth_key, Bearer, OpenId
import docspace_api_sdk
from docspace_api_sdk.models.backup_progress_wrapper import BackupProgressWrapper
from docspace_api_sdk.models.start_backup_request_dto import StartBackupRequestDto
from docspace_api_sdk.rest import ApiException
from pprint import pprint
configuration = docspace_api_sdk.Configuration(
host = "https://your-docspace.onlyoffice.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization (JWT): Bearer
configuration = docspace_api_sdk.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with docspace_api_sdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = docspace_api_sdk.BackupApi(api_client)
start_backup_request_dto = docspace_api_sdk.StartBackupRequestDto() # StartBackupRequestDto | (optional)
try:
# Start the backup
api_response = api_instance.start_backup(start_backup_request_dto=start_backup_request_dto)
print("The response of BackupApi->start_backup:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling BackupApi->start_backup: %s\n" % e)- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | The state of the queued backup job | * X-RateLimit-Limit - * X-RateLimit-Remaining - * X-RateLimit-Reset - |
| 400 | The request body cannot be read, the folder ID does not match the storage type or is missing, an item of storageParams is null, has no key or no value, or repeats a key, or a dump was requested on a portal that is not a standalone installation |
- |
| 402 | The portal already uses more storage than its plan allows and the backup goes to Documents, or the free backups of the current month are used up and the paid backup service is not available to this portal or cannot be charged |
- |
| 403 | No permissions to perform this action | - |
| 404 | The target folder or the backup quota was not found | - |
| 500 | Local storage has no filePath or was requested on a portal that is not a standalone installation |
- |
| 401 | Unauthorized | - |
| 429 | Too Many Requests. | * Retry-After - |
| 502 | Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON. | - |
| 503 | Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
BackupProgressWrapper start_backup_restore(start_backup_restore_request_dto=start_backup_restore_request_dto)
Queues the restoring of the current portal from a backup and returns straight away: the work itself is
done by the separate backup worker service, which picks the job up from an integration event, so the
response reports a progress of 0 and the Created status, and the returned taskId is the handle to
poll with GET api/2.0/backup/getrestoreprogress - the one operation of this service that stays
reachable while the portal is being restored, because every other one answers 403 in that state.
The source is given either by backupId, which is the ID of a record from
GET api/2.0/backup/getbackuphistory, or, when backupId is not a GUID, by the filePath key of
storageParams together with the matching storageType; an all-zero GUID is parsed as a GUID and
therefore reaches neither branch.
The caller needs the portal settings permission, restoring has to be allowed by the pricing plan of a
portal that is not a standalone installation, and dump - restoring the whole server rather than this
one portal - additionally requires the space access permission.
For more information, see api.onlyoffice.com.
| Name | Type | Description | Notes |
|---|---|---|---|
| start_backup_restore_request_dto | StartBackupRestoreRequestDto | [optional] |
Basic, OAuth2, ApiKeyBearer, asc_auth_key, Bearer, OpenId
import docspace_api_sdk
from docspace_api_sdk.models.backup_progress_wrapper import BackupProgressWrapper
from docspace_api_sdk.models.start_backup_restore_request_dto import StartBackupRestoreRequestDto
from docspace_api_sdk.rest import ApiException
from pprint import pprint
configuration = docspace_api_sdk.Configuration(
host = "https://your-docspace.onlyoffice.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization (JWT): Bearer
configuration = docspace_api_sdk.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with docspace_api_sdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = docspace_api_sdk.BackupApi(api_client)
start_backup_restore_request_dto = docspace_api_sdk.StartBackupRestoreRequestDto() # StartBackupRestoreRequestDto | (optional)
try:
# Start the restoring process
api_response = api_instance.start_backup_restore(start_backup_restore_request_dto=start_backup_restore_request_dto)
print("The response of BackupApi->start_backup_restore:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling BackupApi->start_backup_restore: %s\n" % e)- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | The state of the queued restoring job | * X-RateLimit-Limit - * X-RateLimit-Remaining - * X-RateLimit-Reset - |
| 400 | The request body cannot be read or has no backupId, backupId is not a GUID and storageParams has no filePath, or an item of storageParams is null, has no key or no value, or repeats a key |
- |
| 402 | The pricing plan of this portal does not allow restoring | - |
| 403 | No permissions to perform this action | - |
| 404 | The backup record was not found, the file given in filePath or its folder was not found, or, for Local storage, no backup archive has been uploaded to the portal |
- |
| 401 | Unauthorized | - |
| 429 | Too Many Requests. | * Retry-After - |
| 500 | Internal Server Error. | - |
| 502 | Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON. | - |
| 503 | Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]