WEBHOOK
- webhook walker is similar to normal authenticated walker however, normal authenticated walker is associated to a user while webhook is directly to root.
- webhook api keys are manage by user
- supports different HTTP components as API key holder
- header (default):
- query
- path
- body
- name of the api-key can be change to any string (default:
X-API-KEY
)
CREATE WEBHOOK
walker webhook {
can enter1 with `root entry {
report here;
}
class __specs__ {
has webhook: dict = {
"type": "header | query | path | body", # optional: defaults to header
"name": "any string" # optional: defaults to X-API-KEY
};
}
}
WEBHOOK MANAGEMENT APIs
GENERATE API KEY
REQUEST
POST /webhook/generate-key
{ # unique name of webhook "name": "webhook1", # names of allowed webhook walkers. Not set or empty list means all webhook walkers is allowed. "walkers": ["webhook"], # names of allowed nodes. Not set or empty list means all nodes is allowed. "nodes": ["root"], # date now + timedelta( {{interval}}: {{count}} ) "expiration": { "count": 60, # seconds | minutes | hours | days "interval": "days" } }
RESPONSE
{
"id": "672203ee093fd3d208a4b6d4",
"name": "webhook1",
"key": "6721f000ee301e1d54c3de3d:1730282478:P4Nrs3DOLIkaw5aYsbIWNzWZZAwEyb20"
}
GET API KEY
REQUEST
GET /webhook
RESPONSE
{
"keys": [
{
"id": "672203ee093fd3d208a4b6d4",
"name": "test",
"root_id": "6721f000ee301e1d54c3de3d",
"walkers": ["webhook"],
"nodes": ["root"],
"expiration": "2025-12-24T10:01:18.206000",
"key": "6721f000ee301e1d54c3de3d:1730282478:P4Nrs3DOLIkaw5aYsbIWNzWZZAwEyb20"
}
]
}
EXTEND API KEY
REQUEST
PATCH /webhook/extend/
{id}
RESPONSE
DELETE API KEY
REQUEST
DELETE /webhook/delete
RESPONSE
WEBHOOK SAMPLES
BY HEADER
(default)
walker webhook_by_header {
can enter1 with `root entry {
report here;
}
class __specs__ {
has webhook: dict = {
"type": "header",
"name": "test-key"
};
}
}
REQUEST
curl -X 'POST' 'http://localhost:8001/webhook/walker/webhook_by_header' \
-H 'test-key: YOUR-GENERATED-KEY'
BY QUERY
walker webhook_by_query {
can enter1 with `root entry {
report here;
}
class __specs__ {
has webhook: dict = {
"type": "query",
"name": "test_key"
};
}
}
REQUEST
BY PATH
walker webhook_by_path {
can enter1 with `root entry {
report here;
}
class __specs__ {
has webhook: dict = {
"type": "path",
"name": "test_key" # name and the path var should be the same
}, path: str = "/{test_key}";
}
}
REQUEST
BY BODY
walker webhook_by_body {
can enter1 with `root entry {
report here;
}
class __specs__ {
has webhook: dict = {
"type": "body",
"name": "test_key"
};
}
}