# 2025.48 Public API / SDK Changes

## Public API

### **New Endpoints**

tech **GET** **Get Users** \- API to retrieve users within a company.

Query Params

- `skip` (optional) - Number of records to skip for pagination (minimum: 0)
- `take` (optional) - Number of records to retrieve (minimum: 1, maximum: 1000)
- `email` (optional) - Filter users by email address
- `displayName` (optional) - Filter users by display name

**Example**

```
curl --location --request GET 'https://api.uat1.unique.app/v1/users?skip=0&take=100&email=john@example.com' \
--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'
```

tech **GET** **Get Groups** \- API to retrieve groups within a company.

Query Params

- `skip` (optional) - Number of records to skip for pagination (minimum: 0)
- `take` (optional) - Number of records to retrieve (minimum: 1, maximum: 1000)
- `name` (optional) - Filter groups by name

**Example**

```
curl --location --request GET 'https://api.uat1.unique.app/v1/groups?skip=0&take=100&name=Engineering' \
--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'
```

tech **PATCH** **Update Group** \- API to update group properties. Currently supports updating the group name.

Path Params

- `groupId` (required) - The ID of the group to update

Body Params

- `name` (optional) - The new name for the group

**Example**

```
curl --location --request PATCH 'https://api.uat1.unique.app/v1/groups/<group-id>' \
--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 '{
  "name": "Updated Group Name"
}'
```

tech **DELETE** **Delete Group** \- API to delete a group.

Query Params

- `groupId` (required) - The ID of the group to delete

**Example**

```
curl --location --request DELETE 'https://api.uat1.unique.app/v1/groups/<group-id>' \
--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'
```

tech **POST** **Create Group** \- API to create a new group within a company.

Body Params

- `name` (required) - The name of the group
- `externalId` (optional) - The external ID of the group
- `parentId` (optional) - The parent group ID for creating nested groups
- `roles` (optional) - Array of roles associated with this group

**Example**

```
curl --location --request POST 'https://api.uat1.unique.app/v1/groups' \
--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 '{}
'
```

tech **POST** **Add Users to Group** \- API to add multiple users to a group.

Path Params

- `groupId` (required) - The ID of the group

Body Params

- `userIds` (required) - Array of user IDs to add to the group

Example

```
curl --location --request POST 'https://api.uat1.unique.app/v1/groups/<group-id>/users' \
--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 '{
  "userIds": ["user-id-1", "user-id-2", "user-id-3"]
}'
```

tech **DELETE** **Remove Users from Group** \- API to remove multiple users from a group.

Path Params

- `groupId` (required) - The ID of the group

Query Params

- `userIds` (required) - Array of user IDs to remove from the group

Example

```
curl --location --request DELETE 'https://api.uat1.unique.app/v1/groups/<group-id>/users?userIds=user1,user3' \
--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'
```

tech **GET Get Messages from Chat** \- API to retrieve all messages from a specific chat with pagination support.

**Path Parameters:**

- `chatId` (required) - The ID of the chat to retrieve messages from

**Query Parameters:**

- `skip` (optional, default: 0) - The number of results to skip for pagination (minimum: 0, maximum: 10000)
- `take` (optional, default: 10) - The number of results to return (minimum: 1, maximum: 1000)

**Response:**
Returns a paginated list of messages ordered by creation time (ascending) with references and assessments included. The response includes:

- `messages` \- Array of message objects
- `totalCount` \- Total number of messages in the chat
- `object` \- "messages"

**Example:**

```
curl --location --request GET 'https://api.uat1.unique.app/public/space/chat/<chat-id>/messages?skip=0&take=50' \
--header 'x-user-id: <user-id>' \
--header 'x-company-id: <company-id>' \
--header 'Authorization: Bearer <api-key>' \
--header 'x-api-version: 2023-12-06' \
--header 'x-app-id: <app-id>'
```

