# Customer Labels

## Get List of Customer Labels with assigned customers count

> Get list of customer labels created by partner with assigned customers count

```json
{"openapi":"3.0.1","info":{"title":"Roles","version":"1.0"},"tags":[{"name":"Customer Labels","description":"Customer Labels"}],"servers":[{"url":"https://tvda-api.platform-test.tradevest.ai","description":"Test"},{"url":"https://tvda-api.platform-pretest.tradevest.ai","description":"Pretest"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://tvdcustomauthdomain.auth.eu-central-1.amazoncognito.com/oauth2/token","scopes":{}}}}},"schemas":{"CustomerLabelWithAssignedCustomersCount":{"title":"CustomerLabelWithAssignedCustomersCount","type":"object","properties":{"label":{"type":"string","minLength":1,"description":"name of customer label"},"customersCount":{"type":"integer","description":"number of customers assigned to label"}},"required":["label","customersCount"]}}},"paths":{"/roles/customer-labels":{"get":{"summary":"Get List of Customer Labels with assigned customers count","operationId":"get-all-customer-labels-with-customers-count","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CustomerLabelWithAssignedCustomersCount"},"description":"list of labels (items to allow grouping of customers as per required logic) with assigned customers count"}}}}},"description":"Get list of customer labels created by partner with assigned customers count","tags":["Customer Labels"]}}}}
```

## Update Customer Label

> Update customer label by changing name. All assigned customers will have updated label name.

```json
{"openapi":"3.0.1","info":{"title":"Roles","version":"1.0"},"tags":[{"name":"Customer Labels","description":"Customer Labels"}],"servers":[{"url":"https://tvda-api.platform-test.tradevest.ai","description":"Test"},{"url":"https://tvda-api.platform-pretest.tradevest.ai","description":"Pretest"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://tvdcustomauthdomain.auth.eu-central-1.amazoncognito.com/oauth2/token","scopes":{}}}}},"schemas":{"ErrorMessage":{"title":"ErrorMessage","type":"object","properties":{"message":{"type":"string"},"responseType":{"type":"string"},"validationString":{"minLength":1,"type":"string"},"requestId":{"type":"string"},"errorCode":{"type":"string","maxLength":255},"errorDetails":{"type":"array","items":{"$ref":"#/components/schemas/ErrorDetails"}}},"required":["message","responseType","requestId"]},"ErrorDetails":{"title":"ErrorDetails","type":"object","properties":{"field":{"type":"string","maxLength":255},"errors":{"type":"array","items":{"$ref":"#/components/schemas/ErrorDetailsExplanation"}}},"required":["field"]},"ErrorDetailsExplanation":{"title":"ErrorDetailsExplanation","type":"object","properties":{"code":{"type":"string","maxLength":255},"parameter":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"CustomerLabelUpdate":{"title":"CustomerLabelUpdate","type":"object","properties":{"name":{"type":"string","minLength":1,"description":"name of customer label"}},"required":["name"]}}},"paths":{"/roles/customer-labels/{labelName}":{"patch":{"summary":"Update Customer Label","operationId":"update-customer-label","responses":{"202":{"description":"Accepted","content":{}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerLabelUpdate"}}}},"description":"Update customer label by changing name. All assigned customers will have updated label name.","tags":["Customer Labels"]}}}}
```

## Remove Label And Its Assignment From All Customers

> Removes label from all assigned customers.

```json
{"openapi":"3.0.1","info":{"title":"Roles","version":"1.0"},"tags":[{"name":"Customer Labels","description":"Customer Labels"}],"servers":[{"url":"https://tvda-api.platform-test.tradevest.ai","description":"Test"},{"url":"https://tvda-api.platform-pretest.tradevest.ai","description":"Pretest"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://tvdcustomauthdomain.auth.eu-central-1.amazoncognito.com/oauth2/token","scopes":{}}}}}},"paths":{"/roles/customer-labels/{labelName}":{"delete":{"summary":"Remove Label And Its Assignment From All Customers","operationId":"remove-label-and-its-assignment-from-all-customers","responses":{"202":{"description":"Accepted"}},"description":"Removes label from all assigned customers.","tags":["Customer Labels"]}}}}
```

