# Webhooks

## Get All Webhooks

> \> Get information about existing webhooks.

```json
{"openapi":"3.0.1","info":{"title":"Webhooks","version":"1.0"},"tags":[{"name":"Webhooks","description":"Webhooks"}],"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":"/oauth2/token","scopes":{}}}}},"schemas":{"Webhook":{"type":"object","properties":{"createdOn":{"type":"string","format":"date-time","readOnly":true},"modifiedOn":{"type":"string","format":"date-time","readOnly":true},"eventType":{"$ref":"#/components/schemas/EventTypeEnum"},"url":{"type":"string","description":"The URL must be HTTPS."},"headers":{"type":"array","description":"List of headers which should be sent to the webhook.","maxItems":5,"items":{"$ref":"#/components/schemas/Header"}}},"required":["createdOn","eventType","modifiedOn","url"],"title":"Webhook"},"EventTypeEnum":{"title":"EventTypeEnum","type":"string","enum":["CUSTOMER_NOTIFICATION","NATURAL_PERSON_NOTIFICATION","IDENTIFICATION_VERIFICATION_NOTIFICATION","DOCUMENT_NOTIFICATION","PARTNER_DOCUMENT_NOTIFICATION","ONBOARDING_NOTIFICATION","CUSTOMER_PRODUCT_NOTIFICATION","LEGAL_ENTITY_SEARCH_NOTIFICATION","LABELS_UPDATE_NOTIFICATION","TRANSFER_NOTIFICATION","DIGITAL_ASSET_ORDER_NOTIFICATION","PROXY_NOTIFICATION","BENEFICIAL_OWNER_NOTIFICATION","USER_NOTIFICATION","RE_TOKEN_PRICES","STRATEGY_NOTIFICATION","OFFBOARDING_NOTIFICATION","LEGAL_ENTITY_NOTIFICATION","LEGAL_REPRESENTATIVE_NOTIFICATION","TRADITIONAL_ASSET_ORDER_NOTIFICATION","PARTNER_NOTIFICATION","JOINT_PERSON_NOTIFICATION","TAX_EXEMPTION_ORDER_NOTIFICATION","CORPORATE_ACTION_NOTIFICATION"]},"Header":{"title":"Header","type":"object","properties":{"name":{"type":"string","description":"Name of the header which should be sent.","pattern":"^\\S+$"},"value":{"type":"string","description":"Value of the header which should be sent."}},"required":["name","value"]}}},"paths":{"/webhooks":{"get":{"summary":"Get All Webhooks","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Webhook"}}}}}},"operationId":"get-webhooks","tags":["Webhooks"],"description":"> Get information about existing webhooks."}}}}
```

## Create or Update Webhook

> \> Create webhook, replacing the webhook for this event type if one already exists. It is possible to create only one webhook per event.

```json
{"openapi":"3.0.1","info":{"title":"Webhooks","version":"1.0"},"tags":[{"name":"Webhooks","description":"Webhooks"}],"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":"/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"]},"WebhookData":{"title":"WebhookData","type":"object","properties":{"eventType":{"$ref":"#/components/schemas/EventTypeEnum"},"url":{"type":"string","description":"The URL must be HTTPS."},"headers":{"type":"array","description":"List of headers which should be sent to the webhook.","maxItems":5,"items":{"$ref":"#/components/schemas/Header"}}},"required":["eventType","url"]},"EventTypeEnum":{"title":"EventTypeEnum","type":"string","enum":["CUSTOMER_NOTIFICATION","NATURAL_PERSON_NOTIFICATION","IDENTIFICATION_VERIFICATION_NOTIFICATION","DOCUMENT_NOTIFICATION","PARTNER_DOCUMENT_NOTIFICATION","ONBOARDING_NOTIFICATION","CUSTOMER_PRODUCT_NOTIFICATION","LEGAL_ENTITY_SEARCH_NOTIFICATION","LABELS_UPDATE_NOTIFICATION","TRANSFER_NOTIFICATION","DIGITAL_ASSET_ORDER_NOTIFICATION","PROXY_NOTIFICATION","BENEFICIAL_OWNER_NOTIFICATION","USER_NOTIFICATION","RE_TOKEN_PRICES","STRATEGY_NOTIFICATION","OFFBOARDING_NOTIFICATION","LEGAL_ENTITY_NOTIFICATION","LEGAL_REPRESENTATIVE_NOTIFICATION","TRADITIONAL_ASSET_ORDER_NOTIFICATION","PARTNER_NOTIFICATION","JOINT_PERSON_NOTIFICATION","TAX_EXEMPTION_ORDER_NOTIFICATION","CORPORATE_ACTION_NOTIFICATION"]},"Header":{"title":"Header","type":"object","properties":{"name":{"type":"string","description":"Name of the header which should be sent.","pattern":"^\\S+$"},"value":{"type":"string","description":"Value of the header which should be sent."}},"required":["name","value"]}}},"paths":{"/webhooks":{"post":{"summary":"Create or Update Webhook","operationId":"create-webhook","tags":["Webhooks"],"responses":{"200":{"description":"OK"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"description":"> Create webhook, replacing the webhook for this event type if one already exists. It is possible to create only one webhook per event.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookData"}}}}}}}}
```

