# Overview

## GET /v2.0/admin/webhook-subscriptions

> Returns all webhook subscriptions for the merchant

```json
{"openapi":"3.0.0","info":{"title":"Inveterate Public API","version":"v2.0"},"paths":{"/v2.0/admin/webhook-subscriptions":{"get":{"operationId":"WebhookSubscriptionsController_findAll","summary":"","description":"Returns all webhook subscriptions for the merchant","parameters":[{"name":"X-Inveterate-Api-Key","in":"header","description":"Your private Inveterate API key.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Returned upon successful direct action to our database. Action is immediate.","schema":{"allOf":[{"$ref":"#/components/schemas/ResponseBodyDto"}]},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseBodyDto"}}}},"400":{"description":"Returned upon a malformed request. Check your API key, URL parameters, and body parameters when this error is returned. Generally, if you see this error, that also means NO action was taken on our backend.","schema":{"allOf":[{"$ref":"#/components/schemas/ResponseBodyDto"}]},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseBodyDto"}}}},"500":{"description":"Returned for all other errors. Generally these come from our backend. Some multipart functions may execute somewhat and then fail, causing some data to be updated.","schema":{"allOf":[{"$ref":"#/components/schemas/ResponseBodyDto"}]},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseBodyDto"}}}}},"tags":["Admin - Webhooks"]}}},"components":{"schemas":{"ResponseBodyDto":{"type":"object","properties":{"message":{"type":"string","description":"The message associated with the response. Generally, the message only confirms the requested action. In the case of errors, the message will give insight into the source of the error."},"data":{"type":"object","description":"The data associated with the response. Data is only returned from errors if the error originates from our backend to give further insight into the nature of the error."}},"required":["message","data"]}}}}
```

## POST /v2.0/admin/webhook-subscriptions

> Creates a new webhook subscription for the merchant

```json
{"openapi":"3.0.0","info":{"title":"Inveterate Public API","version":"v2.0"},"paths":{"/v2.0/admin/webhook-subscriptions":{"post":{"operationId":"WebhookSubscriptionsController_create","summary":"","description":"Creates a new webhook subscription for the merchant","parameters":[{"name":"X-Inveterate-Api-Key","in":"header","description":"Your private Inveterate API key.","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookSubscriptionDto"}}}},"responses":{"201":{"description":"Returned upon successful request made to our backend. Requests that return this code may take a small amount of time after successful API return to fully update.","schema":{"allOf":[{"$ref":"#/components/schemas/ResponseBodyDto"}]},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseBodyDto"}}}},"400":{"description":"Returned upon a malformed request. Check your API key, URL parameters, and body parameters when this error is returned. Generally, if you see this error, that also means NO action was taken on our backend.","schema":{"allOf":[{"$ref":"#/components/schemas/ResponseBodyDto"}]},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseBodyDto"}}}},"500":{"description":"Returned for all other errors. Generally these come from our backend. Some multipart functions may execute somewhat and then fail, causing some data to be updated.","schema":{"allOf":[{"$ref":"#/components/schemas/ResponseBodyDto"}]},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseBodyDto"}}}}},"tags":["Admin - Webhooks"]}}},"components":{"schemas":{"CreateWebhookSubscriptionDto":{"type":"object","properties":{"topic":{"enum":["customer.joined.paid_tier","customer.joined.free_tier","customer.joined.free_trial","customer.joined.lifetime_tier","customer.changed_tier","customer.ordered","customer.payment_succeeded","customer.payment_failed","customer_billing.attempt.failed","customer.credits.updated","customer.credits.expired","customer.cancelled","customer.pending_cancellation","customer.updated","customer.payment_methods.updated"],"type":"string","description":"The subscription topic (will be used as sort key)."},"callbackUrl":{"type":"string","description":"The callback URL that will be called when one of the webhooks is triggered."},"name":{"type":"string","description":"The subscription name."}},"required":["topic","callbackUrl","name"]},"ResponseBodyDto":{"type":"object","properties":{"message":{"type":"string","description":"The message associated with the response. Generally, the message only confirms the requested action. In the case of errors, the message will give insight into the source of the error."},"data":{"type":"object","description":"The data associated with the response. Data is only returned from errors if the error originates from our backend to give further insight into the nature of the error."}},"required":["message","data"]}}}}
```

## PUT /v2.0/admin/webhook-subscriptions

> Updates an existing webhook subscription configuration

