# Customers

## Create Customer

> Assign entity the role of customer.

```json
{"openapi":"3.0.1","info":{"title":"Roles","version":"1.0"},"tags":[{"name":"Customers","description":"Customers"}],"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":{"CreateCustomerResult":{"title":"CreateCustomerResult","type":"object","properties":{"customerId":{"type":"string","format":"uuid","readOnly":true}},"required":["customerId"]},"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"]},"CustomerData":{"title":"CustomerData","type":"object","required":["entityId","entityType"],"properties":{"entityId":{"type":"string","format":"uuid","description":"Identifier of the entity, natural person, joint person or legal entity, who will become a customer."},"entityType":{"$ref":"#/components/schemas/CustomerEntityTypeEnum"},"refAccounts":{"type":"array","items":{"$ref":"#/components/schemas/RefAccountData"}},"labels":{"type":"array","maxLength":16,"items":{"type":"string","minLength":1},"description":"Up to 16 user-defined labels can be provided to allow grouping of customers as per required logic"}}},"CustomerEntityTypeEnum":{"title":"CustomerEntityTypeEnum","type":"string","enum":["NATURAL_PERSON","LEGAL_ENTITY","JOINT_PERSON"]},"RefAccountData":{"title":"RefAccountData","type":"object","properties":{"bankName":{"type":"string","description":"Name of the bank","minLength":1,"maxLength":255,"pattern":"^.*\\S+.*$"},"iban":{"type":"string","description":"IBAN","pattern":"^[A-Z]{2}[0-9A-Z]{14,31}$","maxLength":33},"bic":{"type":"string","description":"BIC (Business Identifier Code) or SWIFT (Society for Worldwide Interbank Financial Telecommunication) code used to identify a bank internationally","minLength":8,"maxLength":11,"pattern":"^[A-Z]{6}[A-Z\\d]{2}(?:[A-Z\\d]{3})?$"},"type":{"$ref":"#/components/schemas/RefAccountTypeEnum"},"ownerName":{"type":"string","description":"full name of the ref account owner or full name of the company owning the ref account","minLength":1,"maxLength":255,"pattern":"^.*\\S+.*$"}},"required":["iban","ownerName"]},"RefAccountTypeEnum":{"title":"RefAccountTypeEnum","type":"string","enum":["PRIMARY","OTHER"],"description":"Reference account type enum"}}},"paths":{"/roles/customers":{"post":{"summary":"Create Customer","operationId":"create-customer","description":"Assign entity the role of customer.","tags":["Customers"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCustomerResult"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerData"}}}}}}}}
```

## Get Customers

> Get a list of customers.

