Webhook API
Source: daemon/proto/hostcraft/v1/webhook.proto
WebhookService
Section titled “WebhookService”WebhookService manages outbound webhook endpoints, their deliveries and the local hook scripts run for the same events. REST: /api/v1/webhooks.
| Method | REST route | Permission | Streaming |
|---|---|---|---|
ListWebhooks |
GET /api/v1/webhooks |
WebhookRead |
unary |
CreateWebhook |
POST /api/v1/webhooks |
WebhookCreate |
unary |
ListWebhookEvents |
GET /api/v1/webhooks/events |
WebhookRead |
unary |
ListHookScripts |
GET /api/v1/webhooks/hooks |
WebhookRead |
unary |
GetWebhook |
GET /api/v1/webhooks/{id} |
WebhookRead |
unary |
UpdateWebhook |
PATCH /api/v1/webhooks/{id} |
WebhookUpdate |
unary |
DeleteWebhook |
DELETE /api/v1/webhooks/{id} |
WebhookDelete |
unary |
TestWebhook |
POST /api/v1/webhooks/{id}/test |
WebhookTest |
unary |
ListDeliveries |
GET /api/v1/webhooks/{id}/deliveries |
WebhookRead |
unary |
GetDelivery |
GET /api/v1/webhooks/{id}/deliveries/{delivery_id} |
WebhookRead |
unary |
Redeliver |
POST /api/v1/webhooks/{id}/deliveries/{delivery_id}/redeliver |
WebhookTest |
unary |
ListWebhooks
Section titled “ListWebhooks”/hostcraft.v1.WebhookService/ListWebhooks
- Request: ListWebhooksRequest
- Response: ListWebhooksResponse
CreateWebhook
Section titled “CreateWebhook”CreateWebhook returns the signing secret once.
/hostcraft.v1.WebhookService/CreateWebhook
- Request: CreateWebhookRequest
- Response: WebhookWithSecret
ListWebhookEvents
Section titled “ListWebhookEvents”/hostcraft.v1.WebhookService/ListWebhookEvents
- Request: ListWebhookEventsRequest
- Response: ListWebhookEventsResponse
ListHookScripts
Section titled “ListHookScripts”/hostcraft.v1.WebhookService/ListHookScripts
- Request: ListHookScriptsRequest
- Response: ListHookScriptsResponse
GetWebhook
Section titled “GetWebhook”/hostcraft.v1.WebhookService/GetWebhook
- Request: GetWebhookRequest
- Response: WebhookWithSecret
UpdateWebhook
Section titled “UpdateWebhook”UpdateWebhook returns the new secret when it was set or rotated.
/hostcraft.v1.WebhookService/UpdateWebhook
- Request: UpdateWebhookRequest
- Response: WebhookWithSecret
DeleteWebhook
Section titled “DeleteWebhook”/hostcraft.v1.WebhookService/DeleteWebhook
- Request: DeleteWebhookRequest
- Response: Empty
TestWebhook
Section titled “TestWebhook”/hostcraft.v1.WebhookService/TestWebhook
- Request: TestWebhookRequest
- Response: WebhookDeliveryResponse
ListDeliveries
Section titled “ListDeliveries”/hostcraft.v1.WebhookService/ListDeliveries
- Request: ListDeliveriesRequest
- Response: ListDeliveriesResponse
GetDelivery
Section titled “GetDelivery”/hostcraft.v1.WebhookService/GetDelivery
- Request: GetDeliveryRequest
- Response: WebhookDeliveryResponse
Redeliver
Section titled “Redeliver”/hostcraft.v1.WebhookService/Redeliver
- Request: RedeliverRequest
- Response: WebhookDeliveryResponse
Messages
Section titled “Messages”CreateWebhookRequest
Section titled “CreateWebhookRequest”| Field | Type | Number | Description |
|---|---|---|---|
url |
string |
1 | - |
description |
string |
2 | - |
events |
repeated string |
3 | - |
secret |
string |
4 | empty: the daemon generates one |
active |
optional bool |
5 | - |
DeleteWebhookRequest
Section titled “DeleteWebhookRequest”| Field | Type | Number | Description |
|---|---|---|---|
id |
string |
1 | - |
Empty is returned by RPCs whose REST route answers with an empty object or 204 No Content.
No fields.
GetDeliveryRequest
Section titled “GetDeliveryRequest”| Field | Type | Number | Description |
|---|---|---|---|
id |
string |
1 | - |
delivery_id |
string |
2 | - |
GetWebhookRequest
Section titled “GetWebhookRequest”| Field | Type | Number | Description |
|---|---|---|---|
id |
string |
1 | - |
HookScript
Section titled “HookScript”| Field | Type | Number | Description |
|---|---|---|---|
hook |
string |
1 | - |
name |
string |
2 | - |
path |
string |
3 | - |
runnable |
bool |
4 | - |
reason |
string |
5 | - |
ListDeliveriesRequest
Section titled “ListDeliveriesRequest”| Field | Type | Number | Description |
|---|---|---|---|
id |
string |
1 | - |
limit |
int64 |
2 | - |
ListDeliveriesResponse
Section titled “ListDeliveriesResponse”| Field | Type | Number | Description |
|---|---|---|---|
deliveries |
repeated WebhookDelivery |
1 | - |
ListHookScriptsRequest
Section titled “ListHookScriptsRequest”No fields.
ListHookScriptsResponse
Section titled “ListHookScriptsResponse”| Field | Type | Number | Description |
|---|---|---|---|
hooks_dir |
string |
1 | - |
scripts |
repeated HookScript |
2 | - |
ListWebhookEventsRequest
Section titled “ListWebhookEventsRequest”No fields.
ListWebhookEventsResponse
Section titled “ListWebhookEventsResponse”| Field | Type | Number | Description |
|---|---|---|---|
events |
repeated WebhookEventInfo |
1 | - |
ListWebhooksRequest
Section titled “ListWebhooksRequest”No fields.
ListWebhooksResponse
Section titled “ListWebhooksResponse”| Field | Type | Number | Description |
|---|---|---|---|
webhooks |
repeated Webhook |
1 | - |
RedeliverRequest
Section titled “RedeliverRequest”| Field | Type | Number | Description |
|---|---|---|---|
id |
string |
1 | - |
delivery_id |
string |
2 | - |
TestWebhookRequest
Section titled “TestWebhookRequest”| Field | Type | Number | Description |
|---|---|---|---|
id |
string |
1 | - |
UpdateWebhookRequest
Section titled “UpdateWebhookRequest”| Field | Type | Number | Description |
|---|---|---|---|
id |
string |
1 | - |
url |
optional string |
2 | - |
description |
optional string |
3 | - |
events |
repeated string |
4 | replaces the subscriptions when non-empty |
active |
optional bool |
5 | - |
secret |
optional string |
6 | - |
rotate_secret |
bool |
7 | - |
Webhook
Section titled “Webhook”| Field | Type | Number | Description |
|---|---|---|---|
id |
string |
1 | - |
url |
string |
2 | - |
description |
string |
3 | - |
events |
repeated string |
4 | - |
secret_hint |
string |
5 | - |
active |
bool |
6 | - |
created_at |
google.protobuf.Timestamp |
7 | - |
updated_at |
google.protobuf.Timestamp |
8 | - |
WebhookDelivery
Section titled “WebhookDelivery”| Field | Type | Number | Description |
|---|---|---|---|
id |
string |
1 | - |
endpoint_id |
string |
2 | - |
event_id |
string |
3 | - |
event |
string |
4 | - |
status |
string |
5 | - |
attempts |
int64 |
6 | - |
next_attempt_at |
google.protobuf.Timestamp |
7 | - |
last_status_code |
int64 |
8 | - |
last_error |
string |
9 | - |
response_snippet |
string |
10 | - |
duration_ms |
int64 |
11 | - |
payload |
string |
12 | - |
created_at |
google.protobuf.Timestamp |
13 | - |
delivered_at |
google.protobuf.Timestamp |
14 | - |
WebhookDeliveryResponse
Section titled “WebhookDeliveryResponse”| Field | Type | Number | Description |
|---|---|---|---|
delivery |
WebhookDelivery |
1 | - |
WebhookEventInfo
Section titled “WebhookEventInfo”| Field | Type | Number | Description |
|---|---|---|---|
event |
string |
1 | - |
description |
string |
2 | - |
hook |
string |
3 | - |
WebhookWithSecret
Section titled “WebhookWithSecret”| Field | Type | Number | Description |
|---|---|---|---|
webhook |
Webhook |
1 | - |
secret |
string |
2 | - |