## Delete Webhook

> \> Delete webhook with given eventType.

```json
{"openapi":"3.0.1","info":{"title":"Webhooks","version":"1.0"},"tags":[{"name":"Webhooks","description":"Webhooks"}],"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":"/oauth2/token","scopes":{}}}}}},"paths":{"/webhooks/{eventType}":{"delete":{"summary":"Delete Webhook","operationId":"delete-webhook","tags":["Webhooks"],"responses":{"200":{"description":"Webhook deleted"}},"description":"> Delete webhook with given eventType."}}}}
```

## Get Webhook

> \> Get webhook by eventType.

```json
{"openapi":"3.0.1","info":{"title":"Webhooks","version":"1.0"},"tags":[{"name":"Webhooks","description":"Webhooks"}],"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":"/oauth2/token","scopes":{}}}}},"schemas":{"Webhook":{"type":"object","properties":{"createdOn":{"type":"string","format":"date-time","readOnly":true},"modifiedOn":{"type":"string","format":"date-time","readOnly":true},"eventType":{"$ref":"#/components/schemas/EventTypeEnum"},"url":{"type":"string","description":"The URL must be HTTPS."},"headers":{"type":"array","description":"List of headers which should be sent to the webhook.","maxItems":5,"items":{"$ref":"#/components/schemas/Header"}}},"required":["createdOn","eventType","modifiedOn","url"],"title":"Webhook"},"EventTypeEnum":{"title":"EventTypeEnum","type":"string","enum":["CUSTOMER_NOTIFICATION","NATURAL_PERSON_NOTIFICATION","IDENTIFICATION_VERIFICATION_NOTIFICATION","DOCUMENT_NOTIFICATION","PARTNER_DOCUMENT_NOTIFICATION","ONBOARDING_NOTIFICATION","CUSTOMER_PRODUCT_NOTIFICATION","LEGAL_ENTITY_SEARCH_NOTIFICATION","LABELS_UPDATE_NOTIFICATION","TRANSFER_NOTIFICATION","DIGITAL_ASSET_ORDER_NOTIFICATION","PROXY_NOTIFICATION","BENEFICIAL_OWNER_NOTIFICATION","USER_NOTIFICATION","RE_TOKEN_PRICES","STRATEGY_NOTIFICATION","OFFBOARDING_NOTIFICATION","LEGAL_ENTITY_NOTIFICATION","LEGAL_REPRESENTATIVE_NOTIFICATION","TRADITIONAL_ASSET_ORDER_NOTIFICATION","PARTNER_NOTIFICATION","JOINT_PERSON_NOTIFICATION","TAX_EXEMPTION_ORDER_NOTIFICATION","CORPORATE_ACTION_NOTIFICATION"]},"Header":{"title":"Header","type":"object","properties":{"name":{"type":"string","description":"Name of the header which should be sent.","pattern":"^\\S+$"},"value":{"type":"string","description":"Value of the header which should be sent."}},"required":["name","value"]},"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":{"/webhooks/{eventType}":{"get":{"summary":"Get Webhook","operationId":"get-webhook","tags":["Webhooks"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Webhook"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"description":"> Get webhook by eventType."}}}}
```

