Skip to main content

Webhook Triggers

Playbooks can also be triggered via webhooks. When a webhook is configured, mission-control listens on the specified endpoint and any calls to the endpoint triggers the playbook.

POST /webhook/<webhook-path>
webhook-trigger.yaml
apiVersion: mission-control.flanksource.com/v1
kind: Playbook
metadata:
name: create-file-on-webhook
spec:
description: Create a file specified by the webhook
'on':
webhook:
path: my-webhook
authentication:
basic:
username:
value: my-username
password:
value: my-password
actions:
- name: Create the file
exec:
script: echo '{{.request.content}}' > '{{.request.params.path}}'
note

A webhook playbook doesn't accept any parameters and resources unlike a regular playbook.

Authentication

By default, the webhook calls are not protected via authentication. However, there are various authentication methods available as listed below.

Webhook Data

The following details of a webhook request is available on the playbook under request.

FieldDescriptionScheme
content

Content sent on the webhook request

string

headers

Headers sent on the webhook request

json

JSON content if the webhook content is JSON

params

Query parameters sent on the webhook request

url

Endpoint of the webhook. Example /playbook/webhook/my-webhook

string