Portainer icon

Portainer

Interact with Portainer via API

Actions190

Stacks → Stack Delete

AI-generated

Overview

This node operation deletes a stack in the Portainer environment. It is useful for automating the removal of container stacks managed by Portainer, especially when cleaning up unused or obsolete deployments. For example, you might use this node to programmatically delete a Docker Swarm stack after a deployment test completes or to remove external stacks that are no longer needed.

Properties

Name Meaning
Id The unique identifier of the stack to be deleted.
Endpoint Id The identifier of the environment (endpoint) where the stack resides.
Additional Fields Optional extra parameters:
• External: Set to true to delete an external stack (only external Swarm stacks supported).

Output

The output JSON will typically contain the response from the Portainer API confirming the deletion status of the specified stack. This may include success confirmation or error details if the deletion failed. The node does not output binary data.

Dependencies

  • Requires an API key credential for authenticating with the Portainer API.
  • Needs the base URL of the Portainer instance configured in credentials.
  • Depends on the Portainer API being accessible and the user having sufficient permissions to delete stacks.

Troubleshooting

  • Common issues:

    • Invalid or missing stack ID or endpoint ID can cause the deletion to fail.
    • Attempting to delete a non-existent stack will result in an error.
    • Deleting external stacks requires the "External" flag set to true; otherwise, the operation may fail.
    • Network connectivity issues or incorrect API URL/credentials will prevent successful API calls.
  • Error messages:

    • "Stack not found": Verify the stack ID and endpoint ID are correct.
    • "Unauthorized" or "Forbidden": Check API credentials and user permissions.
    • "Invalid parameter": Ensure all required fields are provided and correctly formatted.

Links and References

Discussion