Create or Update Webhook Rule – Management API – MediaKind
Create or Update Webhook Rule
put https://app.mk.io/api/v1/projects/:project_name/webhook/rules/:rule_name
Create or Update Webhook Rule.
RBAC Capability Required: webhooks.config.create or webhooks.config.update
Authentication
Authorization Bearer
Bearer authentication of the form Bearer <token>, where token is your
auth token.
Path parameters
- project_name: string (Required)
- rule_name: string (Required)
Request
This endpoint expects an object.
spec: object WebhookRuleSpecSchema (Required)
Webhook rule spec.
authentication: object AuthenticationSchema (Optional)
Authentication details.
- headers: map from strings to string (Optional)
Authentication headers.
- queryParams: map from strings to string (Optional)
Authentication query parameters.
enabled: boolean (Required)
Indicates whether the webhook is enabled.
events: list of enums (Required)
List of events that trigger the webhook.
headers: map from strings to string (Optional)
Headers to include in the webhook request.
queryParams: map from strings to string (Optional)
Query parameters to include in the webhook request.
url: string (Required)
The URL the webhook should call.
Response
200
Webhook Rule was updated
metadata: object WebhookRuleMetadataSchema (Required)
Webhook rule metadata.
id: string (Required, format: uuid)
The ID of the webhook.
name: string (Required)
The name of the webhook. Unique within a project.
201
Webhook Rule was created
Errors
400 Bad Request
error: object ErrorDetail (Required)
Pertinent information about the error
code: string (Required)
detail: string (Required)
extraDetail: map from strings to any (Optional)
ref: string (Required)
status: integer (Required)
401 Unauthorized
error: object ErrorDetail (Required)
403 Forbidden
404 Not Found
429 Too Many Requests
500 Internal Server Error
all have similar structures as mentioned in 400 with appropriate codes and messages.