Subrite Webhook
Endpoints for Subrite Webhook
Endpoints for Subrite Webhook
GET/api/v1/setting/webhook
Authentication: Bearer token (JWT)
idnumberRequired when parent is presentnamestringRequired when parent is presenturlstringRequired when parent is presentisActivebooleanRequired when parent is presentrequestMethodINTERNAL_WEBHOOK_REQUEST_METHODRequired when parent is present"POST", "GET", "DELETE"eventCountnumberRequired when parent is present[
{
"id": 0,
"name": "string",
"url": "string",
"isActive": true,
"requestMethod": "POST",
"eventCount": 0
}
]unauthorized
This response has no body.
forbiddenResource
messageCodestringRequiredmessagestringerrorsarray of FieldErrorRequired7 fieldserrorscurlcurl https://api.subrite.no/api/v1/setting/webhook \
--header 'Authorization: Bearer <token>'POST/api/v1/setting/webhook
Authentication: Bearer token (JWT)
application/jsonnamestringRequireddescriptionstringOptionalurlstring (uri)RequiredGET/api/v1/setting/webhook/events
Authentication: Bearer token (JWT)
This response has no body.
unauthorized
GET/api/v1/setting/webhook/enqueue-cleanup-old-webhook-event-logs
Authentication: Bearer token (JWT)
This response has no body.
GET/api/v1/setting/webhook/{id}
Authentication: Bearer token (JWT)
idnumberRequiredSame fields as Create a new webhook setting for a tenant (201).
DELETE/api/v1/setting/webhook/{id}
Authentication: Bearer token (JWT)
idnumberRequiredThis response has no body.
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)
idnumberRequiredapplication/jsonnamestringOptionalGET/api/v1/setting/webhook/{id}/logs
Authentication: Bearer token (JWT)
idnumberRequiredpagenumberOptional1minimum: 1takenumberOptional10minimum: 1maximum: 50GET/api/v1/setting/webhook/{id}/logs/{logId}
Authentication: Bearer token (JWT)
idnumberRequiredlogIdnumberRequiredPOST/api/v1/setting/webhook/test/{action}
Authentication: Bearer token (JWT)
actionstringRequiredThis response has no body.
POST/api/v1/setting/webhook/{id}/regenerate-secret
Returns the new secret unmasked. It cannot be read back afterwards.
Authentication: Bearer token (JWT)
idnumberRequiredfieldstringRequired when parent is presentField path: errors[].fieldfieldValuestringRequired when parent is presentField path: errors[].fieldValueidentifierstringRequired when parent is presentField path: errors[].identifieridentifierValuestringRequired when parent is presentField path: errors[].identifierValuemessageCodestringRequired when parent is presentField path: errors[].messageCodemessagestringField path: errors[].messageerrorTypestringRequired when parent is presentField path: errors[].errorType{
"messageCode": "string",
"message": "string",
"errors": [
{}
]
}authenticationMethodINTERNAL_WEBHOOK_AUTHENTICATION_METHODOptional"bearer"authenticationConfigWebhookAuthenticationBearerConfigOptional1 required when the containing object is present1 fieldauthenticationConfigtokenstringRequired when parent is presentField path: authenticationConfig.tokenrequestMethodINTERNAL_WEBHOOK_REQUEST_METHODOptional"POST"Allowed values: "POST", "GET", "DELETE"eventsarray of INTERNAL_WEBHOOK_EVENT_TYPERequired"member.deleted", "member.updated", "subscription.created", "subscription.renewed", "member.subscription.activated", "member.subscription.deactivated"minItems: 1{
"name": "string",
"description": "string",
"url": "http://example.com",
"authenticationMethod": "bearer",
"authenticationConfig": {
"token": "<token>"
},
"requestMethod": "POST",
"events": [
"member.deleted"
]
}webhookWebhookRequired16 fieldswebhookrequestMethodstringRequiredField path: webhook.requestMethod"POST", "GET", "DELETE"namestringRequiredField path: webhook.namedescriptionstringRequiredField path: webhook.descriptionurlstringRequiredField path: webhook.urlsecretstringRequiredField path: webhook.secretauthenticationMethodstringRequiredField path: webhook.authenticationMethod"bearer"authenticationConfigWebhookAuthenticationBearerConfigRequiredField path: webhook.authenticationConfig1 fieldwebhook.authenticationConfigtokenstringRequiredField path: webhook.authenticationConfig.tokenisActivebooleanRequiredField path: webhook.isActivetenantIdnumberRequiredField path: webhook.tenantIdwebhookEventsarray of WebhookEventRequiredField path: webhook.webhookEvents10 fieldswebhook.webhookEventsnamestringRequired when parent is presentField path: webhook.webhookEvents[].name"member.deleted", "member.updated", "subscription.created", "subscription.renewed", "member.subscription.activated", "member.subscription.deactivated"webhookWebhookRequired when parent is presentField path: webhook.webhookEvents[].webhookRecursive schema; nested fields are not repeated.webhookEventLogsarray of WebhookEventLogRequired when parent is presentField path: webhook.webhookEvents[].webhookEventLogsNested fields omitted: depth limit.tenantTenantRequiredField path: webhook.tenantNested fields omitted: field limit.idnumberRequiredField path: webhook.idcreatedAtstring (date-time)RequiredField path: webhook.createdAtupdatedAtstring (date-time)RequiredField path: webhook.updatedAtdeletedAtstring (date-time)RequiredField path: webhook.deletedAtmetaDataobjectRequiredField path: webhook.metaDataeventsobject with array of string valuesRequired{
"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": []
}
}Body validation failed
messageCodestringRequired"badRequest"messagestringunauthorized
This response has no body.
forbiddenResource
Same fields as Get all registered webhooks of a tenant (403).
{
"messageCode": "string",
"message": "string",
"errors": [
{}
]
}webhookLimitReached
messageCodestringRequired"webhookLimitReached"messagestringcurlcurl 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"
]
}'This response has no body.
forbiddenResource
Same fields as Get all registered webhooks of a tenant (403).
{
"messageCode": "string",
"message": "string",
"errors": [
{}
]
}curlcurl https://api.subrite.no/api/v1/setting/webhook/events \
--header 'Authorization: Bearer <token>'unauthorized
This response has no body.
forbiddenResource
Same fields as Get all registered webhooks of a tenant (403).
{
"messageCode": "string",
"message": "string",
"errors": [
{}
]
}curlcurl https://api.subrite.no/api/v1/setting/webhook/enqueue-cleanup-old-webhook-event-logs \
--header 'Authorization: Bearer <token>'{
"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": []
}
}The id is not an integer
Same fields as Create a new webhook setting for a tenant (400).
{
"messageCode": "badRequest",
"message": "string",
"errors": [
{}
]
}unauthorized
This response has no body.
forbiddenResource
Same fields as Get all registered webhooks of a tenant (403).
{
"messageCode": "string",
"message": "string",
"errors": [
{}
]
}webhookNotFound
messageCodestringRequired"webhookNotFound"messagestringerrorsarray of FieldErrorRequired7 fieldserrorsfieldstringRequired when parent is presentField path: errors[].fieldfieldValuestringRequired when parent is presentField path: errors[].fieldValueidentifierstringRequired when parent is presentField path: errors[].identifieridentifierValuestringRequired when parent is presentField path: errors[].identifierValuemessageCodestringRequired when parent is presentField path: errors[].messageCodemessagestringField path: errors[].messageerrorTypestringRequired when parent is present{
"messageCode": "webhookNotFound",
"message": "string",
"errors": [
{}
]
}curlcurl 'https://api.subrite.no/api/v1/setting/webhook/{id}' \
--header 'Authorization: Bearer <token>'application/jsonThe id is not an integer
Same fields as Create a new webhook setting for a tenant (400).
{
"messageCode": "badRequest",
"message": "string",
"errors": [
{}
]
}unauthorized
This response has no body.
forbiddenResource
Same fields as Get all registered webhooks of a tenant (403).
{
"messageCode": "string",
"message": "string",
"errors": [
{}
]
}webhookNotFound
Same fields as Get a webhook (404).
{
"messageCode": "webhookNotFound",
"message": "string",
"errors": [
{}
]
}curlcurl 'https://api.subrite.no/api/v1/setting/webhook/{id}' \
--request DELETE \
--header 'Authorization: Bearer <token>'descriptionstringOptionalurlstring (uri)OptionalrequestMethodINTERNAL_WEBHOOK_REQUEST_METHODOptional"POST", "GET", "DELETE"authenticationMethodINTERNAL_WEBHOOK_AUTHENTICATION_METHODOptional"bearer"authenticationConfigUpdateWebhookAuthenticationBearerConfigOptional1 fieldauthenticationConfigtokenstringOptionalField path: authenticationConfig.tokenisActivebooleanOptionaleventsarray of INTERNAL_WEBHOOK_EVENT_TYPEOptional"member.deleted", "member.updated", "subscription.created", "subscription.renewed", "member.subscription.activated", "member.subscription.deactivated"minItems: 1{
"name": "string",
"description": "string",
"url": "http://example.com",
"requestMethod": "POST",
"authenticationMethod": "bearer",
"authenticationConfig": {
"token": "<token>"
},
"isActive": true,
"events": [
"member.deleted"
]
}Same fields as Create a new webhook setting for a tenant (201).
{
"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": []
}
}The id is not an integer, body validation failed, or bearer was selected without a token
messageCodestringRequired"badRequest", "webhookBearerTokenRequired"messagestringunauthorized
This response has no body.
forbiddenResource
Same fields as Get all registered webhooks of a tenant (403).
{
"messageCode": "string",
"message": "string",
"errors": [
{}
]
}webhookNotFound
Same fields as Get a webhook (404).
{
"messageCode": "webhookNotFound",
"message": "string",
"errors": [
{}
]
}curlcurl '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"
]
}'application/jsonitemsarray of WebhookEventLogListItemDtoRequired8 fieldsitemsidnumberRequired when parent is presentField path: items[].idcreatedAtstring (date-time)Required when parent is presentField path: items[].createdAteventINTERNAL_WEBHOOK_EVENT_TYPERequired when parent is presentField path: items[].event"member.deleted", "member.updated", "subscription.created", "subscription.renewed", "member.subscription.activated", "member.subscription.deactivated"attemptNonumberRequired when parent is presentField path: items[].attemptNostatusWEBHOOK_ATTEMPT_STATUSRequired when parent is presentField path: items[].status"succeeded", "failed"responseCodenumberRequired when parent is presentField path: items[].responseCodeerrorCodestringRequired when parent is presentField path: items[].errorCodeidempotencyKeystringRequired when parent is presentField path: items[].idempotencyKeymetaPageMetaRequired6 fieldsmetapagenumberRequiredField path: meta.pagetakenumberRequiredField path: meta.takecountnumberRequiredField path: meta.countpageCountnumberRequiredField path: meta.pageCounthasPreviousPagebooleanRequiredField path: meta.hasPreviousPagehasNextPagebooleanRequiredField path: meta.hasNextPage{
"items": [
{}
],
"meta": {
"page": 0,
"take": 0,
"count": 0,
"pageCount": 0,
"hasPreviousPage": true,
"hasNextPage": true
}
}The id or a query value is invalid
Same fields as Create a new webhook setting for a tenant (400).
{
"messageCode": "badRequest",
"message": "string",
"errors": [
{}
]
}unauthorized
This response has no body.
forbiddenResource
Same fields as Get all registered webhooks of a tenant (403).
{
"messageCode": "string",
"message": "string",
"errors": [
{}
]
}webhookNotFound
Same fields as Get a webhook (404).
{
"messageCode": "webhookNotFound",
"message": "string",
"errors": [
{}
]
}curlcurl 'https://api.subrite.no/api/v1/setting/webhook/{id}/logs' \
--header 'Authorization: Bearer <token>'idnumberRequiredcreatedAtstring (date-time)RequiredeventINTERNAL_WEBHOOK_EVENT_TYPERequired"member.deleted", "member.updated", "subscription.created", "subscription.renewed", "member.subscription.activated", "member.subscription.deactivated"attemptNonumberRequiredstatusWEBHOOK_ATTEMPT_STATUSRequired"succeeded", "failed"idempotencyKeystringRequiredrequestMethodINTERNAL_WEBHOOK_REQUEST_METHODRequired"POST", "GET", "DELETE"urlstringRequiredrequestHeadersobject with string valuesRequiredrequestBodyobject with any valuesresponseCodenumberRequiredresponseBodyobjecterrorobjectpayloadRemovedbooleanRequired{
"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
}An id is not an integer
Same fields as Create a new webhook setting for a tenant (400).
{
"messageCode": "badRequest",
"message": "string",
"errors": [
{}
]
}unauthorized
This response has no body.
forbiddenResource
Same fields as Get all registered webhooks of a tenant (403).
{
"messageCode": "string",
"message": "string",
"errors": [
{}
]
}webhookNotFound, webhookEventLogNotFound
messageCodestringRequired"webhookNotFound", "webhookEventLogNotFound"messagestringerrorsarray of FieldErrorRequired7 fieldserrorsfieldstringRequired when parent is presentField path: errors[].fieldfieldValuestringRequired when parent is presentField path: errors[].fieldValueidentifierstringRequired when parent is presentField path: errors[].identifieridentifierValuestringRequired when parent is presentField path: errors[].identifierValuemessageCodestringRequired when parent is presentField path: errors[].messageCode{
"messageCode": "webhookNotFound",
"message": "string",
"errors": [
{}
]
}curlcurl 'https://api.subrite.no/api/v1/setting/webhook/{id}/logs/{logId}' \
--header 'Authorization: Bearer <token>'webhookTestBadRequest
messageCodestringRequired"webhookTestBadRequest"messagestringerrorsarray of FieldErrorRequired7 fieldserrorsfieldstringRequired when parent is presentField path: errors[].fieldfieldValuestringRequired when parent is presentField path: errors[].fieldValueidentifierstringRequired when parent is presentField path: errors[].identifieridentifierValuestringRequired when parent is presentField path: errors[].identifierValuemessageCodestringRequired when parent is presentField path: errors[].messageCodemessagestringField path: errors[].messageerrorTypestringRequired when parent is presentField path: errors[].errorType{
"messageCode": "webhookTestBadRequest",
"message": "string",
"errors": [
{}
]
}unauthorized
This response has no body.
forbiddenResource
Same fields as Get all registered webhooks of a tenant (403).
{
"messageCode": "string",
"message": "string",
"errors": [
{}
]
}webhookTestNotFound
messageCodestringRequired"webhookTestNotFound"messagestringerrorsarray of FieldErrorRequired7 fieldserrorsfieldstringRequired when parent is presentField path: errors[].fieldfieldValuestringRequired when parent is presentField path: errors[].fieldValueidentifierstringRequired when parent is presentField path: errors[].identifieridentifierValuestringRequired when parent is presentField path: errors[].identifierValuemessageCodestringRequired when parent is presentField path: errors[].messageCodemessagestringField path: errors[].messageerrorTypestringRequired when parent is present{
"messageCode": "webhookTestNotFound",
"message": "string",
"errors": [
{}
]
}curlcurl 'https://api.subrite.no/api/v1/setting/webhook/test/{action}' \
--request POST \
--header 'Authorization: Bearer <token>'RegenerateWebhookSecretResponseDtosecretstringRequired{
"secret": "<secret>"
}The id is not an integer
Same fields as Create a new webhook setting for a tenant (400).
{
"messageCode": "badRequest",
"message": "string",
"errors": [
{}
]
}unauthorized
This response has no body.
forbiddenResource
Same fields as Get all registered webhooks of a tenant (403).
{
"messageCode": "string",
"message": "string",
"errors": [
{}
]
}webhookNotFound
Same fields as Get a webhook (404).
{
"messageCode": "webhookNotFound",
"message": "string",
"errors": [
{}
]
}curlcurl 'https://api.subrite.no/api/v1/setting/webhook/{id}/regenerate-secret' \
--request POST \
--header 'Authorization: Bearer <token>'tenantIdnumberRequired when parent is presentField path: webhook.webhookEvents[].tenantIdtenantTenantRequired when parent is presentField path: webhook.webhookEvents[].tenantNested fields omitted: depth limit.idnumberRequired when parent is presentField path: webhook.webhookEvents[].idcreatedAtstring (date-time)Required when parent is presentField path: webhook.webhookEvents[].createdAtupdatedAtstring (date-time)Required when parent is presentField path: webhook.webhookEvents[].updatedAtdeletedAtstring (date-time)Required when parent is presentField path: webhook.webhookEvents[].deletedAtmetaDataobjectRequired when parent is presentField path: webhook.webhookEvents[].metaDataerrorsarray of FieldErrorerrorsfieldstringRequired when parent is presentField path: errors[].fieldfieldValuestringRequired when parent is presentField path: errors[].fieldValueidentifierstringRequired when parent is presentField path: errors[].identifieridentifierValuestringRequired when parent is presentField path: errors[].identifierValuemessageCodestringRequired when parent is presentField path: errors[].messageCodemessagestringField path: errors[].messageerrorTypestringRequired when parent is presentField path: errors[].errorType{
"messageCode": "badRequest",
"message": "string",
"errors": [
{}
]
}errorsarray of FieldErrorerrorsfieldstringRequired when parent is presentField path: errors[].fieldfieldValuestringRequired when parent is presentField path: errors[].fieldValueidentifierstringRequired when parent is presentField path: errors[].identifieridentifierValuestringRequired when parent is presentField path: errors[].identifierValuemessageCodestringRequired when parent is presentField path: errors[].messageCodemessagestringField path: errors[].messageerrorTypestringRequired when parent is presentField path: errors[].errorType{
"messageCode": "webhookLimitReached",
"message": "string",
"errors": [
{}
]
}errorsarray of FieldErrorRequirederrorsfieldstringRequired when parent is presentField path: errors[].fieldfieldValuestringRequired when parent is presentField path: errors[].fieldValueidentifierstringRequired when parent is presentField path: errors[].identifieridentifierValuestringRequired when parent is presentField path: errors[].identifierValuemessageCodestringRequired when parent is presentField path: errors[].messageCodemessagestringField path: errors[].messageerrorTypestringRequired when parent is presentField path: errors[].errorType{
"messageCode": "badRequest",
"message": "string",
"errors": [
{}
]
}messagestringerrorTypestringRequired when parent is presentField path: errors[].errorType