```json
{"openapi":"3.0.1","info":{"title":"Roles","version":"1.0"},"tags":[{"name":"Customers","description":"Customers"}],"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":{}}}}},"parameters":{"cursor":{"schema":{"type":"string"},"in":"query","name":"cursor","description":"String value used for pagination"},"limit":{"schema":{"type":"integer","default":20,"minimum":1},"in":"query","name":"limit","description":"Maximum number of items to return","required":true},"entityId":{"schema":{"type":"string","format":"uuid"},"name":"entityId","in":"query","description":"Entity ID"},"customerStatus":{"schema":{"$ref":"#/components/schemas/CustomerStatusEnum"},"in":"query","name":"customerStatus","description":"Customer status"},"customerEntityType":{"schema":{"$ref":"#/components/schemas/CustomerEntityTypeEnum"},"in":"query","name":"customerType","description":"Customer type"},"labels":{"schema":{"type":"array","maxLength":16,"items":{"type":"string"}},"in":"query","name":"labels","description":"user-defined labels (elements allow grouping of customers as per required logic) filter; will filter customers that have all of the provided labels"}},"schemas":{"CustomerStatusEnum":{"title":"CustomerStatusEnum","type":"string","description":"Current customer status","enum":["CREATED","REVIEW","REJECTED","INACTIVE","ACTIVE","SUSPENDED","ARCHIVED","RECEIVED","INVALID","PENDING","SUSPENDED_COMPLIANCE","ESTATE","OFFBOARDING"]},"CustomerEntityTypeEnum":{"title":"CustomerEntityTypeEnum","type":"string","enum":["NATURAL_PERSON","LEGAL_ENTITY","JOINT_PERSON"]},"Customers":{"title":"Customers","type":"object","properties":{"data":{"type":"array","description":"Array of customers","items":{"$ref":"#/components/schemas/Customer"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"]},"Customer":{"type":"object","required":["createdOn","customerId","customerStatus","entityId","entityType","modifiedOn"],"properties":{"customerId":{"type":"string","format":"uuid"},"customerStatus":{"$ref":"#/components/schemas/CustomerStatusEnum"},"signedDocumentsRelatedToCustomer":{"type":"array","items":{"$ref":"#/components/schemas/DocumentSignatureRelatedToCustomer"}},"createdOn":{"type":"string","format":"date-time","description":"The date on which the customer was created"},"modifiedOn":{"type":"string","format":"date-time","description":"The date on which the customer was updated"},"cancellationDate":{"type":"string","format":"date-time","description":"The date on which the customer was cancelled (date of offboarding)"},"reassessment":{"$ref":"#/components/schemas/Reassessment"},"entityId":{"type":"string","format":"uuid","description":"Identifier of the entity, natural person, joint person or legal entity, who will become a customer."},"entityType":{"$ref":"#/components/schemas/CustomerEntityTypeEnum"},"refAccounts":{"type":"array","items":{"$ref":"#/components/schemas/RefAccountData"}},"labels":{"type":"array","maxLength":16,"items":{"type":"string","minLength":1},"description":"Up to 16 user-defined labels can be provided to allow grouping of customers as per required logic"}},"title":"Customer"},"DocumentSignatureRelatedToCustomer":{"title":"DocumentSignatureRelatedToCustomer","type":"object","properties":{"partnerDocumentId":{"type":"string","format":"uuid","description":"Id of the partner document which was signed"},"name":{"type":"string","minLength":1,"description":"Name of the document"},"documentType":{"$ref":"#/components/schemas/DocumentSignatureTypeEnum"},"version":{"type":"integer","description":"Version of the document"},"naturalPersonId":{"type":"string","format":"uuid","description":"Id of the natural person, which signed the TERMS_AND_CONDITIONS document for the customer"},"naturalPersonFullName":{"type":"string","minLength":1,"description":"Full name of the natural person, which signed the TERMS_AND_CONDITIONS document for the customer"},"createdOn":{"type":"string","format":"date-time","description":"The date on which the document signature was created","readOnly":true},"modifiedOn":{"type":"string","format":"date-time","description":"The date on which the document signature was modified the last time","readOnly":true}},"required":["partnerDocumentId","name","documentType","version","naturalPersonId","naturalPersonFullName","createdOn","modifiedOn"]},"DocumentSignatureTypeEnum":{"title":"DocumentSignatureTypeEnum","type":"string","enum":["TERMS_AND_CONDITIONS","DATA_PRIVACY_POLICY"]},"Reassessment":{"title":"Reassessment","type":"object","properties":{"reassessmentDate":{"type":"string","format":"date"},"reassessmentType":{"$ref":"#/components/schemas/ReassessmentTypeEnum"},"reassessmentStatus":{"$ref":"#/components/schemas/ReassessmentStatusEnum"}},"required":["reassessmentDate","reassessmentType","reassessmentStatus"]},"ReassessmentTypeEnum":{"title":"ReassessmentTypeEnum","type":"string","enum":["PERIODIC","EVENT_DRIVEN"]},"ReassessmentStatusEnum":{"title":"ReassessmentStatusEnum","type":"string","enum":["SCHEDULED","PENDING","OVERDUE","COMPLETED"]},"RefAccountData":{"title":"RefAccountData","type":"object","properties":{"bankName":{"type":"string","description":"Name of the bank","minLength":1,"maxLength":255,"pattern":"^.*\\S+.*$"},"iban":{"type":"string","description":"IBAN","pattern":"^[A-Z]{2}[0-9A-Z]{14,31}$","maxLength":33},"bic":{"type":"string","description":"BIC (Business Identifier Code) or SWIFT (Society for Worldwide Interbank Financial Telecommunication) code used to identify a bank internationally","minLength":8,"maxLength":11,"pattern":"^[A-Z]{6}[A-Z\\d]{2}(?:[A-Z\\d]{3})?$"},"type":{"$ref":"#/components/schemas/RefAccountTypeEnum"},"ownerName":{"type":"string","description":"full name of the ref account owner or full name of the company owning the ref account","minLength":1,"maxLength":255,"pattern":"^.*\\S+.*$"}},"required":["iban","ownerName"]},"RefAccountTypeEnum":{"title":"RefAccountTypeEnum","type":"string","enum":["PRIMARY","OTHER"],"description":"Reference account type enum"},"Pagination":{"title":"Pagination","type":"object","properties":{"cursor":{"type":"string","description":"String value used for pagination, which should be set in next page request."},"limit":{"type":"integer","description":"Maximum number of returned items"}},"required":["cursor","limit"]},"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/customers":{"get":{"summary":"Get Customers","operationId":"get-customers","description":"Get a list of customers.","tags":["Customers"],"parameters":[{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/entityId"},{"$ref":"#/components/parameters/customerStatus"},{"$ref":"#/components/parameters/customerEntityType"},{"$ref":"#/components/parameters/labels"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customers"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}}}}}}
```

