Tutorial

User Isolation

The Synvo API provides enterprise-grade user isolation capabilities within a single account. This powerful feature enables administrators to efficiently manage multiple clients or teams, with each entity operating in their own completely isolated environment.

User isolation extends across all system components:

  • File Systems: Each user has their own dedicated file storage space
  • Query Processing: Queries and responses are contained within user boundaries
  • User Profiles: Profile data and preferences remain strictly separated
  • History & Analytics: Usage patterns and historical data are isolated by user

This comprehensive isolation architecture ensures complete separation of data and profiling between different clients, preventing any cross-contamination of information. Organizations can maintain the highest standards of security and privacy while serving multiple clients through a unified administrative account, simplifying management while preserving data integrity.

Supported Methods for Specified User Isolation

All API operations target the default user unless you specify the sub_user_name parameter. If sub_user_name is provided, actions are performed in that sub-user's isolated storage space. Data, files, and context are never shared between different users, ensuring complete separation.

  • Create Directory — Create a virtual directory in the specified user’s private storage space. Other users cannot see or access directories created here.
  • List File — List only the files and folders owned by the specified user, ensuring complete storage isolation.
  • Upload File — Upload files directly into the specified user’s unique storage scope.
  • Download File — Download files by file ID, but only if the file is owned by the specified user.
  • Update File — Move or rename files within the isolated environment of the specified user. No cross-user access is possible.
  • Delete File — Remove files exclusively from the specified user’s storage.
  • Get File Status — Check the processing status of files for the specified user only. Status information is not shared with other users.
  • Get Context — Retrieve AI conversation context and profiling specific to the specified user, maintaining strict data isolation.

Note: Every API method fully isolates user actions and data. All file operations, queries, and AI interactions are scoped only to the specified user to ensure absolute user data privacy and separation.

Usage Example

User isolation is implemented through the sub_user_name parameter in API requests. This parameter allows administrators to specify which user's environment to access or modify. Below are examples of how to use this feature with various API endpoints:

Creating Directory

To create a directory in the Synvo API environment while maintaining user isolation, the sub_user_name parameter can be optionally specified in your request. If you do not provide a sub_user_name, a directory under the /default path will be created.

import requests

url = "https://api.synvo.ai/file/create_dir"
body = {
    "sub_user_name": "example_user",
    "path": "/project/new_dir"
}
headers = {
    "Content-Type": "application/x-www-form-urlencoded",
    "X-API-Key": "your_api_key_here"
}

response = requests.post(url, data=body, headers=headers)

print(response.text)

Example Output

Here is an example of what the output might look like after executing the request:

{
  "message": "Directory created successfully at /project/new_dir"
}

Listing File

To list files for a specific sub-user, simply include the sub_user_name parameter in your GET request to the /file/list endpoint. This ensures you only access files belonging to that user's storage scope.

import requests

url = "https://api.synvo.ai/file/list?path=%2F&sub_user_name=example_user&recursive=true"

headers = {
    "X-API-Key": "your_api_key_here"
}

response = requests.get(url, headers=headers)

print(response.text)

Example Output

After executing the request, you might see output like:

{
  "items": [
    {
      "is_dir": true,
      "name": "string",
      "path": "string",
      "file_id": "string",
      "size": 0,
      "status": "PENDING",
      "created_at": "2019-08-24T14:15:22Z"
    }
  ],
  "tree": {},
  "version": "string",
  "need_refresh_file": true
}