# Webhooks

## Webhooks

## List Webhook Subscriptions

> Returns a list of Webhook Subscriptions

```json
{"openapi":"3.0.1","info":{"title":"Okendo Enterprise API","version":"1.2.1"},"tags":[],"servers":[{"url":"https://api.okendo.io/enterprise"}],"security":[{"basic":[]}],"components":{"securitySchemes":{"basic":{"type":"http","scheme":"basic"}}},"paths":{"/webhook_subscriptions":{"get":{"tags":["webhook subscriptions"],"summary":"List Webhook Subscriptions","description":"Returns a list of Webhook Subscriptions","parameters":[{"description":"A limit on the number of items returned. Between 1 and 100. Default 25.","in":"query","name":"limit","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"lastEvaluated","description":"The URL-encoded JSON object representing the cursor for the next page of results.","in":"query","required":false,"schema":{"type":"string"}},{"name":"orderBy","description":"The sort order of the webhook subscriptions. Format: 'asc|desc'. Default 'desc'","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"An object containing a list of Webhook Subscriptions and a relative link to the next page of results if available.","content":{"application/json":{"schema":{"type":"object","properties":{"webhookSubscriptions":{"type":"array","items":{"type":"object","properties":{"subscriberId":{"type":"string","description":"Your user ID within Okendo.","format":"uuid"},"webhookSubscriptionId":{"type":"string","format":"uuid"},"endpointUrl":{"type":"string","format":"uri","description":"The URL that the webhook event will be sent to"},"version":{"type":"string","description":"Webhook event version","enum":["2025-02-01"]},"subscriptions":{"type":"array","items":{"type":"object","properties":{"resourceType":{"type":"string","description":"The webhook resource type","enum":["review","loyalty_adjustment_transaction","loyalty_customer","loyalty_earning_transaction","loyalty_redemption_transaction"]},"topic":{"type":"string","description":"The topic of the webhook","enum":["create","update","delete"]}}}},"isEnabled":{"type":"boolean"},"dateCreated":{"type":"string","format":"date-time"},"dateModified":{"type":"string","format":"date-time"}}}},"nextUrl":{"type":"string","format":"uri"}}}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"description":{"type":"string"}}}}}}}},"401":{"description":"Authentication credentials are missing or incorrect."},"403":{"description":"The requested resource is forbidden.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"description":{"type":"string"}}}}}}}}}}}}}
```

## POST /webhook\_subscriptions

> Create a Webhook Subscription

```json
{"openapi":"3.0.1","info":{"title":"Okendo Enterprise API","version":"1.2.1"},"tags":[],"servers":[{"url":"https://api.okendo.io/enterprise"}],"security":[{"basic":[]}],"components":{"securitySchemes":{"basic":{"type":"http","scheme":"basic"}}},"paths":{"/webhook_subscriptions":{"post":{"tags":["webhook subscriptions"],"summary":"Create a Webhook Subscription","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"endpointUrl":{"type":"string","format":"uri","description":"The URL that the webhook event will be sent to"},"isEnabled":{"type":"boolean"},"subscriptions":{"type":"array","items":{"type":"object","properties":{"resourceType":{"type":"string","description":"The webhook resource type","enum":["review","loyalty_adjustment_transaction","loyalty_customer","loyalty_earning_transaction","loyalty_redemption_transaction"]},"topic":{"type":"string","description":"The topic of the webhook","enum":["create","update","delete"]}}}},"version":{"type":"string","description":"Webhook event version","enum":["2025-02-01"]}},"required":["endpointUrl","isEnabled","version","subscriptions"]}}}},"responses":{"200":{"description":"A new Webhook Subscription object which also contains the Webhook Secret","content":{"application/json":{"schema":{"allOf":[{"type":"object","properties":{"subscriberId":{"type":"string","description":"Your user ID within Okendo.","format":"uuid"},"webhookSubscriptionId":{"type":"string","format":"uuid"},"endpointUrl":{"type":"string","format":"uri","description":"The URL that the webhook event will be sent to"},"version":{"type":"string","description":"Webhook event version","enum":["2025-02-01"]},"subscriptions":{"type":"array","items":{"type":"object","properties":{"resourceType":{"type":"string","description":"The webhook resource type","enum":["review","loyalty_adjustment_transaction","loyalty_customer","loyalty_earning_transaction","loyalty_redemption_transaction"]},"topic":{"type":"string","description":"The topic of the webhook","enum":["create","update","delete"]}}}},"isEnabled":{"type":"boolean"},"dateCreated":{"type":"string","format":"date-time"},"dateModified":{"type":"string","format":"date-time"}}},{"type":"object","properties":{"webhookSecret":{"type":"string","description":"Webhook Subscription Secret used to verify the Webhook Event"}}}]}}}},"401":{"description":"Authentication credentials are missing or incorrect."},"403":{"description":"The requested resource is forbidden.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"description":{"type":"string"}}}}}}}},"404":{"description":"The requested resource could not be found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"description":{"type":"string"}}}}}}}},"422":{"description":"The request was well-formed but was unable to be followed due to semantic errors.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"description":{"type":"string"}}}}}}}}}}}}}
```