## Get Customer

> Get customer

```json
{"openapi":"3.0.1","info":{"title":"Roles","version":"1.0"},"tags":[{"name":"Customers","description":"Customers"}],"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":{"Customer":{"type":"object","required":["createdOn","customerId","customerStatus","entityId","entityType","modifiedOn"],"properties":{"customerId":{"type":"string","format":"uuid"},"customerStatus":{"$ref":"#/components/schemas/CustomerStatusEnum"},"signedDocumentsRelatedToCustomer":{"type":"array","items":{"$ref":"#/components/schemas/DocumentSignatureRelatedToCustomer"}},"createdOn":{"type":"string","format":"date-time","description":"The date on which the customer was created"},"modifiedOn":{"type":"string","format":"date-time","description":"The date on which the customer was updated"},"cancellationDate":{"type":"string","format":"date-time","description":"The date on which the customer was cancelled (date of offboarding)"},"reassessment":{"$ref":"#/components/schemas/Reassessment"},"entityId":{"type":"string","format":"uuid","description":"Identifier of the entity, natural person, joint person or legal entity, who will become a customer."},"entityType":{"$ref":"#/components/schemas/CustomerEntityTypeEnum"},"refAccounts":{"type":"array","items":{"$ref":"#/components/schemas/RefAccountData"}},"labels":{"type":"array","maxLength":16,"items":{"type":"string","minLength":1},"description":"Up to 16 user-defined labels can be provided to allow grouping of customers as per required logic"}},"title":"Customer"},"CustomerStatusEnum":{"title":"CustomerStatusEnum","type":"string","description":"Current customer status","enum":["CREATED","REVIEW","REJECTED","INACTIVE","ACTIVE","SUSPENDED","ARCHIVED","RECEIVED","INVALID","PENDING","SUSPENDED_COMPLIANCE","ESTATE","OFFBOARDING"]},"DocumentSignatureRelatedToCustomer":{"title":"DocumentSignatureRelatedToCustomer","type":"object","properties":{"partnerDocumentId":{"type":"string","format":"uuid","description":"Id of the partner document which was signed"},"name":{"type":"string","minLength":1,"description":"Name of the document"},"documentType":{"$ref":"#/components/schemas/DocumentSignatureTypeEnum"},"version":{"type":"integer","description":"Version of the document"},"naturalPersonId":{"type":"string","format":"uuid","description":"Id of the natural person, which signed the TERMS_AND_CONDITIONS document for the customer"},"naturalPersonFullName":{"type":"string","minLength":1,"description":"Full name of the natural person, which signed the TERMS_AND_CONDITIONS document for the customer"},"createdOn":{"type":"string","format":"date-time","description":"The date on which the document signature was created","readOnly":true},"modifiedOn":{"type":"string","format":"date-time","description":"The date on which the document signature was modified the last time","readOnly":true}},"required":["partnerDocumentId","name","documentType","version","naturalPersonId","naturalPersonFullName","createdOn","modifiedOn"]},"DocumentSignatureTypeEnum":{"title":"DocumentSignatureTypeEnum","type":"string","enum":["TERMS_AND_CONDITIONS","DATA_PRIVACY_POLICY"]},"Reassessment":{"title":"Reassessment","type":"object","properties":{"reassessmentDate":{"type":"string","format":"date"},"reassessmentType":{"$ref":"#/components/schemas/ReassessmentTypeEnum"},"reassessmentStatus":{"$ref":"#/components/schemas/ReassessmentStatusEnum"}},"required":["reassessmentDate","reassessmentType","reassessmentStatus"]},"ReassessmentTypeEnum":{"title":"ReassessmentTypeEnum","type":"string","enum":["PERIODIC","EVENT_DRIVEN"]},"ReassessmentStatusEnum":{"title":"ReassessmentStatusEnum","type":"string","enum":["SCHEDULED","PENDING","OVERDUE","COMPLETED"]},"CustomerEntityTypeEnum":{"title":"CustomerEntityTypeEnum","type":"string","enum":["NATURAL_PERSON","LEGAL_ENTITY","JOINT_PERSON"]},"RefAccountData":{"title":"RefAccountData","type":"object","properties":{"bankName":{"type":"string","description":"Name of the bank","minLength":1,"maxLength":255,"pattern":"^.*\\S+.*$"},"iban":{"type":"string","description":"IBAN","pattern":"^[A-Z]{2}[0-9A-Z]{14,31}$","maxLength":33},"bic":{"type":"string","description":"BIC (Business Identifier Code) or SWIFT (Society for Worldwide Interbank Financial Telecommunication) code used to identify a bank internationally","minLength":8,"maxLength":11,"pattern":"^[A-Z]{6}[A-Z\\d]{2}(?:[A-Z\\d]{3})?$"},"type":{"$ref":"#/components/schemas/RefAccountTypeEnum"},"ownerName":{"type":"string","description":"full name of the ref account owner or full name of the company owning the ref account","minLength":1,"maxLength":255,"pattern":"^.*\\S+.*$"}},"required":["iban","ownerName"]},"RefAccountTypeEnum":{"title":"RefAccountTypeEnum","type":"string","enum":["PRIMARY","OTHER"],"description":"Reference account type enum"},"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/customers/{customerId}":{"get":{"summary":"Get Customer","operationId":"get-customer","description":"Get customer","tags":["Customers"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}}}}}}
```