```json
{"openapi":"3.0.0","info":{"title":"Inveterate Public API","version":"v2.0"},"paths":{"/v2.0/admin/webhook-subscriptions":{"put":{"operationId":"WebhookSubscriptionsController_update","summary":"","description":"Updates an existing webhook subscription configuration","parameters":[{"name":"X-Inveterate-Api-Key","in":"header","description":"Your private Inveterate API key.","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWebhookSubscriptionDto"}}}},"responses":{"200":{"description":"Returned upon successful direct action to our database. Action is immediate.","schema":{"allOf":[{"$ref":"#/components/schemas/ResponseBodyDto"}]},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseBodyDto"}}}},"400":{"description":"Returned upon a malformed request. Check your API key, URL parameters, and body parameters when this error is returned. Generally, if you see this error, that also means NO action was taken on our backend.","schema":{"allOf":[{"$ref":"#/components/schemas/ResponseBodyDto"}]},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseBodyDto"}}}},"500":{"description":"Returned for all other errors. Generally these come from our backend. Some multipart functions may execute somewhat and then fail, causing some data to be updated.","schema":{"allOf":[{"$ref":"#/components/schemas/ResponseBodyDto"}]},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseBodyDto"}}}}},"tags":["Admin - Webhooks"]}}},"components":{"schemas":{"UpdateWebhookSubscriptionDto":{"type":"object","properties":{"topic":{"enum":["customer.joined.paid_tier","customer.joined.free_tier","customer.joined.free_trial","customer.joined.lifetime_tier","customer.changed_tier","customer.ordered","customer.payment_succeeded","customer.payment_failed","customer_billing.attempt.failed","customer.credits.updated","customer.credits.expired","customer.cancelled","customer.pending_cancellation","customer.updated","customer.payment_methods.updated"],"type":"string","description":"The subscription topic to update."},"callbackUrl":{"type":"string","description":"The callback URL that will be called when one of the webhooks is triggered."},"name":{"type":"string","description":"The subscription name."},"id":{"type":"string","description":"The subscription ID."}},"required":["topic","id"]},"ResponseBodyDto":{"type":"object","properties":{"message":{"type":"string","description":"The message associated with the response. Generally, the message only confirms the requested action. In the case of errors, the message will give insight into the source of the error."},"data":{"type":"object","description":"The data associated with the response. Data is only returned from errors if the error originates from our backend to give further insight into the nature of the error."}},"required":["message","data"]}}}}
```

## DELETE /v2.0/admin/webhook-subscriptions

> Removes an existing webhook subscription

```json
{"openapi":"3.0.0","info":{"title":"Inveterate Public API","version":"v2.0"},"paths":{"/v2.0/admin/webhook-subscriptions":{"delete":{"operationId":"WebhookSubscriptionsController_remove","summary":"","description":"Removes an existing webhook subscription","parameters":[{"name":"X-Inveterate-Api-Key","in":"header","description":"Your private Inveterate API key.","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteWebhookSubscriptionDto"}}}},"responses":{"201":{"description":"Returned upon successful request made to our backend. Requests that return this code may take a small amount of time after successful API return to fully update.","schema":{"allOf":[{"$ref":"#/components/schemas/ResponseBodyDto"}]},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseBodyDto"}}}},"400":{"description":"Returned upon a malformed request. Check your API key, URL parameters, and body parameters when this error is returned. Generally, if you see this error, that also means NO action was taken on our backend.","schema":{"allOf":[{"$ref":"#/components/schemas/ResponseBodyDto"}]},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseBodyDto"}}}},"500":{"description":"Returned for all other errors. Generally these come from our backend. Some multipart functions may execute somewhat and then fail, causing some data to be updated.","schema":{"allOf":[{"$ref":"#/components/schemas/ResponseBodyDto"}]},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseBodyDto"}}}}},"tags":["Admin - Webhooks"]}}},"components":{"schemas":{"DeleteWebhookSubscriptionDto":{"type":"object","properties":{"topic":{"enum":["customer.joined.paid_tier","customer.joined.free_tier","customer.joined.free_trial","customer.joined.lifetime_tier","customer.changed_tier","customer.ordered","customer.payment_succeeded","customer.payment_failed","customer_billing.attempt.failed","customer.credits.updated","customer.credits.expired","customer.cancelled","customer.pending_cancellation","customer.updated","customer.payment_methods.updated"],"type":"string","description":"The subscription topic to delete"},"id":{"type":"string","description":"The subscription ID."}},"required":["topic","id"]},"ResponseBodyDto":{"type":"object","properties":{"message":{"type":"string","description":"The message associated with the response. Generally, the message only confirms the requested action. In the case of errors, the message will give insight into the source of the error."},"data":{"type":"object","description":"The data associated with the response. Data is only returned from errors if the error originates from our backend to give further insight into the nature of the error."}},"required":["message","data"]}}}}
```