## GET /webhook\_subscriptions/{webhookSubscriptionId}

> Retrieve a Webhook Subscription

```json
{"openapi":"3.0.1","info":{"title":"Okendo Enterprise API","version":"1.2.1"},"tags":[],"servers":[{"url":"https://api.okendo.io/enterprise"}],"security":[{"basic":[]}],"components":{"securitySchemes":{"basic":{"type":"http","scheme":"basic"}}},"paths":{"/webhook_subscriptions/{webhookSubscriptionId}":{"get":{"tags":["webhook subscriptions"],"summary":"Retrieve a Webhook Subscription","parameters":[{"name":"webhookSubscriptionId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"A Webhook Subscription Object","content":{"application/json":{"schema":{"type":"object","properties":{"webhookSubscription":{"type":"object","properties":{"subscriberId":{"type":"string","description":"Your user ID within Okendo.","format":"uuid"},"webhookSubscriptionId":{"type":"string","format":"uuid"},"endpointUrl":{"type":"string","format":"uri","description":"The URL that the webhook event will be sent to"},"version":{"type":"string","description":"Webhook event version","enum":["2025-02-01"]},"subscriptions":{"type":"array","items":{"type":"object","properties":{"resourceType":{"type":"string","description":"The webhook resource type","enum":["review","loyalty_adjustment_transaction","loyalty_customer","loyalty_earning_transaction","loyalty_redemption_transaction"]},"topic":{"type":"string","description":"The topic of the webhook","enum":["create","update","delete"]}}}},"isEnabled":{"type":"boolean"},"dateCreated":{"type":"string","format":"date-time"},"dateModified":{"type":"string","format":"date-time"}}}}}}}},"401":{"description":"Authentication credentials are missing or incorrect."},"403":{"description":"The requested resource is forbidden.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"description":{"type":"string"}}}}}}}},"404":{"description":"The requested resource could not be found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"description":{"type":"string"}}}}}}}}}}}}}
```

## PUT /webhook\_subscriptions/{webhookSubscriptionId}

> Update a Webhook Subscription