tech **PATCH Update User Configuration -** API to update user-specific configuration settings. This endpoint allows storing custom JSON configuration data for individual users.

**Path Parameters:**

- `userId` (required) - The ID of the user whose configuration should be updated

**Body Parameters:**

- `userConfiguration` (required, JSON object) - User-specific configuration settings

**Example:**

```
curl --location --request PATCH 'https://api.uat1.unique.app/public/chat/users/<user-id>/configuration' \
--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 '{
  "userConfiguration": {
    {"location": "CH"}
  }
}'
```

tech **PATCH Update Group Configuration**\- API to update group-specific configuration settings. This endpoint allows storing custom JSON configuration data for groups.

**Path Parameters:**

- `groupId` (required) - The ID of the group whose configuration should be updated

**Body Parameters:**

- `configuration` (required, JSON object) - Group-specific configuration settings

**Example:**

```
curl --location --request PATCH 'https://api.uat1.unique.app/public/chat/groups/<group-id>/configuration' \
--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 '{
  "configuration": {
    {"email": "team@unique.ai"}
  }
}'
```

tech **GET Get Space by ID -** API to retrieve detailed information about a specific space (assistant).

**Path Parameters:**

- `spaceId` (required) - The ID of the space to retrieve

**Example:**

```
curl --location --request GET 'https://api.uat1.unique.app/public/space/<space-id>' \
--header 'x-user-id: <user-id>' \
--header 'x-company-id: <company-id>' \
--header 'Authorization: Bearer <api-key>' \
--header 'x-api-version: 2023-12-06' \
--header 'x-app-id: <app-id>'
```

### tech GET Get Folder Path by Scope ID

API to retrieve the complete folder path with folder names for a specific folder (scope) ID.

**Path Parameters:**

- `folderId` (required) - The ID of the folder (scope) to retrieve the path for

**Example:**

```
curl --location --request GET 'https://api.uat1.unique.app/public/folder/<folder-id>/path' \
--header 'x-user-id: <user-id>' \
--header 'x-company-id: <company-id>' \
--header 'Authorization: Bearer <api-key>' \
--header 'x-api-version: 2023-12-06' \
--header 'x-app-id: <app-id>'
```

## SDK

### **New Functions**

tech **Get Users -** Get users in a company. You can filter by email, display name, and use pagination with skip and take parameters (max 1000 records per request).

**Example**

```
users = unique_sdk.User.get_users(
    user_id=user_id,
    company_id=company_id,
    skip=0,  # Optional - number of records to skip for pagination
    take=50,  # Optional - number of records to return (max 1000)
    email="user@example.com",  # Optional - filter by email
    displayName="John",  # Optional - filter by display name
)
```

tech **Get Groups -** Get groups in a company. You can filter by name and use pagination with skip and take parameters (max 1000 records per request).

**Example**

```
groups = unique_sdk.Group.get_groups(
    user_id=user_id,
    company_id=company_id,
    skip=0,  # Optional - number of records to skip for pagination
    take=50,  # Optional - number of records to return (max 1000)
    name="Admin",  # Optional - filter by group name
)
```

tech **Update Group -** Update a group's properties in a company. Currently supports updating the group name.

**Example**

```
updated_group = unique_sdk.Group.update_group(
    user_id=user_id,
    company_id=company_id,
    group_id="group_a9cs7wr2z1bg2sxczvltgjch",
    name="New Group Name",  # Optional - update the group name
)
```

tech **Delete Group -** Delete a group in a company by its group ID.

**Example**

```
result = unique_sdk.Group.delete_group(
    user_id=user_id,
    company_id=company_id,
    group_id="group_a9cs7wr2z1bg2sxczvltgjch",
)
```

tech **Create Group -** Create a new group in a company. You can specify the group name (required), external ID, parent group ID, and roles associated with the group.

