# Subrite Webhook

**Summary:** Endpoints for Subrite Webhook

- Role: [Developers](https://www.subrite.no/developers)
- Source: https://www.subrite.no/developers/subrite-webhook
- Updated: 2026-10-22
- Markdown index: https://www.subrite.no/developers/llms.txt

<a id="get-api-v1-setting-webhook"></a>
## Get all registered webhooks of a tenant

`GET /api/v1/setting/webhook`

**Authentication:** Bearer token (JWT)

### Responses

#### 200

Content type: `application/json` · `array of WebhookListItemDto`

| Name | Type | Description |
| --- | --- | --- |
| `[].id` (Required when parent is present) | `number` |   |
| `[].name` (Required when parent is present) | `string` |   |
| `[].url` (Required when parent is present) | `string` |   |
| `[].isActive` (Required when parent is present) | `boolean` |   |
| `[].requestMethod` (Required when parent is present) | `INTERNAL_WEBHOOK_REQUEST_METHOD` | Allowed values: `"POST"`, `"GET"`, `"DELETE"` |
| `[].eventCount` (Required when parent is present) | `number` |   |

#### 401

unauthorized

#### 403

Content type: `application/json` · `ErrorResponse`

forbiddenResource

| Name | Type | Description |
| --- | --- | --- |
| `messageCode` (Required) | `string` |   |
| `message` | `string` |   |
| `errors` (Required) | `array of FieldError` |   |
| `errors[].field` (Required when parent is present) | `string` |   |
| `errors[].fieldValue` (Required when parent is present) | `string` |   |
| `errors[].identifier` (Required when parent is present) | `string` |   |
| `errors[].identifierValue` (Required when parent is present) | `string` |   |
| `errors[].messageCode` (Required when parent is present) | `string` |   |
| `errors[].message` | `string` |   |
| `errors[].errorType` (Required when parent is present) | `string` |   |

**Example response**

`application/json`

```json
{
  "messageCode": "string",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 500

Content type: `application/json` · `ErrorResponse`

internalServerError

Same fields as [Get all registered webhooks of a tenant (403)](https://www.subrite.no/developers/subrite-webhook?md=true#get-api-v1-setting-webhook).

### Example request

```bash
curl https://api.subrite.no/api/v1/setting/webhook \
  --header 'Authorization: Bearer <token>'
```

### Example response

200 · `application/json`

```json
[
  {
    "id": 0,
    "name": "string",
    "url": "string",
    "isActive": true,
    "requestMethod": "POST",
    "eventCount": 0
  }
]
```

<a id="post-api-v1-setting-webhook"></a>
## Create a new webhook setting for a tenant

`POST /api/v1/setting/webhook`

**Authentication:** Bearer token (JWT)

### Request body

Content type: `application/json` · Required · `CreateWebhookDto`

| Name | Type | Description |
| --- | --- | --- |
| `name` (Required) | `string` |   |
| `description` | `string` |   |
| `url` (Required) | `string (uri)` |   |
| `authenticationMethod` | `INTERNAL_WEBHOOK_AUTHENTICATION_METHOD` | Allowed values: `"bearer"` |
| `authenticationConfig` | `WebhookAuthenticationBearerConfig` |   |
| `authenticationConfig.token` (Required when parent is present) | `string` |   |
| `requestMethod` | `INTERNAL_WEBHOOK_REQUEST_METHOD` | Allowed values: `"POST"`, `"GET"`, `"DELETE"` · Default: `"POST"` |
| `events` (Required) | `array of INTERNAL_WEBHOOK_EVENT_TYPE` | Allowed values: `"member.deleted"`, `"member.updated"`, `"subscription.created"`, `"subscription.renewed"`, `"member.subscription.activated"`, `"member.subscription.deactivated"` · `minItems`: `1` |

**Example request body**

`application/json`

```json
{
  "name": "string",
  "description": "string",
  "url": "http://example.com",
  "authenticationMethod": "bearer",
  "authenticationConfig": {
    "token": "<token>"
  },
  "requestMethod": "POST",
  "events": [
    "member.deleted"
  ]
}
```

### Responses

#### 201

Content type: `application/json` · `GetWebhookResponseDto`

| Name | Type | Description |
| --- | --- | --- |
| `webhook` (Required) | `Webhook` |   |
| `webhook.requestMethod` (Required) | `string` | Allowed values: `"POST"`, `"GET"`, `"DELETE"` |
| `webhook.name` (Required) | `string` |   |
| `webhook.description` (Required) | `string` |   |
| `webhook.url` (Required) | `string` |   |
| `webhook.secret` (Required) | `string` |   |
| `webhook.authenticationMethod` (Required) | `string` | Allowed values: `"bearer"` |
| `webhook.authenticationConfig` (Required) | `WebhookAuthenticationBearerConfig` |   |
| `webhook.authenticationConfig.token` (Required) | `string` |   |
| `webhook.isActive` (Required) | `boolean` |   |
| `webhook.tenantId` (Required) | `number` |   |
| `webhook.webhookEvents` (Required) | `array of WebhookEvent` |   |
| `webhook.webhookEvents[].name` (Required when parent is present) | `string` | Allowed values: `"member.deleted"`, `"member.updated"`, `"subscription.created"`, `"subscription.renewed"`, `"member.subscription.activated"`, `"member.subscription.deactivated"` |
| `webhook.webhookEvents[].webhook` (Required when parent is present) | `Webhook` | Recursive schema; nested fields are not repeated. |
| `webhook.webhookEvents[].webhookEventLogs` (Required when parent is present) | `array of WebhookEventLog` | Nested fields omitted: depth limit. |
| `webhook.webhookEvents[].tenantId` (Required when parent is present) | `number` |   |
| `webhook.webhookEvents[].tenant` (Required when parent is present) | `Tenant` | Nested fields omitted: depth limit. |
| `webhook.webhookEvents[].id` (Required when parent is present) | `number` |   |
| `webhook.webhookEvents[].createdAt` (Required when parent is present) | `string (date-time)` |   |
| `webhook.webhookEvents[].updatedAt` (Required when parent is present) | `string (date-time)` |   |
| `webhook.webhookEvents[].deletedAt` (Required when parent is present) | `string (date-time)` |   |
| `webhook.webhookEvents[].metaData` (Required when parent is present) | `object` |   |
| `webhook.tenant` (Required) | `Tenant` | Nested fields omitted: field limit. |
| `webhook.id` (Required) | `number` |   |
| `webhook.createdAt` (Required) | `string (date-time)` |   |
| `webhook.updatedAt` (Required) | `string (date-time)` |   |
| `webhook.deletedAt` (Required) | `string (date-time)` |   |
| `webhook.metaData` (Required) | `object` |   |
| `events` (Required) | `object with array of string values` |   |

#### 400

Content type: `application/json` · `ErrorResponse`

Body validation failed

| Name | Type | Description |
| --- | --- | --- |
| `messageCode` (Required) | `string` | Allowed values: `"badRequest"` |
| `message` | `string` |   |
| `errors` (Required) | `array of FieldError` |   |
| `errors[].field` (Required when parent is present) | `string` |   |
| `errors[].fieldValue` (Required when parent is present) | `string` |   |
| `errors[].identifier` (Required when parent is present) | `string` |   |
| `errors[].identifierValue` (Required when parent is present) | `string` |   |
| `errors[].messageCode` (Required when parent is present) | `string` |   |
| `errors[].message` | `string` |   |
| `errors[].errorType` (Required when parent is present) | `string` |   |

**Example response**

`application/json`

```json
{
  "messageCode": "badRequest",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 401

unauthorized

#### 403

Content type: `application/json` · `ErrorResponse`

forbiddenResource

Same fields as [Get all registered webhooks of a tenant (403)](https://www.subrite.no/developers/subrite-webhook?md=true#get-api-v1-setting-webhook).

**Example response**

`application/json`

```json
{
  "messageCode": "string",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 409

Content type: `application/json` · `ErrorResponse`

webhookLimitReached

| Name | Type | Description |
| --- | --- | --- |
| `messageCode` (Required) | `string` | Allowed values: `"webhookLimitReached"` |
| `message` | `string` |   |
| `errors` (Required) | `array of FieldError` |   |
| `errors[].field` (Required when parent is present) | `string` |   |
| `errors[].fieldValue` (Required when parent is present) | `string` |   |
| `errors[].identifier` (Required when parent is present) | `string` |   |
| `errors[].identifierValue` (Required when parent is present) | `string` |   |
| `errors[].messageCode` (Required when parent is present) | `string` |   |
| `errors[].message` | `string` |   |
| `errors[].errorType` (Required when parent is present) | `string` |   |

**Example response**

`application/json`

```json
{
  "messageCode": "webhookLimitReached",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 500

Content type: `application/json` · `ErrorResponse`

internalServerError

Same fields as [Get all registered webhooks of a tenant (403)](https://www.subrite.no/developers/subrite-webhook?md=true#get-api-v1-setting-webhook).

### Example request

```bash
curl https://api.subrite.no/api/v1/setting/webhook \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "string",
  "description": "string",
  "url": "http://example.com",
  "authenticationMethod": "bearer",
  "authenticationConfig": {
    "token": "<token>"
  },
  "requestMethod": "POST",
  "events": [
    "member.deleted"
  ]
}'
```

### Example response

201 · `application/json`

```json
{
  "webhook": {
    "requestMethod": "POST",
    "name": "string",
    "description": "string",
    "url": "string",
    "secret": "<secret>",
    "authenticationMethod": "bearer",
    "authenticationConfig": {},
    "isActive": true,
    "tenantId": 0,
    "webhookEvents": [],
    "tenant": {
      "additionalFeatures": [],
      "disabledFeatures": [],
      "taxRates": [],
      "products": [],
      "users": [],
      "members": [],
      "roles": [],
      "subscriptionPlans": [],
      "packages": [],
      "invoices": [],
      "orders": [],
      "paymentProviders": [],
      "newslettersProviderConfig": [],
      "paymentProviderConfigs": [],
      "oidcClients": [],
      "oauthProviders": [],
      "activityLogs": [],
      "m2m_api_clients": [],
      "customProperties": [],
      "consents": [],
      "communicationTemplates": [],
      "additionalHostnames": [],
      "exportHistory": [],
      "arReportHistory": [],
      "mypageCardsSettings": [],
      "webhooks": [],
      "customOrders": [],
      "customOrderSources": [],
      "brandKits": [],
      "communicationReceivers": [],
      "metaData": {}
    },
    "id": 0,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deletedAt": "2019-08-24T14:15:22Z",
    "metaData": {}
  },
  "events": {
    "property1": [],
    "property2": []
  }
}
```

<a id="get-api-v1-setting-webhook-events"></a>
## Get available webhook events

`GET /api/v1/setting/webhook/events`

**Authentication:** Bearer token (JWT)

### Responses

#### 200

#### 401

unauthorized

#### 403

Content type: `application/json` · `ErrorResponse`

forbiddenResource

Same fields as [Get all registered webhooks of a tenant (403)](https://www.subrite.no/developers/subrite-webhook?md=true#get-api-v1-setting-webhook).

**Example response**

`application/json`

```json
{
  "messageCode": "string",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 500

Content type: `application/json` · `ErrorResponse`

internalServerError

Same fields as [Get all registered webhooks of a tenant (403)](https://www.subrite.no/developers/subrite-webhook?md=true#get-api-v1-setting-webhook).

### Example request

```bash
curl https://api.subrite.no/api/v1/setting/webhook/events \
  --header 'Authorization: Bearer <token>'
```

<a id="get-api-v1-setting-webhook-enqueue-cleanup-old-webhook-event-logs"></a>
## Enqueue cleanup old webhook event logs

`GET /api/v1/setting/webhook/enqueue-cleanup-old-webhook-event-logs`

**Authentication:** Bearer token (JWT)

### Responses

#### 200

#### 401

unauthorized

#### 403

Content type: `application/json` · `ErrorResponse`

forbiddenResource

Same fields as [Get all registered webhooks of a tenant (403)](https://www.subrite.no/developers/subrite-webhook?md=true#get-api-v1-setting-webhook).

**Example response**

`application/json`

```json
{
  "messageCode": "string",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 500

Content type: `application/json` · `ErrorResponse`

internalServerError

Same fields as [Get all registered webhooks of a tenant (403)](https://www.subrite.no/developers/subrite-webhook?md=true#get-api-v1-setting-webhook).

### Example request

```bash
curl https://api.subrite.no/api/v1/setting/webhook/enqueue-cleanup-old-webhook-event-logs \
  --header 'Authorization: Bearer <token>'
```

<a id="get-api-v1-setting-webhook-id"></a>
## Get a webhook

`GET /api/v1/setting/webhook/{id}`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `id` (Required) | path | `number` |   |

### Responses

#### 200

Content type: `application/json` · `GetWebhookResponseDto`

Same fields as [Create a new webhook setting for a tenant (201)](https://www.subrite.no/developers/subrite-webhook?md=true#post-api-v1-setting-webhook).

#### 400

Content type: `application/json` · `ErrorResponse`

The id is not an integer

Same fields as [Create a new webhook setting for a tenant (400)](https://www.subrite.no/developers/subrite-webhook?md=true#post-api-v1-setting-webhook).

**Example response**

`application/json`

```json
{
  "messageCode": "badRequest",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 401

unauthorized

#### 403

Content type: `application/json` · `ErrorResponse`

forbiddenResource

Same fields as [Get all registered webhooks of a tenant (403)](https://www.subrite.no/developers/subrite-webhook?md=true#get-api-v1-setting-webhook).

**Example response**

`application/json`

```json
{
  "messageCode": "string",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 404

Content type: `application/json` · `ErrorResponse`

webhookNotFound

| Name | Type | Description |
| --- | --- | --- |
| `messageCode` (Required) | `string` | Allowed values: `"webhookNotFound"` |
| `message` | `string` |   |
| `errors` (Required) | `array of FieldError` |   |
| `errors[].field` (Required when parent is present) | `string` |   |
| `errors[].fieldValue` (Required when parent is present) | `string` |   |
| `errors[].identifier` (Required when parent is present) | `string` |   |
| `errors[].identifierValue` (Required when parent is present) | `string` |   |
| `errors[].messageCode` (Required when parent is present) | `string` |   |
| `errors[].message` | `string` |   |
| `errors[].errorType` (Required when parent is present) | `string` |   |

**Example response**

`application/json`

```json
{
  "messageCode": "webhookNotFound",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 500

Content type: `application/json` · `ErrorResponse`

internalServerError

Same fields as [Get all registered webhooks of a tenant (403)](https://www.subrite.no/developers/subrite-webhook?md=true#get-api-v1-setting-webhook).

### Example request

```bash
curl 'https://api.subrite.no/api/v1/setting/webhook/{id}' \
  --header 'Authorization: Bearer <token>'
```

### Example response

200 · `application/json`

```json
{
  "webhook": {
    "requestMethod": "POST",
    "name": "string",
    "description": "string",
    "url": "string",
    "secret": "<secret>",
    "authenticationMethod": "bearer",
    "authenticationConfig": {},
    "isActive": true,
    "tenantId": 0,
    "webhookEvents": [],
    "tenant": {
      "additionalFeatures": [],
      "disabledFeatures": [],
      "taxRates": [],
      "products": [],
      "users": [],
      "members": [],
      "roles": [],
      "subscriptionPlans": [],
      "packages": [],
      "invoices": [],
      "orders": [],
      "paymentProviders": [],
      "newslettersProviderConfig": [],
      "paymentProviderConfigs": [],
      "oidcClients": [],
      "oauthProviders": [],
      "activityLogs": [],
      "m2m_api_clients": [],
      "customProperties": [],
      "consents": [],
      "communicationTemplates": [],
      "additionalHostnames": [],
      "exportHistory": [],
      "arReportHistory": [],
      "mypageCardsSettings": [],
      "webhooks": [],
      "customOrders": [],
      "customOrderSources": [],
      "brandKits": [],
      "communicationReceivers": [],
      "metaData": {}
    },
    "id": 0,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deletedAt": "2019-08-24T14:15:22Z",
    "metaData": {}
  },
  "events": {
    "property1": [],
    "property2": []
  }
}
```

<a id="delete-api-v1-setting-webhook-id"></a>
## Delete a webhook setting

`DELETE /api/v1/setting/webhook/{id}`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `id` (Required) | path | `number` |   |

### Responses

#### 200

#### 400

Content type: `application/json` · `ErrorResponse`

The id is not an integer

Same fields as [Create a new webhook setting for a tenant (400)](https://www.subrite.no/developers/subrite-webhook?md=true#post-api-v1-setting-webhook).

**Example response**

`application/json`

```json
{
  "messageCode": "badRequest",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 401

unauthorized

#### 403

Content type: `application/json` · `ErrorResponse`

forbiddenResource

Same fields as [Get all registered webhooks of a tenant (403)](https://www.subrite.no/developers/subrite-webhook?md=true#get-api-v1-setting-webhook).

**Example response**

`application/json`

```json
{
  "messageCode": "string",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 404

Content type: `application/json` · `ErrorResponse`

webhookNotFound

Same fields as [Get a webhook (404)](https://www.subrite.no/developers/subrite-webhook?md=true#get-api-v1-setting-webhook-id).

**Example response**

`application/json`

```json
{
  "messageCode": "webhookNotFound",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 500

Content type: `application/json` · `ErrorResponse`

internalServerError

Same fields as [Get all registered webhooks of a tenant (403)](https://www.subrite.no/developers/subrite-webhook?md=true#get-api-v1-setting-webhook).

### Example request

```bash
curl 'https://api.subrite.no/api/v1/setting/webhook/{id}' \
  --request DELETE \
  --header 'Authorization: Bearer <token>'
```

<a id="patch-api-v1-setting-webhook-id"></a>
## Update a webhook setting

`PATCH /api/v1/setting/webhook/{id}`

Every field is optional. events, when sent, is the full selection: only removed events lose their rows and delivery logs.

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `id` (Required) | path | `number` |   |

### Request body

Content type: `application/json` · Required · `UpdateWebhookDto`

| Name | Type | Description |
| --- | --- | --- |
| `name` | `string` |   |
| `description` | `string` | Can be null |
| `url` | `string (uri)` |   |
| `requestMethod` | `INTERNAL_WEBHOOK_REQUEST_METHOD` | Allowed values: `"POST"`, `"GET"`, `"DELETE"` |
| `authenticationMethod` | `INTERNAL_WEBHOOK_AUTHENTICATION_METHOD` | Leave out to keep the current authentication. Send null to switch authentication off, which also clears authenticationConfig. · Allowed values: `"bearer"` · Can be null |
| `authenticationConfig` | `UpdateWebhookAuthenticationBearerConfig` | Bearer config. An omitted or empty token keeps the stored one; a token is required when bearer authentication is newly selected. |
| `authenticationConfig.token` | `string` | Leave out or send an empty string to keep the stored token. |
| `isActive` | `boolean` |   |
| `events` | `array of INTERNAL_WEBHOOK_EVENT_TYPE` | The full set of events the webhook should receive. Events left out are removed together with their delivery logs; events already subscribed keep their logs. Leave out to keep the events as they are. · Allowed values: `"member.deleted"`, `"member.updated"`, `"subscription.created"`, `"subscription.renewed"`, `"member.subscription.activated"`, `"member.subscription.deactivated"` · `minItems`: `1` |

**Example request body**

`application/json`

```json
{
  "name": "string",
  "description": "string",
  "url": "http://example.com",
  "requestMethod": "POST",
  "authenticationMethod": "bearer",
  "authenticationConfig": {
    "token": "<token>"
  },
  "isActive": true,
  "events": [
    "member.deleted"
  ]
}
```

### Responses

#### 200

Content type: `application/json` · `GetWebhookResponseDto`

Same fields as [Create a new webhook setting for a tenant (201)](https://www.subrite.no/developers/subrite-webhook?md=true#post-api-v1-setting-webhook).

#### 400

Content type: `application/json` · `ErrorResponse`

The id is not an integer, body validation failed, or bearer was selected without a token

| Name | Type | Description |
| --- | --- | --- |
| `messageCode` (Required) | `string` | Allowed values: `"badRequest"`, `"webhookBearerTokenRequired"` |
| `message` | `string` |   |
| `errors` (Required) | `array of FieldError` |   |
| `errors[].field` (Required when parent is present) | `string` |   |
| `errors[].fieldValue` (Required when parent is present) | `string` |   |
| `errors[].identifier` (Required when parent is present) | `string` |   |
| `errors[].identifierValue` (Required when parent is present) | `string` |   |
| `errors[].messageCode` (Required when parent is present) | `string` |   |
| `errors[].message` | `string` |   |
| `errors[].errorType` (Required when parent is present) | `string` |   |

**Example response**

`application/json`

```json
{
  "messageCode": "badRequest",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 401

unauthorized

#### 403

Content type: `application/json` · `ErrorResponse`

forbiddenResource

Same fields as [Get all registered webhooks of a tenant (403)](https://www.subrite.no/developers/subrite-webhook?md=true#get-api-v1-setting-webhook).

**Example response**

`application/json`

```json
{
  "messageCode": "string",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 404

Content type: `application/json` · `ErrorResponse`

webhookNotFound

Same fields as [Get a webhook (404)](https://www.subrite.no/developers/subrite-webhook?md=true#get-api-v1-setting-webhook-id).

**Example response**

`application/json`

```json
{
  "messageCode": "webhookNotFound",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 500

Content type: `application/json` · `ErrorResponse`

internalServerError

Same fields as [Get all registered webhooks of a tenant (403)](https://www.subrite.no/developers/subrite-webhook?md=true#get-api-v1-setting-webhook).

### Example request

```bash
curl 'https://api.subrite.no/api/v1/setting/webhook/{id}' \
  --request PATCH \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "string",
  "description": "string",
  "url": "http://example.com",
  "requestMethod": "POST",
  "authenticationMethod": "bearer",
  "authenticationConfig": {
    "token": "<token>"
  },
  "isActive": true,
  "events": [
    "member.deleted"
  ]
}'
```

### Example response

200 · `application/json`

```json
{
  "webhook": {
    "requestMethod": "POST",
    "name": "string",
    "description": "string",
    "url": "string",
    "secret": "<secret>",
    "authenticationMethod": "bearer",
    "authenticationConfig": {},
    "isActive": true,
    "tenantId": 0,
    "webhookEvents": [],
    "tenant": {
      "additionalFeatures": [],
      "disabledFeatures": [],
      "taxRates": [],
      "products": [],
      "users": [],
      "members": [],
      "roles": [],
      "subscriptionPlans": [],
      "packages": [],
      "invoices": [],
      "orders": [],
      "paymentProviders": [],
      "newslettersProviderConfig": [],
      "paymentProviderConfigs": [],
      "oidcClients": [],
      "oauthProviders": [],
      "activityLogs": [],
      "m2m_api_clients": [],
      "customProperties": [],
      "consents": [],
      "communicationTemplates": [],
      "additionalHostnames": [],
      "exportHistory": [],
      "arReportHistory": [],
      "mypageCardsSettings": [],
      "webhooks": [],
      "customOrders": [],
      "customOrderSources": [],
      "brandKits": [],
      "communicationReceivers": [],
      "metaData": {}
    },
    "id": 0,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deletedAt": "2019-08-24T14:15:22Z",
    "metaData": {}
  },
  "events": {
    "property1": [],
    "property2": []
  }
}
```

<a id="get-api-v1-setting-webhook-id-logs"></a>
## Get a webhook's delivery logs, newest first

`GET /api/v1/setting/webhook/{id}/logs`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `id` (Required) | path | `number` |   |
| `page` | query | `number` | Default: `1` · `minimum`: `1` |
| `take` | query | `number` | Default: `10` · `minimum`: `1`, `maximum`: `50` |

### Responses

#### 200

Content type: `application/json` · `WebhookEventLogListItemDtoPaginated`

| Name | Type | Description |
| --- | --- | --- |
| `items` (Required) | `array of WebhookEventLogListItemDto` |   |
| `items[].id` (Required when parent is present) | `number` |   |
| `items[].createdAt` (Required when parent is present) | `string (date-time)` |   |
| `items[].event` (Required when parent is present) | `INTERNAL_WEBHOOK_EVENT_TYPE` | Allowed values: `"member.deleted"`, `"member.updated"`, `"subscription.created"`, `"subscription.renewed"`, `"member.subscription.activated"`, `"member.subscription.deactivated"` |
| `items[].attemptNo` (Required when parent is present) | `number` |   |
| `items[].status` (Required when parent is present) | `WEBHOOK_ATTEMPT_STATUS` | Allowed values: `"succeeded"`, `"failed"` |
| `items[].responseCode` (Required when parent is present) | `number` | Can be null |
| `items[].errorCode` (Required when parent is present) | `string` | Transport error code (e.g. ECONNREFUSED) when the endpoint gave no response. · Can be null |
| `items[].idempotencyKey` (Required when parent is present) | `string` |   |
| `meta` (Required) | `PageMeta` |   |
| `meta.page` (Required) | `number` |   |
| `meta.take` (Required) | `number` |   |
| `meta.count` (Required) | `number` |   |
| `meta.pageCount` (Required) | `number` |   |
| `meta.hasPreviousPage` (Required) | `boolean` |   |
| `meta.hasNextPage` (Required) | `boolean` |   |

#### 400

Content type: `application/json` · `ErrorResponse`

The id or a query value is invalid

Same fields as [Create a new webhook setting for a tenant (400)](https://www.subrite.no/developers/subrite-webhook?md=true#post-api-v1-setting-webhook).

**Example response**

`application/json`

```json
{
  "messageCode": "badRequest",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 401

unauthorized

#### 403

Content type: `application/json` · `ErrorResponse`

forbiddenResource

Same fields as [Get all registered webhooks of a tenant (403)](https://www.subrite.no/developers/subrite-webhook?md=true#get-api-v1-setting-webhook).

**Example response**

`application/json`

```json
{
  "messageCode": "string",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 404

Content type: `application/json` · `ErrorResponse`

webhookNotFound

Same fields as [Get a webhook (404)](https://www.subrite.no/developers/subrite-webhook?md=true#get-api-v1-setting-webhook-id).

**Example response**

`application/json`

```json
{
  "messageCode": "webhookNotFound",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 500

Content type: `application/json` · `ErrorResponse`

internalServerError

Same fields as [Get all registered webhooks of a tenant (403)](https://www.subrite.no/developers/subrite-webhook?md=true#get-api-v1-setting-webhook).

### Example request

```bash
curl 'https://api.subrite.no/api/v1/setting/webhook/{id}/logs' \
  --header 'Authorization: Bearer <token>'
```

### Example response

200 · `application/json`

```json
{
  "items": [
    {}
  ],
  "meta": {
    "page": 0,
    "take": 0,
    "count": 0,
    "pageCount": 0,
    "hasPreviousPage": true,
    "hasNextPage": true
  }
}
```

<a id="get-api-v1-setting-webhook-id-logs-logid"></a>
## Get one delivery log of a webhook, with the request and response

`GET /api/v1/setting/webhook/{id}/logs/{logId}`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `id` (Required) | path | `number` |   |
| `logId` (Required) | path | `number` |   |

### Responses

#### 200

Content type: `application/json` · `WebhookEventLogDetailDto`

| Name | Type | Description |
| --- | --- | --- |
| `id` (Required) | `number` |   |
| `createdAt` (Required) | `string (date-time)` |   |
| `event` (Required) | `INTERNAL_WEBHOOK_EVENT_TYPE` | Allowed values: `"member.deleted"`, `"member.updated"`, `"subscription.created"`, `"subscription.renewed"`, `"member.subscription.activated"`, `"member.subscription.deactivated"` |
| `attemptNo` (Required) | `number` |   |
| `status` (Required) | `WEBHOOK_ATTEMPT_STATUS` | Allowed values: `"succeeded"`, `"failed"` |
| `idempotencyKey` (Required) | `string` |   |
| `requestMethod` (Required) | `INTERNAL_WEBHOOK_REQUEST_METHOD` | Allowed values: `"POST"`, `"GET"`, `"DELETE"` |
| `url` (Required) | `string` |   |
| `requestHeaders` (Required) | `object with string values` | Headers as sent. The Authorization header is always masked. |
| `requestBody` | `object with any values` | Can be null |
| `responseCode` (Required) | `number` | Can be null |
| `responseBody` | `object` | Response body as received (any JSON). · Can be null |
| `error` | `object` | Delivery error (any JSON). · Can be null |
| `payloadRemoved` (Required) | `boolean` | True once the GDPR retention job has blanked the payload data. |

#### 400

Content type: `application/json` · `ErrorResponse`

An id is not an integer

Same fields as [Create a new webhook setting for a tenant (400)](https://www.subrite.no/developers/subrite-webhook?md=true#post-api-v1-setting-webhook).

**Example response**

`application/json`

```json
{
  "messageCode": "badRequest",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 401

unauthorized

#### 403

Content type: `application/json` · `ErrorResponse`

forbiddenResource

Same fields as [Get all registered webhooks of a tenant (403)](https://www.subrite.no/developers/subrite-webhook?md=true#get-api-v1-setting-webhook).

**Example response**

`application/json`

```json
{
  "messageCode": "string",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 404

Content type: `application/json` · `ErrorResponse`

webhookNotFound, webhookEventLogNotFound

| Name | Type | Description |
| --- | --- | --- |
| `messageCode` (Required) | `string` | Allowed values: `"webhookNotFound"`, `"webhookEventLogNotFound"` |
| `message` | `string` |   |
| `errors` (Required) | `array of FieldError` |   |
| `errors[].field` (Required when parent is present) | `string` |   |
| `errors[].fieldValue` (Required when parent is present) | `string` |   |
| `errors[].identifier` (Required when parent is present) | `string` |   |
| `errors[].identifierValue` (Required when parent is present) | `string` |   |
| `errors[].messageCode` (Required when parent is present) | `string` |   |
| `errors[].message` | `string` |   |
| `errors[].errorType` (Required when parent is present) | `string` |   |

**Example response**

`application/json`

```json
{
  "messageCode": "webhookNotFound",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 500

Content type: `application/json` · `ErrorResponse`

internalServerError

Same fields as [Get all registered webhooks of a tenant (403)](https://www.subrite.no/developers/subrite-webhook?md=true#get-api-v1-setting-webhook).

### Example request

```bash
curl 'https://api.subrite.no/api/v1/setting/webhook/{id}/logs/{logId}' \
  --header 'Authorization: Bearer <token>'
```

### Example response

200 · `application/json`

```json
{
  "id": 0,
  "createdAt": "2019-08-24T14:15:22Z",
  "event": "member.deleted",
  "attemptNo": 0,
  "status": "succeeded",
  "idempotencyKey": "<idempotencyKey>",
  "requestMethod": "POST",
  "url": "string",
  "requestHeaders": {
    "property1": "string",
    "property2": "string"
  },
  "requestBody": {},
  "responseCode": 0,
  "responseBody": {},
  "error": {},
  "payloadRemoved": true
}
```

<a id="post-api-v1-setting-webhook-test-action"></a>
## Perform some actions to test webhook

`POST /api/v1/setting/webhook/test/{action}`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `action` (Required) | path | `string` |   |

### Responses

#### 201

#### 400

Content type: `application/json` · `ErrorResponse`

webhookTestBadRequest

| Name | Type | Description |
| --- | --- | --- |
| `messageCode` (Required) | `string` | Allowed values: `"webhookTestBadRequest"` |
| `message` | `string` |   |
| `errors` (Required) | `array of FieldError` |   |
| `errors[].field` (Required when parent is present) | `string` |   |
| `errors[].fieldValue` (Required when parent is present) | `string` |   |
| `errors[].identifier` (Required when parent is present) | `string` |   |
| `errors[].identifierValue` (Required when parent is present) | `string` |   |
| `errors[].messageCode` (Required when parent is present) | `string` |   |
| `errors[].message` | `string` |   |
| `errors[].errorType` (Required when parent is present) | `string` |   |

**Example response**

`application/json`

```json
{
  "messageCode": "webhookTestBadRequest",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 401

unauthorized

#### 403

Content type: `application/json` · `ErrorResponse`

forbiddenResource

Same fields as [Get all registered webhooks of a tenant (403)](https://www.subrite.no/developers/subrite-webhook?md=true#get-api-v1-setting-webhook).

**Example response**

`application/json`

```json
{
  "messageCode": "string",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 404

Content type: `application/json` · `ErrorResponse`

webhookTestNotFound

| Name | Type | Description |
| --- | --- | --- |
| `messageCode` (Required) | `string` | Allowed values: `"webhookTestNotFound"` |
| `message` | `string` |   |
| `errors` (Required) | `array of FieldError` |   |
| `errors[].field` (Required when parent is present) | `string` |   |
| `errors[].fieldValue` (Required when parent is present) | `string` |   |
| `errors[].identifier` (Required when parent is present) | `string` |   |
| `errors[].identifierValue` (Required when parent is present) | `string` |   |
| `errors[].messageCode` (Required when parent is present) | `string` |   |
| `errors[].message` | `string` |   |
| `errors[].errorType` (Required when parent is present) | `string` |   |

**Example response**

`application/json`

```json
{
  "messageCode": "webhookTestNotFound",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 500

Content type: `application/json` · `ErrorResponse`

internalServerError

Same fields as [Get all registered webhooks of a tenant (403)](https://www.subrite.no/developers/subrite-webhook?md=true#get-api-v1-setting-webhook).

### Example request

```bash
curl 'https://api.subrite.no/api/v1/setting/webhook/test/{action}' \
  --request POST \
  --header 'Authorization: Bearer <token>'
```

<a id="post-api-v1-setting-webhook-id-regenerate-secret"></a>
## Replace the signing secret of a webhook

`POST /api/v1/setting/webhook/{id}/regenerate-secret`

Returns the new secret unmasked. It cannot be read back afterwards.

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `id` (Required) | path | `number` |   |

### Responses

#### 201

Content type: `application/json` · `RegenerateWebhookSecretResponseDto`

| Name | Type | Description |
| --- | --- | --- |
| `secret` (Required) | `string` | The new signing secret, unmasked. It is returned only this once. |

#### 400

Content type: `application/json` · `ErrorResponse`

The id is not an integer

Same fields as [Create a new webhook setting for a tenant (400)](https://www.subrite.no/developers/subrite-webhook?md=true#post-api-v1-setting-webhook).

**Example response**

`application/json`

```json
{
  "messageCode": "badRequest",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 401

unauthorized

#### 403

Content type: `application/json` · `ErrorResponse`

forbiddenResource

Same fields as [Get all registered webhooks of a tenant (403)](https://www.subrite.no/developers/subrite-webhook?md=true#get-api-v1-setting-webhook).

**Example response**

`application/json`

```json
{
  "messageCode": "string",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 404

Content type: `application/json` · `ErrorResponse`

webhookNotFound

Same fields as [Get a webhook (404)](https://www.subrite.no/developers/subrite-webhook?md=true#get-api-v1-setting-webhook-id).

**Example response**

`application/json`

```json
{
  "messageCode": "webhookNotFound",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 500

Content type: `application/json` · `ErrorResponse`

internalServerError

Same fields as [Get all registered webhooks of a tenant (403)](https://www.subrite.no/developers/subrite-webhook?md=true#get-api-v1-setting-webhook).

### Example request

```bash
curl 'https://api.subrite.no/api/v1/setting/webhook/{id}/regenerate-secret' \
  --request POST \
  --header 'Authorization: Bearer <token>'
```

### Example response

201 · `application/json`

```json
{
  "secret": "<secret>"
}
```