```json
{"openapi":"3.0.1","info":{"title":"Okendo Enterprise API","version":"1.2.1"},"tags":[],"servers":[{"url":"https://api.okendo.io/enterprise"}],"security":[{"basic":[]}],"components":{"securitySchemes":{"basic":{"type":"http","scheme":"basic"}}},"paths":{"/webhook_subscriptions/{webhookSubscriptionId}":{"put":{"tags":["webhook subscriptions"],"summary":"Update a Webhook Subscription","parameters":[{"name":"webhookSubscriptionId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"endpointUrl":{"type":"string","format":"uri","description":"The URL that the webhook event will be sent to"},"subscriptions":{"type":"array","items":{"type":"object","properties":{"resourceType":{"type":"string","description":"The webhook resource type","enum":["review","loyalty_adjustment_transaction","loyalty_customer","loyalty_earning_transaction","loyalty_redemption_transaction"]},"topic":{"type":"string","description":"The topic of the webhook","enum":["create","update","delete"]}}}},"version":{"type":"string","description":"Webhook event version","enum":["2025-02-01"]},"isEnabled":{"type":"boolean"}}}}}},"responses":{"200":{"description":"An updated Webhook Subscription Object","content":{"application/json":{"schema":{"type":"object","properties":{"webhookSubscription":{"type":"object","properties":{"subscriberId":{"type":"string","description":"Your user ID within Okendo.","format":"uuid"},"webhookSubscriptionId":{"type":"string","format":"uuid"},"endpointUrl":{"type":"string","format":"uri","description":"The URL that the webhook event will be sent to"},"version":{"type":"string","description":"Webhook event version","enum":["2025-02-01"]},"subscriptions":{"type":"array","items":{"type":"object","properties":{"resourceType":{"type":"string","description":"The webhook resource type","enum":["review","loyalty_adjustment_transaction","loyalty_customer","loyalty_earning_transaction","loyalty_redemption_transaction"]},"topic":{"type":"string","description":"The topic of the webhook","enum":["create","update","delete"]}}}},"isEnabled":{"type":"boolean"},"dateCreated":{"type":"string","format":"date-time"},"dateModified":{"type":"string","format":"date-time"}}}}}}}},"401":{"description":"Authentication credentials are missing or incorrect."},"403":{"description":"The requested resource is forbidden.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"description":{"type":"string"}}}}}}}},"404":{"description":"The requested resource could not be found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"description":{"type":"string"}}}}}}}},"422":{"description":"The request was well-formed but was unable to be followed due to semantic errors.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"description":{"type":"string"}}}}}}}}}}}}}
```

## DELETE /webhook\_subscriptions/{webhookSubscriptionId}

> Delete a Webhook subscription

```json
{"openapi":"3.0.1","info":{"title":"Okendo Enterprise API","version":"1.2.1"},"tags":[],"servers":[{"url":"https://api.okendo.io/enterprise"}],"security":[{"basic":[]}],"components":{"securitySchemes":{"basic":{"type":"http","scheme":"basic"}}},"paths":{"/webhook_subscriptions/{webhookSubscriptionId}":{"delete":{"tags":["webhook subscriptions"],"summary":"Delete a Webhook subscription","parameters":[{"name":"webhookSubscriptionId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"The resource was deleted successfully."},"401":{"description":"Authentication credentials are missing or incorrect."},"403":{"description":"The requested resource is forbidden.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"description":{"type":"string"}}}}}}}},"404":{"description":"The requested resource could not be found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"description":{"type":"string"}}}}}}}}}}}}}
```

## POST /webhook\_subscriptions/{webhookSubscriptionId}/rotate\_secret

> Rotate a Webhook Subscription Secret

```json
{"openapi":"3.0.1","info":{"title":"Okendo Enterprise API","version":"1.2.1"},"tags":[],"servers":[{"url":"https://api.okendo.io/enterprise"}],"security":[{"basic":[]}],"components":{"securitySchemes":{"basic":{"type":"http","scheme":"basic"}}},"paths":{"/webhook_subscriptions/{webhookSubscriptionId}/rotate_secret":{"post":{"tags":["webhook subscriptions"],"summary":"Rotate a Webhook Subscription Secret","parameters":[{"name":"webhookSubscriptionId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"An object containing a Webhook Subscription Secret","content":{"application/json":{"schema":{"type":"object","properties":{"webhookSubscriptionSecret":{"type":"string","description":"Webhook Subscription Secret used to verify a Webhook Event"}}}}}},"401":{"description":"Authentication credentials are missing or incorrect."},"403":{"description":"The requested resource is forbidden.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"description":{"type":"string"}}}}}}}},"404":{"description":"The requested resource could not be found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"description":{"type":"string"}}}}}}}}}}}}}
```


---

# 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.okendo.io/merchant-rest-api/endpoints/webhooks.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.