```
group = unique_sdk.Group.create_group(
    user_id=user_id,
    company_id=company_id,
    name="New Group",  # Required - the name of the group
    externalId="ext_123",  # Optional - external ID for the group
    parentId="group_a9cs7wr2z1bg2sxczvltgjch",  # Optional - parent group ID
    roles=["admin", "editor"],  # Optional - roles associated with the group
)
```

tech **Add Users to Group** \- Add users to a group in a company. Provide an array of user IDs to add as members to the specified group. Returns the created memberships with details including entity ID, group ID, and creation timestamp.

**Example**

```
result = unique_sdk.Group.add_users_to_group(
    user_id=user_id,
    company_id=company_id,
    group_id="group_a9cs7wr2z1bg2sxczvltgjch",
    userIds=["299426678160031752", "2994223678160031752", "26538194270329840"],  # Required - array of user IDs to add to the group
)
```

tech **Remove Users from Group -** Remove users from a group in a company. Provide an array of user IDs to remove from the specified group. Returns a success status indicating whether the operation completed successfully.

**Example**

```
result = unique_sdk.Group.remove_users_from_group(
    user_id=user_id,
    company_id=company_id,
    group_id="group_a9cs7wr2z1bg2sxczvltgjch",
    userIds=["user_id1", "user_id2"],  # Required - array of user IDs to remove from the group
)
```

tech **Get Chat Messages -** Get all messages in a space chat. Returns a paginated list of messages in the specified chat, including system, user, and assistant messages. Supports pagination with skip and take parameters.

**Example**

```
messages = unique_sdk.Space.get_chat_messages(
    user_id=user_id,
    company_id=company_id,
    chat_id="chat_dejfhe729br398",
    skip=0,  # Optional (defaults to 0) - number of messages to skip for pagination
    take=50,  # Optional (defaults to 10) - number of messages to return
)
```

tech **Update User Configuration -** Update the user configuration for the current user. The configuration is stored as a JSON object and can contain any custom key-value pairs needed for your application.

**Example**

```
updated_user = unique_sdk.User.update_user_configuration(
    user_id=user_id,
    company_id=company_id,
    userConfiguration={  # Required - user configuration object (JSON)
        "location": "CH"
    }
)
```

tech **Update Group Configuration** \- Update the group configuration for the specified group. The configuration is stored as a JSON object and can contain any custom key-value pairs needed for your application.

**Example**

```
updated_group = unique_sdk.Group.update_group_configuration(
    user_id=user_id,
    company_id=company_id,
    group_id="group_a9cs7wr2z1bg2sxczvltgjch",
    configuration={  # Required - group configuration object (JSON)
        "email": "team@unique.ai"
    }
)
```

tech **Get Space -** Get detailed information about a space (assistant), including its configuration, modules, scope rules, and MCP servers.

**Example**

```
space = unique_sdk.Space.get_space(
    user_id=user_id,
    company_id=company_id,
    space_id="assistant_hjcdga64bkcjnhu4",
)
```

tech **Get Folder Path by Scope Id -** Get the complete folder path for a given folder ID (scope ID). Returns the full path string with folder names, making it easy to display the folder hierarchy in your application.

**Example**

```
folder_path = unique_sdk.Folder.get_folder_path(
   user_id=user_id,
   company_id=company_id,
   folder_id="scope_h55vqioqklzuq04sdzf7z71l",
)
```

### Updates

tech **Chat against file**\- `chat_against_file` function now allows setting a flag to determine whether the chat should be deleted at the end or not. The default behaviour is that the chat is deleted. If the chat should not be deleted, set the `should_delete_chat` to False.

**Example**

```
latest_message = await unique_sdk.utils.chat_in_space.chat_against_file(
    user_id=user_id,
    company_id=company_id,
    assistant_id="assistant_hjcdga64bkcjnsu4",
    path_to_file="/files/test.pdf",
    displayed_filename="test.pdf"
    mime_type="application/pdf"
    text="Give me a bullet point summary of the file.",
    should_delete_chat=False,
)
```

| **Author** |  |