## Add Label To All Provided Customers

> Update assignment of customer label to all provided customers. If any customer exceeds the maximum number of labels (16), the request will fail and return in response customer ids that exceeded maximum number of labels. If any customer id is not valid, the request will fail and return in response invalid customer ids.

```json
{"openapi":"3.0.1","info":{"title":"Roles","version":"1.0"},"tags":[{"name":"Customer Labels","description":"Customer Labels"}],"servers":[{"url":"https://tvda-api.platform-test.tradevest.ai","description":"Test"},{"url":"https://tvda-api.platform-pretest.tradevest.ai","description":"Pretest"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://tvdcustomauthdomain.auth.eu-central-1.amazoncognito.com/oauth2/token","scopes":{}}}}},"schemas":{"ErrorMessage":{"title":"ErrorMessage","type":"object","properties":{"message":{"type":"string"},"responseType":{"type":"string"},"validationString":{"minLength":1,"type":"string"},"requestId":{"type":"string"},"errorCode":{"type":"string","maxLength":255},"errorDetails":{"type":"array","items":{"$ref":"#/components/schemas/ErrorDetails"}}},"required":["message","responseType","requestId"]},"ErrorDetails":{"title":"ErrorDetails","type":"object","properties":{"field":{"type":"string","maxLength":255},"errors":{"type":"array","items":{"$ref":"#/components/schemas/ErrorDetailsExplanation"}}},"required":["field"]},"ErrorDetailsExplanation":{"title":"ErrorDetailsExplanation","type":"object","properties":{"code":{"type":"string","maxLength":255},"parameter":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}},"paths":{"/roles/customer-labels/{labelName}/customers":{"patch":{"summary":"Add Label To All Provided Customers","operationId":"add-label-to-all-provided-customers","responses":{"202":{"description":"Accepted","content":{}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"array","items":{"type":"string","format":"uuid"}}}}},"description":"Update assignment of customer label to all provided customers. If any customer exceeds the maximum number of labels (16), the request will fail and return in response customer ids that exceeded maximum number of labels. If any customer id is not valid, the request will fail and return in response invalid customer ids.","tags":["Customer Labels"]}}}}
```

## Remove Label From All Provided Customers

> Remove assignment of customer label from all provided customers. If any customer id is not valid, the request will fail and return in response invalid customer ids.

```json
{"openapi":"3.0.1","info":{"title":"Roles","version":"1.0"},"tags":[{"name":"Customer Labels","description":"Customer Labels"}],"servers":[{"url":"https://tvda-api.platform-test.tradevest.ai","description":"Test"},{"url":"https://tvda-api.platform-pretest.tradevest.ai","description":"Pretest"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://tvdcustomauthdomain.auth.eu-central-1.amazoncognito.com/oauth2/token","scopes":{}}}}},"schemas":{"ErrorMessage":{"title":"ErrorMessage","type":"object","properties":{"message":{"type":"string"},"responseType":{"type":"string"},"validationString":{"minLength":1,"type":"string"},"requestId":{"type":"string"},"errorCode":{"type":"string","maxLength":255},"errorDetails":{"type":"array","items":{"$ref":"#/components/schemas/ErrorDetails"}}},"required":["message","responseType","requestId"]},"ErrorDetails":{"title":"ErrorDetails","type":"object","properties":{"field":{"type":"string","maxLength":255},"errors":{"type":"array","items":{"$ref":"#/components/schemas/ErrorDetailsExplanation"}}},"required":["field"]},"ErrorDetailsExplanation":{"title":"ErrorDetailsExplanation","type":"object","properties":{"code":{"type":"string","maxLength":255},"parameter":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}},"paths":{"/roles/customer-labels/{labelName}/customers":{"post":{"summary":"Remove Label From All Provided Customers","operationId":"remove-label-from-all-provided-customers","responses":{"202":{"description":"Accepted","content":{}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"array","items":{"type":"string","format":"uuid"}}}}},"description":"Remove assignment of customer label from all provided customers. If any customer id is not valid, the request will fail and return in response invalid customer ids.","tags":["Customer Labels"]}}}}
```


---

# 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.tradevest.ai/api-reference/roles/customer-labels.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.
