# Remove bind client

**Endpoint**

`DELETE/v2/user/{uuid}/relate-client/{relation.cuid}`

**Link**

{% embed url="<https://stagep.tst-apidmndelss.com/openapi/v2.html#/operations/Users_RemoveRelationClient>" %}

### **Request**

#### **Authentication**

An API key is required for authentication. Include it in the `Authorization` header.

* **Header:** `Authorization`
* **Value:** Your API key token

#### **HTTP Method & URL**

* **Method:** `DELETE`
* **URL:** `https://stagep.tst-apidmndelss.com/v2/user/{uuid}/relate-client/{relation.cuid}`

#### **Path Parameters**

| Parameter           | Type     | Description                               | Required | Example          |
| ------------------- | -------- | ----------------------------------------- | -------- | ---------------- |
| **`uuid`**          | `string` | **Unique identifier of the user**.        | Yes      | `user_abc123def` |
| **`relation.cuid`** | `string` | **Customer/client identifier to remove**. | Yes      | `cust_789xyz`    |

#### **Query Parameters**

| Parameter              | Type      | Description                                     | Required | Example |
| ---------------------- | --------- | ----------------------------------------------- | -------- | ------- |
| **`relation.isOwner`** | `boolean` | **Specify ownership type** for precise removal. | No       | `true`  |

#### **Headers**

| Key             | Value              | Required |
| --------------- | ------------------ | -------- |
| `Authorization` | `Bearer <JWT>`     | Yes      |
| `Accept`        | `application/json` | Yes      |

***

### **Response (200 OK)**

Returns the updated user object confirming the client relationship was successfully removed.

#### **Response Fields**

**User Object (`item`)**

| Field          | Type      | Description                     | Example                |
| -------------- | --------- | ------------------------------- | ---------------------- |
| **`uuid`**     | `string`  | **Unique user identifier**.     | `user_abc123def`       |
| **`username`** | `string`  | **User's login name**.          | `john.smith`           |
| **`status`**   | `string`  | **Current user status**.        | `ACCEPT`               |
| **`is2fa`**    | `boolean` | **2FA enabled status**.         | `true`                 |
| **`createAt`** | `string`  | **Account creation timestamp**. | `2024-01-15T10:30:00Z` |
| **`updateAt`** | `string`  | **Last update timestamp**.      | `2024-03-20T14:22:00Z` |
| **`name`**     | `string`  | **User's full name**.           | `John Smith`           |
| **`comment`**  | `string`  | **Administrative comments**.    | `VIP customer`         |

**Example Response:**

```json
{
  "item": {
    "uuid": "user_abc123def",
    "username": "john.smith",
    "status": "ACCEPT",
    "is2fa": true,
    "createAt": "2024-01-15T10:30:00Z",
    "updateAt": "2024-03-20T14:22:00Z",
    "name": "John Smith",
    "comment": "VIP customer"
  }
}
```

> **Note:** The response shows basic user details. To verify the client relationship was successfully removed, use the **Get User** endpoint which will show the updated `clients` array.

***

### **Examples**

#### **Remove Client Relationship (cURL)**

```bash
curl --request DELETE \
  --url 'https://stagep.tst-apidmndelss.com/v2/user/user_abc123def/relate-client/cust_789xyz' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer eyJhbGci...wNLGA'
```

#### **Remove Specific Ownership Type**

```bash
curl --request DELETE \
  --url 'https://stagep.tst-apidmndelss.com/v2/user/user_456ghi/relate-client/cust_123abc?relation.isOwner=true' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer eyJhbGci...wNLGA'
```

***

### **Error Responses**

1. **User Not Found**:

   ```json
   { "error": "User not found: user_invalid_id" }
   ```
2. **Customer Not Found**:

   ```json
   { "error": "Customer not found: cust_invalid_id" }
   ```
3. **Relationship Not Found**:

   ```json
   { "error": "No relationship found between user and customer" }
   ```
4. **Unauthorized**:

   ```json
   { "error": "Unauthorized" }
   ```
5. **Ownership Mismatch**:

   ```json
   { "error": "No relationship found with specified ownership type" }
   ```

***

### **Notes**

#### **Query Parameter Usage**

* **`relation.isOwner`**: Optional parameter to specify which ownership type to remove
* If omitted, removes all relationships between the user and customer
* If specified, only removes relationships matching the ownership type

#### **Behavior**

* Removes the specified client relationship completely
* User loses all access and permissions for that customer account
* Operation is irreversible - relationship must be recreated if needed

#### **Best Practices**

* Verify the relationship exists before attempting removal
* Use **Get User** endpoint to confirm successful removal
* Consider user impact before removing client access
* Document removal reasons in user comments if needed

**Common Use Cases**:

* Offboarding users from customer accounts
* Revoking administrative privileges
* Cleaning up temporary access grants
* Removing users from deprecated client accounts

**Verification**:\
After removing a client relationship, use the **Get User** endpoint to confirm:

```bash
curl --request GET \
  --url https://stagep.tst-apidmndelss.com/v2/user/user_abc123def \
  --header 'Authorization: Bearer eyJhbGci...wNLGA'
```

Check that the removed customer no longer appears in the `clients` array.

**Security Considerations**:

* Removing owner relationships may affect account management
* Ensure alternative administrators exist before removing owners
* Consider user notifications for access revocation
* Audit trail should record relationship removals

Real request sample

```postman_json
Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjE2NCwiZXhwIjoxNzYxNTczMTA0LCJrZXkiOiI1Y2ZiOGZjN2RmYjk4ZjVkYmIyZTgwNTVkZWFhN2U2Zjk4MzEyYmE3Iiwib3RwX3ZlcmlmaWVkIjpmYWxzZX0.oSBPLvobjQwI5LwfFtWnmUdbnPedujraitSDnW8m3zw
customerId*: DoxdEEV-4IJq-zKeUYqrtqVDK
userId*: 158a190e-c4a9-4e6c-bf9b-4ef74ae345eb
isOwner: True

```

Real response sample

```postman_json
{
  "item": {
    "userId": "5ff73da8-224e-44de-a235-2d7a76c3144c",
    "username": "test@delos.financial",
    "status": "ACCEPT",
    "is2fa": false,
    "createAt": "2024-12-12T15:47:23Z",
    "updateAt": "2025-09-01T06:56:28Z",
    "name": "Test",
    "comment": ""
  }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.delos.financial/users/remove-bind-client.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
