DocSpace REST API samples
The following examples will show you how to use ONLYOFFICE DocSpace API implemented as REST over HTTP using GET/POST/PUT/DELETE to integrate ONLYOFFICE DocSpace into your own application and interact with its backend.
Basic samples
Add members to a group
This example demonstrates how to add one or more members to an existing group in ONLYOFFICE DocSpace using the API. Optionally, you can rename the group and assign a new manager in the same request.
Authenticate a user by code (2FA)
This example shows how to authenticate in ONLYOFFICE DocSpace using a one-time code from an authenticator app (TOTP) via POST /api/2.0/authentication/:code.
Authenticate a user
This example demonstrates how to authenticate a user in ONLYOFFICE DocSpace using the API and check the authentication with a token received.
Change file or folder ownership
This example demonstrates how to transfer ownership of files and/or folders in ONLYOFFICE DocSpace to another user using the API. This is useful for reassigning responsibility when a project changes owners or a team member leaves.
Copy or move a file to a folder
This example demonstrates how to copy or move a file in ONLYOFFICE DocSpace.
Create and open a new file
This example demonstrates how to create a new file inside a specific folder in ONLYOFFICE DocSpace using the API. After creation, the file is automatically opened in the default web browser using the returned editor link.
Create an API Key
This example demonstrates how to programmatically generate an API key in ONLYOFFICE DocSpace with specific permissions and an expiration period. This is useful when integrating external systems or bots with restricted access scopes.
Create a room and invite a user
This example demonstrates how to programmatically create a new room in ONLYOFFICE DocSpace and invite a user to it via email with specific access permissions.
Create a text file
This example demonstrates how to create a .txt file in a specified folder in ONLYOFFICE DocSpace using the API. You can set a custom title and content for the file when uploading it to a folder.
Create a virtual data room (VDR) with a watermark
This example demonstrates how to create a Virtual Data Room (VDR) in ONLYOFFICE DocSpace using the API. The room is created with a text watermark enabled, including dynamic elements such as UserName and CurrentDate.
Create a backup schedule
This example demonstrates how to create a daily backup schedule in ONLYOFFICE DocSpace using the API (e.g., run every day at 03:00, keep the last 7 backups, optionally include a full portal dump).
Delete an API Key
This example demonstrates how to delete an existing API key in ONLYOFFICE DocSpace by its unique identifier (UUID). Use this operation to revoke a key that is no longer needed or compromised.
Delete the backup history
This example demonstrates how to delete the entire backup history in ONLYOFFICE DocSpace using the API.
Delete backup schedule
This example demonstrates how to delete the current portal’s backup schedule in ONLYOFFICE DocSpace using the API.
Delete a backup
This example demonstrates how to delete a specific backup in ONLYOFFICE DocSpace using the API by providing its unique backup ID.
Duplicate files and folders
This example demonstrates how to duplicate one or more files and folders in ONLYOFFICE DocSpace using the API. The duplicated items will appear in the same location with a modified title.
Enable custom filter mode for a file
This example demonstrates how to enable the Custom Filter mode for a specific file in ONLYOFFICE DocSpace using the API. The Custom Filter feature allows you to restrict spreadsheet views so that users only see their own applied filters.
Get backup history
This example demonstrates how to retrieve the list of existing backups in ONLYOFFICE DocSpace using the API. The history contains information about backup IDs, file names, storage types, and creation/expiration dates.
Get backup progress
This example demonstrates how to check the progress of a backup process in ONLYOFFICE DocSpace using the API. The response includes information such as completion status, backup type, and download link if available.
Get backup schedule
This example demonstrates how to retrieve the current portal’s backup schedule in ONLYOFFICE DocSpace using the API.
Get current token permissions
This example demonstrates how to retrieve the list of permissions (scopes) associated with the currently authenticated token in ONLYOFFICE DocSpace. It helps verify which actions the token can perform (e.g., file access, room management, user operations).
Get folder and room contents
This example demonstrates how to retrieve the contents of a folder or room in ONLYOFFICE DocSpace. The same API endpoint returns both files and subfolders.
Get a group with members
This example demonstrates how to retrieve a group by ID in ONLYOFFICE DocSpace and include its members in the response.
Get login history
This example automates the retrieval of the last login events in ONLYOFFICE DocSpace. It extracts unique user IDs from the latest login records, ensuring that duplicate entries are removed.
Get the restoring progress
This example demonstrates how to retrieve the progress of an ongoing portal restoration process in ONLYOFFICE DocSpace using the API.
Invite user with welcome message
This example demonstrates how to invite a user to ONLYOFFICE DocSpace using the API, check their registration status, and send them a welcome message after successful activation.
Invite users
This example automates the process of creating new users and sending them invitations in ONLYOFFICE DocSpace. It ensures that only newly created users receive invitations, avoiding unnecessary duplicate invites.
List all API Keys
This example demonstrates how to retrieve all API keys associated with the current user in ONLYOFFICE DocSpace. The response includes metadata such as name, permissions, status, and expiration date.
List groups managed by a user
This example demonstrates how to retrieve the list of groups in ONLYOFFICE DocSpace that are managed by a specific user.
Lock and unlock a file
This example demonstrates how to lock or unlock the specified file in ONLYOFFICE DocSpace and get a list of users and their access levels for the file.
Manage active portal connections
This example shows how to manage active user sessions in ONLYOFFICE DocSpace. You can retrieve active sessions, log out all users except the current one, terminate a specific session, or revoke all sessions for a particular user.
Manage files in "My Documents"
This example demonstrates how to interact with a user's personal space ("My Documents") in ONLYOFFICE DocSpace using the API. It includes retrieving contents, uploading a file, creating a new document, and deleting a file.
Manage files
This example demonstrates how to manage files in ONLYOFFICE DocSpace using the API. It covers creating, uploading, updating, and deleting files through API requests.
Manage folders
This example demonstrates how to manage folders in ONLYOFFICE DocSpace using the API. It covers creating, retrieving, renaming, and deleting folders through API requests.
Manage groups
This example demonstrates how to manage groups in ONLYOFFICE DocSpace using the API. It covers creating, retrieving, updating, and deleting groups through API requests. The script follows a logical sequence to demonstrate how to interact with the group management system in a real-world scenario.
Manage a guest user
This example demonstrates how to manage a guest user in ONLYOFFICE DocSpace using the API. The script includes two main operations:
Manage IP restrictions
This example demonstrates how to retrieve and update IP restriction settings in ONLYOFFICE DocSpace using API requests. IP restrictions enhance security by controlling which IP addresses are allowed access, ensuring that only authorized users can log in from designated networks.
Manage login settings
This example demonstrates how to configure login security settings, including failed login attempt limits, account blocking duration, and login monitoring periods using API requests. Managing these settings ensures better protection against brute-force attacks and unauthorized access.
Manage room links
This example demonstrates how to set and retrieve room invitation or external links in ONLYOFFICE DocSpace using the API. These links provide access to rooms based on specified permissions.
Manage rooms
This example demonstrates how to manage rooms in ONLYOFFICE DocSpace using the API. It covers creating, retrieving, renaming, archiving, and deleting rooms through API requests.
Manage the Trash section
This example demonstrates how to retrieve, restore, and empty the contents of the Trash section in ONLYOFFICE DocSpace using the API.
Manage user photo
This example demonstrates how to upload and delete user profile photos in ONLYOFFICE DocSpace using API requests. Managing user profile pictures helps create a personalized and professional experience within the system.
Manage users
This example demonstrates how to manage user accounts in ONLYOFFICE DocSpace using the API. It covers creating, retrieving, terminating, and deleting users, following a structured administrative workflow.
Move members between groups
This example demonstrates how to move all members from one group to another in ONLYOFFICE DocSpace using the API.
Reassign a user’s content to another user
This example demonstrates how to reassign a user’s data to another user in ONLYOFFICE DocSpace via the API: check if reassignment is required, start the reassignment, monitor progress, and optionally terminate the task.
Remove members from a group
This example demonstrates how to remove one or more members from a group in ONLYOFFICE DocSpace using the API.
Restore file to previous version
This example demonstrates how to retrieve the edit history of a file in ONLYOFFICE DocSpace and restore it to a specific previous version using the API.
Restore portal from a backup
This example demonstrates how to restore an ONLYOFFICE DocSpace portal from a specific backup using the API. You can specify the backup ID, storage type, and optional parameters such as user notifications and dump usage.
Retrieve user login audit events
This example demonstrates how to retrieve user login audit activities in ONLYOFFICE DocSpace. You can either fetch the most recent login records or apply filters such as user ID, action type, and time period.
Retrieve billing and payment information
This example demonstrates how to read billing-related information in ONLYOFFICE DocSpace via the API: customer profile, balance by currency, current quota, available quotas, auto top-up settings, and supported currencies.
Search users by extended filter
This example demonstrates how to retrieve a list of users in ONLYOFFICE DocSpace with optional extended filter parameters such as group ID, employee type, administrator status, and result limit.
Search users
This example demonstrates how to search for users in ONLYOFFICE DocSpace by a text query, with optional filters for specific fields such as type, department, or role.
Search users by status
This example demonstrates how to search for users in ONLYOFFICE DocSpace based on their status (e.g., active, pending, disabled) using the API. Additional filters such as query text, department, or custom fields can be applied.
Set developer tools access
This example demonstrates how to configure Developer Tools access settings in ONLYOFFICE DocSpace. You can allow full access or limit it for regular users.
Start a backup manually
This example demonstrates how to start a backup in ONLYOFFICE DocSpace on demand via the API. You can specify the target storage type and whether to include a full portal dump in the backup.
Update an API Key
This example demonstrates how to update an existing API key in DocSpace using the API. You can change the name, permissions, or status of the key by providing its unique ID (UUID).
Update group manager
This example demonstrates how to update group manager in ONLYOFFICE DocSpace.
Update user role
This example demonstrates how to automate user onboarding in ONLYOFFICE DocSpace using the API. It covers creating a user, retrieving their profile, and updating their role.
Integration samples
Add DocSpace users to Trello
This script automates the process of retrieving DocSpace users and adding them to a Trello board. It ensures that all DocSpace team members are onboarded into Trello for project management.
Add Notion users to DocSpace
This script automates the process of retrieving Notion users and adding them to the DocSpace. It ensures that all Notion team members are onboarded into DocSpace.
Add Trello users to DocSpace
This script automates the process of retrieving Trello users and adding them to the DocSpace. It ensures that all Trello team members are onboarded into DocSpace.
Create DocSpace room from Trello board
This integration retrieves the name of a Trello board and creates a new room in ONLYOFFICE DocSpace with the same title. It's helpful for mirroring Trello project structures into your document collaboration environment.
Export DocSpace file to Dropbox
This integration allows you to automatically export files from DocSpace to Dropbox using a presigned download URL. It’s ideal for building document archiving workflows, offloading files to external storage, or syncing selected documents outside of the DocSpace environment.
Generate DocSpace structure from Asana projects
This integration creates collaboration rooms in ONLYOFFICE DocSpace based on Asana projects and generates folders for each task inside the corresponding room. This setup is ideal for aligning your document structure with your project management workflow.
Import Dropbox file to DocSpace
This integration allows you to automatically import files from Dropbox into a specific room in ONLYOFFICE DocSpace. It’s ideal for collecting external resources, migrating document libraries, or building automated submission workflows.
Import Trello card attachments to DocSpace
This integration allows you to automatically import all file attachments from a specific Trello card into an ONLYOFFICE DocSpace room. It's useful for syncing project files, archiving task assets, or aggregating external documentation into a centralized workspace.
Invite DocSpace user from Asana task
This integration automatically retrieves the email of the assignee from an Asana task and invites them to ONLYOFFICE DocSpace. It helps ensure that project contributors are granted access to collaborative workspaces without manual steps.
Share Dropbox folders with DocSpace group members
This integration automates the process of creating shared Dropbox folders for DocSpace group members and inviting them to collaborate.
Share Dropbox folders with DocSpace users
This integration automates the process of sharing Dropbox folders with DocSpace users.