## Update Customer

> Update customer

```json
{"openapi":"3.0.1","info":{"title":"Roles","version":"1.0"},"tags":[{"name":"Customers","description":"Customers"}],"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":{}}}}},"parameters":{"requestorId":{"schema":{"type":"string","format":"uuid"},"name":"Requestor-ID","in":"header","required":true,"description":"Unique requestor identification in UUID format"}},"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"]},"CustomerUpdate":{"title":"CustomerUpdate","type":"object","properties":{"labels":{"type":"array","maxLength":16,"description":"Up to 16 user-defined labels can be provided to allow grouping of customers as per required logic","items":{"type":"string","minLength":1}},"refAccounts":{"type":"array","items":{"$ref":"#/components/schemas/RefAccountData"}}}},"RefAccountData":{"title":"RefAccountData","type":"object","properties":{"bankName":{"type":"string","description":"Name of the bank","minLength":1,"maxLength":255,"pattern":"^.*\\S+.*$"},"iban":{"type":"string","description":"IBAN","pattern":"^[A-Z]{2}[0-9A-Z]{14,31}$","maxLength":33},"bic":{"type":"string","description":"BIC (Business Identifier Code) or SWIFT (Society for Worldwide Interbank Financial Telecommunication) code used to identify a bank internationally","minLength":8,"maxLength":11,"pattern":"^[A-Z]{6}[A-Z\\d]{2}(?:[A-Z\\d]{3})?$"},"type":{"$ref":"#/components/schemas/RefAccountTypeEnum"},"ownerName":{"type":"string","description":"full name of the ref account owner or full name of the company owning the ref account","minLength":1,"maxLength":255,"pattern":"^.*\\S+.*$"}},"required":["iban","ownerName"]},"RefAccountTypeEnum":{"title":"RefAccountTypeEnum","type":"string","enum":["PRIMARY","OTHER"],"description":"Reference account type enum"}}},"paths":{"/roles/customers/{customerId}":{"patch":{"summary":"Update Customer","operationId":"update-customer","description":"Update customer","tags":["Customers"],"parameters":[{"$ref":"#/components/parameters/requestorId"}],"responses":{"202":{"description":"Accepted"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerUpdate"}}}}}}}}
```


---

# 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/customers.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.
