2025.36 Public API / SDK Changes
3 min read
Public API
New Endpoints
tech PATCH Update a File - API to update a file.
Currently, the following updates are supported:
Title update
Move the file to a different folder by specifying the
ownerId
Body
titleoptional, allows updating the title of the folderownerIdoptional, represents the new folder for the file and it should be the id of a folder e.g.:scope_dhjfieurfloakmdle
Example
curl --location --request PATCH 'https://api.uat1.unique.app/public/chat/content/cont_qbkb7pjbo9utjowjyv3qej2z' \
--header 'x-user-id: <user-id>' \
--header 'x-company-id: <company-id>' \
--header 'Authorization: Bearer <api-key>' \
--header 'x-app-id: <app-id>' \
--header 'x-api-version: 2023-12-06' \
--header 'Content-Type: application/json' \
--data '{
"title": "research.pdf",
"ownerId": "scope_kgx251ererfrrm8u56ct91"
}'tech DELETE Delete a File - API to delete a file. If the file is part of a chat, the chatId also needs do be set.
Query params:
chatIdoptional, the id of the chat where the file is. Only needed if the file is part of a chat.
Example
curl --location --request DELETE 'https://api.uat1.unique.app/public/chat/content/cont_rhm1a82w3cy3lcjap8c14kp3?chatId=chat_yb4pmz6jfnzdzxb9raw90me0'' \
--header 'x-user-id: <user-id>' \
--header 'x-company-id: <company-id>' \
--header 'Authorization: Bearer <api-key>' \
--header 'x-app-id: <app-id>' \
--header 'x-api-version: 2023-12-06'tech DELETE Delete a Folder - API to delete a folder. If the folder is not empty or if the user has no WRITE access, the delete will fail.
If recursive is set to true, the endpoint also deletes its subfolders and its contents, behaving exactly like the rm -rf. In case a subfolder has no write access, that folder is considered as failed to delete and the deletion continues with the other subfolders. At the end, the endpoint returns a list of successFolders and failedFolders.
Query params:
recursiveoptional
Example
curl --location --request DELETE 'https://api.uat1.unique.app/public/chat/folder/scope_rhm1a82w3cy3lcjap8c14kp3?recursive=true' \
--header 'x-user-id: <user-id>' \
--header 'x-company-id: <company-id>' \
--header 'Authorization: Bearer <api-key>' \
--header 'x-app-id: <app-id>' \
--header 'x-api-version: 2023-12-06'
SDK
tech Update a File (Compatible with release >.36) - Update a file specified by its contentId.
Currently, the following updates are supported:
Title update:
titleoptional, allows updating the title of the folder
Move the file to a different folder. this can be done by specifying the
ownerId.ownerIdoptional, allows moving the file to a different folder. Represents the new folder for the file and it should be the id of a folder e.g.:scope_dhjfieurfloakmdle.
Example
Move a file to a folder and update its title.
unique_sdk.Content.update(
user_id=user_id,
company_id=company_id,
contentId="cont_ok2343q5owbce80w78hudawu5",
ownerId="scope_e68yz5asho7glfh7c7d041el",
title="Review.txt"
)tech Delete a File (Compatible with release >.36) - Delete a file by its contentId. When deleting by id, if the file is part of a chat, the chatId also needs do be set. If both contentId and filePath are provided, filePath is ignored.
contentIdthe id of the file to be deletedchatIdoptional, the id of the chat where the file is. Only needed if the file is part of a chat
Example
Delete a file from a chat.
unique_sdk.Content.delete(
user_id=user_id,
company_id=company_id,
contentId="cont_ok2343q5owbce80w78hudawu5",
chatId="chat_v3xfa7liv876h89vuiibus1"
)tech Delete a Folder (Compatible with release >.36) - Given a scopeId or folderPath, the function deletes the folder. If the folder is not empty or if the user has no WRITE access, the delete will fail.
If recursive is set to true, the function also deletes its subfolders and its contents, behaving exactly like the rm -rf. In case a subfolder has no write access, that folder is considered as failed to delete and the function continues with the other subfolders. At the end, the function returns a list of successFolders and failedFolders.
Example
Delete recursively by scope id:
unique_sdk.Folder.delete(
user_id=user_id,
company_id=company_id,
scopeId="scope_w78wfn114va9o22s13r03yq",
recursive=True
)Delete by path (non-recursive):
unique_sdk.Folder.delete(
user_id=user_id,
company_id=company_id,
folderPath="/Company/Atlas/Due Dilligence/Arch",
)Check out Unique SDK on PyPI: https://pypi.org/project/unique_sdk/ .
Author |
|
|---|