Skip to content
Kaizena FlowDocs
Search

Search the docs

Webhook endpoints

The owner's own endpoints (D354) and their deliveries, with webhooks:write.

OperationMethod and pathScope
List webhook endpointsGET /webhookswebhooks:write
Add a webhook endpointPOST /webhookswebhooks:write
Change a webhook endpointPATCH /webhooks/{id}webhooks:write
Remove a webhook endpointDELETE /webhooks/{id}webhooks:write
List an endpoint's deliveriesGET /webhooks/{id}/deliverieswebhooks:write
Send a delivery againPOST /webhooks/{id}/deliveries/{delivery_id}/resendwebhooks:write

List webhook endpoints

GET https://kaizenaflow.com/api/admin/v1/webhooks

The owner's endpoints, each with how its deliveries go; never an address or a secret.

  • Operation: webhooks.list

  • Scope: webhooks:write

  • Answers: 200, the answer under data.

Answer

FieldTypeDescription
datalist of objects
data[].idstring (uuid)
data[].namestring
data[].hintstringThe address's host, to tell endpoints apart: the address itself is kept encrypted and never answered.
data[].topicslist of string
data[].enabledboolean
data[].disabled_reasonone of failing, owner or nullfailing: switched off after three days of failed deliveries.
data[].failing_sincestring (date-time) or null
data[].last_deliveryobject or null
data[].last_delivery.statusone of pending, delivered, failed
data[].last_delivery.atstring (date-time)
data[].recent_failuresintegerDeliveries that failed in the last 7 days.

Errors

StatusCodeWhen
401unauthorizedNo valid token in Authorization: Bearer kf_…, or one that was revoked.
403forbiddenThe token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which.
429rate_limitedMore calls than the budget allows; Retry-After says how many seconds to wait.
500failedSomething went wrong on our side; nothing more was done. It is safe to try again.

Example request

curl

curl 'https://kaizenaflow.com/api/admin/v1/webhooks' \
  -H "Authorization: Bearer $KAIZENA_TOKEN"

JavaScript

const response = await fetch("https://kaizenaflow.com/api/admin/v1/webhooks", {
  headers: {
    Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
  },
});
const answer = await response.json();

Python

import json
import os
import urllib.request

request = urllib.request.Request(
    "https://kaizenaflow.com/api/admin/v1/webhooks",
    headers={
        "Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
    },
)
with urllib.request.urlopen(request) as response:
    answer = json.load(response)

Add a webhook endpoint

POST https://kaizenaflow.com/api/admin/v1/webhooks

Adds an endpoint, on, through the Integrations page's own writer (an HTTPS address on a public host, checked again at every send). Its signing secret is answered this once, never again (a replay of the request answers it as null).

Body

JSON, with Content-Type: application/json.

FieldTypeRequiredDescription
namestring, 1 to 80 charactersyes
urlstring, at most 2,000 charactersyesAn HTTPS address on a public host.
topicslist of one of order.paid, order.sent, order.cancelled, order.refunded, customer.created, subscription.started, subscription.cancelled, return.requested, withdrawal.received, product.created, product.updated, stock.low, discount.created, inventory.updated, product.archived, order.created, order.updated, fulfilment.created, fulfilment.updated, refund.created, return.updated, quote.requested, draft.sent, customer.updated, customer.erased, subscription.renewed, subscription.payment_failed, gift_card.issued, review.created, experiment.answered, contract.sent, contract.signed, contract.declined, form.response, support.waiting, deal.created, deal.stage_changed, deal.won, deal.lost, subscriber.subscribed, subscriber.unsubscribed, conversation.ended, conversation.rated, review.published, checkout.abandoned, work_client.created, work_invoice.sent, work_invoice.paid, work_invoice.credited, email.bounced, email.complained, broadcast.sent, marketing.paused, activity.created, activity.done, lead.dismissed, lead.deal_made, domain.failing, domain.recovered, 1 to 40 itemsyes

Answer

FieldTypeDescription
dataobject
data.idstring (uuid)
data.namestring
data.hintstringThe address's host, to tell endpoints apart: the address itself is kept encrypted and never answered.
data.topicslist of string
data.enabledboolean
data.disabled_reasonone of failing, owner or nullfailing: switched off after three days of failed deliveries.
data.failing_sincestring (date-time) or null
data.last_deliveryobject or null
data.last_delivery.statusone of pending, delivered, failed
data.last_delivery.atstring (date-time)
data.recent_failuresintegerDeliveries that failed in the last 7 days.
data.secretstring or nullThe signing secret, this once.

Errors

StatusCodeWhen
401unauthorizedNo valid token in Authorization: Bearer kf_…, or one that was revoked.
403forbiddenThe token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which.
409conflictNothing was done: it clashes with how things are now (nothing left to send), or an Idempotency-Key is in use or was used for another request.
422invalidNothing was done: a body, query or cursor that is not as described, or a check of the screen it goes through; the message says what.
429rate_limitedMore calls than the budget allows; Retry-After says how many seconds to wait.
500failedSomething went wrong on our side; nothing more was done. It is safe to try again.