## Get All Missing Webhooks

> Get all missing webhooks. This is an auxiliary endpoint to help avoid situations where a notification could be missed.

```json
{"openapi":"3.0.1","info":{"title":"Webhooks","version":"1.0"},"tags":[{"name":"Webhooks","description":"Webhooks"}],"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":"/oauth2/token","scopes":{}}}}},"schemas":{"WebhookMissing":{"title":"WebhookMissing","type":"object","required":["eventType"],"properties":{"eventType":{"$ref":"#/components/schemas/EventTypeEnum"}}},"EventTypeEnum":{"title":"EventTypeEnum","type":"string","enum":["CUSTOMER_NOTIFICATION","NATURAL_PERSON_NOTIFICATION","IDENTIFICATION_VERIFICATION_NOTIFICATION","DOCUMENT_NOTIFICATION","PARTNER_DOCUMENT_NOTIFICATION","ONBOARDING_NOTIFICATION","CUSTOMER_PRODUCT_NOTIFICATION","LEGAL_ENTITY_SEARCH_NOTIFICATION","LABELS_UPDATE_NOTIFICATION","TRANSFER_NOTIFICATION","DIGITAL_ASSET_ORDER_NOTIFICATION","PROXY_NOTIFICATION","BENEFICIAL_OWNER_NOTIFICATION","USER_NOTIFICATION","RE_TOKEN_PRICES","STRATEGY_NOTIFICATION","OFFBOARDING_NOTIFICATION","LEGAL_ENTITY_NOTIFICATION","LEGAL_REPRESENTATIVE_NOTIFICATION","TRADITIONAL_ASSET_ORDER_NOTIFICATION","PARTNER_NOTIFICATION","JOINT_PERSON_NOTIFICATION","TAX_EXEMPTION_ORDER_NOTIFICATION","CORPORATE_ACTION_NOTIFICATION"]}}},"paths":{"/webhooks-missing":{"get":{"summary":"Get All Missing Webhooks","tags":["Webhooks"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WebhookMissing"}}}}}},"operationId":"get-webhooks-missing","description":"Get all missing webhooks. This is an auxiliary endpoint to help avoid situations where a notification could be missed."}}}}
```

## Get Undelivered Webhooks

> Get undelivered webhooks to retry sending them. Undelivered webhooks will be kept in database for 30 days. After this time they may be removed. It is an auxiliary endpoint that helps to find webhooks that have not been delivered.

