Portainer icon

Portainer

Work with Portainer API data to manage Docker

Webhook → Create

AI-generated

Overview

This node operation creates a new webhook in Portainer. It is useful for automating the creation of webhooks that trigger actions or notifications based on events in Portainer-managed Docker environments. For example, you can create a webhook to notify an external system when a stack or service changes.

Use Case Examples

  1. Create a webhook for a specific resource ID to monitor changes in a Docker stack.
  2. Create a webhook of type 'Service' to trigger actions when a Docker service is updated.

Properties

Name Meaning
Resource ID The ID of the resource for which the webhook is created. This is required to specify the target resource in Portainer.
Webhook Type The type of the webhook, either 'Service' or 'Stack', indicating what kind of resource the webhook is associated with.
Request Options Additional HTTP request options such as batching, SSL certificate validation, proxy settings, and timeout configuration to control how the webhook creation request is sent.

Output

JSON

  • ResourceID - The ID of the resource for which the webhook was created.
  • EndpointID - The environment or endpoint ID associated with the webhook.
  • WebhookType - The type of the webhook created, indicating whether it is for a service or stack.

Dependencies

  • Portainer API with an API key credential for authentication

Troubleshooting

  • Ensure the Resource ID is valid and exists in Portainer to avoid creation errors.
  • Verify that the API key credential has sufficient permissions to create webhooks.
  • Check network connectivity and proxy settings if the request fails to reach the Portainer API.
  • If SSL issues occur, consider enabling the option to ignore SSL certificate validation, but be aware of security risks.

Links

Discussion