# 2025.26 Public API/SDK changes

## Public API

### **New Endpoints**

**Get Folder Info**  
Get the information of a folder based on the folder path or id. This can also be used to check whether a folder exists or not.

- **Example**  
  - `GET` by Id
    
    ```
    curl --location --request GET '<https://gateway.<your-app>>.unique.app/public/chat/folder/info?scopeId=scope_jhsgdf7393bd83ewwer' \
    --header 'x-user-id: <your-user-id>' \
    --header 'x-company-id: <your-company-id>' \
    --header 'Authorization: <your-api-key>' \
    --header 'x-app-id: <your-app-id>' \
    --header 'x-api-version: 2023-12-06' \
    --header 'Content-Type: application/json' \
    ```  
  - `GET` by Folder Path
    
    ```
    curl --location --request GET '<https://gateway.<your-app>>.unique.app/public/chat/folder/info?folderPath=%2FCompany%2FClients%2FPortofolio' \
    --header 'x-user-id: <your-user-id>' \
    --header 'x-company-id: <your-company-id>' \
    --header 'Authorization: <your-api-key>' \
    --header 'x-app-id: <your-app-id>' \
    --header 'x-api-version: 2023-12-06' \
    --header 'Content-Type: application/json' \
    ```

**Add Access to Folder Based on Path**  
Add access for a user or a group of users to a folder based on the path. Previously, this could only be done using the id.

- Set `applyToSubScope` to true if you want to propagate the change to the sub scopes (default is false).
- Use either the path of the folder you want to update (`folderPath`) or the id of the folder (`scopeId`). If both are provided, the scopeId will take precedence.

- **Example**
  
    ```
    curl --location --request PATCH '<https://gateway.<your-app>>.unique.app/public/chat/folder/add-access' \
    --header 'x-user-id: <your-user-id>' \
    --header 'x-company-id: <your-company-id>' \
    --header 'Authorization: <your-api-key>' \
    --header 'x-app-id: <your-app-id>' \
    --header 'x-api-version: 2023-12-06' \
    --header 'Content-Type: application/json' \
    --data '{
        "folderPath": "Company/Clients/Portofolio", # use either folderPath or scopeId
        "scopeId": "scope_jhsgdf7393bd83ewwer, # use either folderPath or scopeId
        "scopeAccesses": [\
            {\
                "entityId": "group_f1pj8i73nbs7c1yl9yjtlwc8",\
                "entityType": "GROUP",\
                "type": "WRITE"\
            }\
        ],
        "applyToSubScopes": true
    }'
    ```

**Remove Access from Folder Based on Path**  
Remove access for a user or a group of users from a folder based on the path. Previously, this could only be done using the id.

- **Example**
  
    ```
    curl --location --request PATCH '<https://gateway.<your-app>>.unique.app/public/chat/folder/remove-access' \
    --header 'x-user-id: <your-user-id>' \
    --header 'x-company-id: <your-company-id>' \
    --header 'Authorization: <your-api-key>' \
    --header 'x-app-id: <your-app-id>' \
    --header 'x-api-version: 2023-12-06' \
    --header 'Content-Type: application/json' \
    --data '{
        "folderPath": "Company/Clients/Portofolio", # use either folderPath or scopeId
        "scopeId": "scope_jhsgdf7393bd83ewwer, # use either folderPath or scopeId
        "scopeAccesses": [\
            {\
                "entityId": "group_f1pj8i73nbs7c1yl9yjtlwc8",\
                "entityType": "GROUP",\
                "type": "WRITE"\
            }\
        ],
        "applyToSubScopes": true
    }'
    ```

**Update the Ingestion Config of a Folder Based on Path**  
Update the ingestion config of a folder based on the path. Previously, this could only be done using the id.

- **Example**
  
    ```
    curl --location --request PATCH '<https://gateway.<your-app>>.unique.app/public/folder/ingestion-config' \
    --header 'x-user-id: <your-user-id>' \
    --header 'x-company-id: <your-company-id>' \
    --header 'Authorization: <your-api-key>' \
    --header 'x-app-id: <your-app-id>' \
    --header 'x-api-version: 2023-12-06' \
    --header 'Content-Type: application/json' \
    --data '{
        "folderPath": "Company/Clients/Portofolio", # use either folderPath or scopeId
        "scopeId": "scope_jhsgdf7393bd83ewwer, # use either folderPath or scopeId
        "ingestionConfig": {
            "chunkMaxTokens": 1000,
            "chunkMaxTokensOnePager": 500,
            "chunkMinTokens": 100
        },
        "applyToSubScopes": true
    }'
    ```

The updates above are also available in the SDK. Check out Unique SDK on PyPI: [https://pypi.org/project/unique_sdk/](https://pypi.org/project/unique_sdk/) .