Example request

curl

curl -X POST 'https://kaizenaflow.com/api/admin/v1/webhooks' \
  -H "Authorization: Bearer $KAIZENA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"Example","url":"https://example.com","topics":["order.paid"]}'

JavaScript

const response = await fetch("https://kaizenaflow.com/api/admin/v1/webhooks", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "name": "Example",
    "url": "https://example.com",
    "topics": [
      "order.paid"
    ]
  }),
});
const answer = await response.json();

Python

import json
import os
import urllib.request

request = urllib.request.Request(
    "https://kaizenaflow.com/api/admin/v1/webhooks",
    method="POST",
    headers={
        "Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
        "Content-Type": "application/json",
    },
    data=json.dumps({
        "name": "Example",
        "url": "https://example.com",
        "topics": [
            "order.paid",
        ],
    }).encode(),
)
with urllib.request.urlopen(request) as response:
    answer = json.load(response)

Change a webhook endpoint

PATCH https://kaizenaflow.com/api/admin/v1/webhooks/{id}

Changes its name, address or topics, or switches it on or off.

  • Operation: webhooks.update

  • Scope: webhooks:write

  • Answers: 200, the answer under data.

Path parameters

NameTypeRequiredDescription
idstring (uuid)yesThe thing's id in this store.

Body

JSON, with Content-Type: application/json.

FieldTypeRequiredDescription
namestring, 1 to 80 charactersno
urlstring, at most 2,000 charactersnoA new address; the one there stays when left out.
topicslist of one of order.paid, order.sent, order.cancelled, order.refunded, customer.created, subscription.started, subscription.cancelled, return.requested, withdrawal.received, product.created, product.updated, stock.low, discount.created, inventory.updated, product.archived, order.created, order.updated, fulfilment.created, fulfilment.updated, refund.created, return.updated, quote.requested, draft.sent, customer.updated, customer.erased, subscription.renewed, subscription.payment_failed, gift_card.issued, review.created, experiment.answered, contract.sent, contract.signed, contract.declined, form.response, support.waiting, deal.created, deal.stage_changed, deal.won, deal.lost, subscriber.subscribed, subscriber.unsubscribed, conversation.ended, conversation.rated, review.published, checkout.abandoned, work_client.created, work_invoice.sent, work_invoice.paid, work_invoice.credited, email.bounced, email.complained, broadcast.sent, marketing.paused, activity.created, activity.done, lead.dismissed, lead.deal_made, domain.failing, domain.recovered, 1 to 40 itemsno
enabledbooleanno

Answer

FieldTypeDescription
dataobject
data.idstring (uuid)
data.namestring
data.hintstringThe address's host, to tell endpoints apart: the address itself is kept encrypted and never answered.
data.topicslist of string
data.enabledboolean
data.disabled_reasonone of failing, owner or nullfailing: switched off after three days of failed deliveries.
data.failing_sincestring (date-time) or null
data.last_deliveryobject or null
data.last_delivery.statusone of pending, delivered, failed
data.last_delivery.atstring (date-time)
data.recent_failuresintegerDeliveries that failed in the last 7 days.

Errors

StatusCodeWhen
401unauthorizedNo valid token in Authorization: Bearer kf_…, or one that was revoked.
403forbiddenThe token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which.
404not_foundNo such route, or nothing with that id in the token's store (another store's ids are simply not found).
422invalidNothing was done: a body, query or cursor that is not as described, or a check of the screen it goes through; the message says what.
429rate_limitedMore calls than the budget allows; Retry-After says how many seconds to wait.
500failedSomething went wrong on our side; nothing more was done. It is safe to try again.

Example request

curl

curl -X PATCH 'https://kaizenaflow.com/api/admin/v1/webhooks/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f' \
  -H "Authorization: Bearer $KAIZENA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"Example"}'

JavaScript

const response = await fetch("https://kaizenaflow.com/api/admin/v1/webhooks/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "name": "Example"
  }),
});
const answer = await response.json();

Python

import json
import os
import urllib.request

request = urllib.request.Request(
    "https://kaizenaflow.com/api/admin/v1/webhooks/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f",
    method="PATCH",
    headers={
        "Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
        "Content-Type": "application/json",
    },
    data=json.dumps({
        "name": "Example",
    }).encode(),
)
with urllib.request.urlopen(request) as response:
    answer = json.load(response)

Remove a webhook endpoint

DELETE https://kaizenaflow.com/api/admin/v1/webhooks/{id}

Removes the endpoint; what it still has waiting is not sent.

  • Operation: webhooks.delete

  • Scope: webhooks:write

  • Answers: 200, the answer under data.

Path parameters

NameTypeRequiredDescription
idstring (uuid)yesThe thing's id in this store.

Answer

FieldTypeDescription
dataobject
data.idstring (uuid)
data.deletedtrue

Errors

StatusCodeWhen
401unauthorizedNo valid token in Authorization: Bearer kf_…, or one that was revoked.
403forbiddenThe token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which.
404not_foundNo such route, or nothing with that id in the token's store (another store's ids are simply not found).
429rate_limitedMore calls than the budget allows; Retry-After says how many seconds to wait.
500failedSomething went wrong on our side; nothing more was done. It is safe to try again.