```json
{"openapi":"3.0.1","info":{"title":"Webhooks","version":"1.0"},"tags":[{"name":"Webhooks","description":"Webhooks"}],"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":"/oauth2/token","scopes":{}}}}},"parameters":{"limit":{"name":"limit","in":"query","description":"Maximum number of items to return","schema":{"type":"integer","default":20,"minimum":1}},"cursor":{"name":"cursor","in":"query","description":"String value used for pagination","schema":{"type":"string"}},"startDate":{"name":"startDate","in":"query","description":"Beginning filter range of the webhook notification that was undelivered. This is not filtering on the webhook creation date in the webhook object.","schema":{"type":"string","format":"date-time"}},"endDate":{"name":"endDate","in":"query","description":"End filter range of the webhook notification that was undelivered. This is not filtering on the webhook creation date in the webhook object.","schema":{"type":"string","format":"date-time"}},"eventType":{"name":"eventType","in":"query","description":"Event type of webhook.","schema":{"$ref":"#/components/schemas/EventTypeEnum"}}},"schemas":{"EventTypeEnum":{"title":"EventTypeEnum","type":"string","enum":["CUSTOMER_NOTIFICATION","NATURAL_PERSON_NOTIFICATION","IDENTIFICATION_VERIFICATION_NOTIFICATION","DOCUMENT_NOTIFICATION","PARTNER_DOCUMENT_NOTIFICATION","ONBOARDING_NOTIFICATION","CUSTOMER_PRODUCT_NOTIFICATION","LEGAL_ENTITY_SEARCH_NOTIFICATION","LABELS_UPDATE_NOTIFICATION","TRANSFER_NOTIFICATION","DIGITAL_ASSET_ORDER_NOTIFICATION","PROXY_NOTIFICATION","BENEFICIAL_OWNER_NOTIFICATION","USER_NOTIFICATION","RE_TOKEN_PRICES","STRATEGY_NOTIFICATION","OFFBOARDING_NOTIFICATION","LEGAL_ENTITY_NOTIFICATION","LEGAL_REPRESENTATIVE_NOTIFICATION","TRADITIONAL_ASSET_ORDER_NOTIFICATION","PARTNER_NOTIFICATION","JOINT_PERSON_NOTIFICATION","TAX_EXEMPTION_ORDER_NOTIFICATION","CORPORATE_ACTION_NOTIFICATION"]},"UndeliveredWebhooks":{"title":"UndeliveredWebhooks","type":"object","properties":{"data":{"type":"array","description":"Array of undelivered webhooks.","items":{"$ref":"#/components/schemas/UndeliveredWebhook"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"]},"UndeliveredWebhook":{"title":"UndeliveredWebhook","type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier of the undelivered webhook."},"webhook":{"$ref":"#/components/schemas/Webhook"},"body":{"type":"string","description":"The body of the webhook request."},"errorMessage":{"type":"string","description":"Error message from the delivery attempt."},"createdOn":{"type":"string","format":"date-time"},"modifiedOn":{"type":"string","format":"date-time"}},"required":["id","webhook","body","errorMessage","createdOn","modifiedOn"]},"Webhook":{"type":"object","properties":{"createdOn":{"type":"string","format":"date-time","readOnly":true},"modifiedOn":{"type":"string","format":"date-time","readOnly":true},"eventType":{"$ref":"#/components/schemas/EventTypeEnum"},"url":{"type":"string","description":"The URL must be HTTPS."},"headers":{"type":"array","description":"List of headers which should be sent to the webhook.","maxItems":5,"items":{"$ref":"#/components/schemas/Header"}}},"required":["createdOn","eventType","modifiedOn","url"],"title":"Webhook"},"Header":{"title":"Header","type":"object","properties":{"name":{"type":"string","description":"Name of the header which should be sent.","pattern":"^\\S+$"},"value":{"type":"string","description":"Value of the header which should be sent."}},"required":["name","value"]},"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"]}}},"paths":{"/undelivered-webhooks":{"get":{"summary":"Get Undelivered Webhooks","description":"Get undelivered webhooks to retry sending them. Undelivered webhooks will be kept in database for 30 days. After this time they may be removed. It is an auxiliary endpoint that helps to find webhooks that have not been delivered.","operationId":"get-undelivered-webhooks","tags":["Webhooks"],"parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startDate"},{"$ref":"#/components/parameters/endDate"},{"$ref":"#/components/parameters/eventType"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UndeliveredWebhooks"}}}}}}}}}
```

## Mark Delivered Webhooks

> Mark the webhook with the specified id and all previous ones as delivered. They will no longer appear in the Get Undelivered Webhooks response.

```json
{"openapi":"3.0.1","info":{"title":"Webhooks","version":"1.0"},"tags":[{"name":"Webhooks","description":"Webhooks"}],"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":"/oauth2/token","scopes":{}}}}},"schemas":{"MarkDeliveredWebhooksData":{"title":"MarkDeliveredWebhooksData","type":"object","properties":{"undeliveredWebhookId":{"description":"Id of the newest undelivered webhook to be marked as delivered. All older webhooks will also be marked.","type":"string","format":"uuid"}},"required":["undeliveredWebhookId"]}}},"paths":{"/undelivered-webhooks":{"post":{"summary":"Mark Delivered Webhooks","description":"Mark the webhook with the specified id and all previous ones as delivered. They will no longer appear in the Get Undelivered Webhooks response.","operationId":"mark-delivered-webhooks","tags":["Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkDeliveredWebhooksData"}}}},"responses":{"200":{"description":"OK"}}}}}}
```