Example request

curl

curl -X DELETE 'https://kaizenaflow.com/api/admin/v1/webhooks/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f' \
  -H "Authorization: Bearer $KAIZENA_TOKEN"

JavaScript

const response = await fetch("https://kaizenaflow.com/api/admin/v1/webhooks/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f", {
  method: "DELETE",
  headers: {
    Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
  },
});
const answer = await response.json();

Python

import json
import os
import urllib.request

request = urllib.request.Request(
    "https://kaizenaflow.com/api/admin/v1/webhooks/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f",
    method="DELETE",
    headers={
        "Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
    },
)
with urllib.request.urlopen(request) as response:
    answer = json.load(response)

List an endpoint's deliveries

GET https://kaizenaflow.com/api/admin/v1/webhooks/{id}/deliveries

The endpoint's latest deliveries (kept 30 days), newest first, with how each went.

  • Operation: webhooks.deliveries

  • Scope: webhooks:write

  • Answers: 200, the answer under data.

Path parameters

NameTypeRequiredDescription
idstring (uuid)yesThe thing's id in this store.

Query parameters

NameTypeRequiredDescription
limitinteger, 1 to 100noRows a page holds, at most 100; 50 when left out. A larger number gives 100.

Answer

FieldTypeDescription
datalist of objects
data[].idstring (uuid)
data[].topicstring
data[].statusone of pending, delivered, failed
data[].attemptsinteger
data[].last_statusinteger or nullThe receiver's last HTTP status.
data[].last_errorstring or null
data[].created_atstring (date-time)
data[].next_attempt_atstring (date-time)

Errors

StatusCodeWhen
401unauthorizedNo valid token in Authorization: Bearer kf_…, or one that was revoked.
403forbiddenThe token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which.
404not_foundNo such route, or nothing with that id in the token's store (another store's ids are simply not found).
422invalidNothing was done: a body, query or cursor that is not as described, or a check of the screen it goes through; the message says what.
429rate_limitedMore calls than the budget allows; Retry-After says how many seconds to wait.
500failedSomething went wrong on our side; nothing more was done. It is safe to try again.

Example request

curl

curl 'https://kaizenaflow.com/api/admin/v1/webhooks/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/deliveries' \
  -H "Authorization: Bearer $KAIZENA_TOKEN"

JavaScript

const response = await fetch("https://kaizenaflow.com/api/admin/v1/webhooks/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/deliveries", {
  headers: {
    Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
  },
});
const answer = await response.json();

Python

import json
import os
import urllib.request

request = urllib.request.Request(
    "https://kaizenaflow.com/api/admin/v1/webhooks/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/deliveries",
    headers={
        "Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
    },
)
with urllib.request.urlopen(request) as response:
    answer = json.load(response)

Send a delivery again

POST https://kaizenaflow.com/api/admin/v1/webhooks/{id}/deliveries/{delivery_id}/resend

Sends a delivery that ended (failed or delivered) again, with the same payload and id, to an endpoint that is on.

Path parameters

NameTypeRequiredDescription
idstring (uuid)yesThe thing's id in this store.
delivery_idstring (uuid)yesThe delivery.

Body

JSON, with Content-Type: application/json.

FieldTypeRequiredDescription
bodyobjectyesNothing: send {} or no body.

Answer

FieldTypeDescription
dataobject
data.queuedtrue

Errors

StatusCodeWhen
401unauthorizedNo valid token in Authorization: Bearer kf_…, or one that was revoked.
403forbiddenThe token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which.
404not_foundNo such route, or nothing with that id in the token's store (another store's ids are simply not found).
409conflictNothing was done: it clashes with how things are now (nothing left to send), or an Idempotency-Key is in use or was used for another request.
422invalidNothing was done: a body, query or cursor that is not as described, or a check of the screen it goes through; the message says what.
429rate_limitedMore calls than the budget allows; Retry-After says how many seconds to wait.
500failedSomething went wrong on our side; nothing more was done. It is safe to try again.

Example request

curl

curl -X POST 'https://kaizenaflow.com/api/admin/v1/webhooks/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/deliveries/e583bf4d-ab8b-4f0a-b95e-482664f6a6ed/resend' \
  -H "Authorization: Bearer $KAIZENA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

JavaScript

const response = await fetch("https://kaizenaflow.com/api/admin/v1/webhooks/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/deliveries/e583bf4d-ab8b-4f0a-b95e-482664f6a6ed/resend", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({}),
});
const answer = await response.json();

Python

import json
import os
import urllib.request

request = urllib.request.Request(
    "https://kaizenaflow.com/api/admin/v1/webhooks/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/deliveries/e583bf4d-ab8b-4f0a-b95e-482664f6a6ed/resend",
    method="POST",
    headers={
        "Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
        "Content-Type": "application/json",
    },
    data=json.dumps({}).encode(),
)
with urllib.request.urlopen(request) as response:
    answer = json.load(response)

Made from the API contract, version 1.57This page as Markdown

Was this page helpful?