Portainer icon

Portainer

Interact with Portainer via API

Actions190

Custom Templates → Custom Template Update

AI-generated

Overview

This node allows updating a custom template in the Portainer system via its API. It is useful when you need to programmatically modify existing templates, for example, to change configuration details or update deployment scripts stored as templates. Practical scenarios include automating template updates during CI/CD pipelines or managing infrastructure templates dynamically.

Properties

Name Meaning
Id The unique identifier of the custom template to update. Must be provided as a number.
Body The detailed content of the template in string format. This represents the new template data that will replace the existing one.

Output

The node outputs JSON data representing the response from the Portainer API after attempting to update the custom template. This typically includes confirmation of the update and the updated template details. There is no indication that binary data is output by this node.

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 @devlikeapro/n8n-openapi-node package and the bundled OpenAPI specification (openapi.json) for request construction.

Troubleshooting

  • Invalid Template Id: If the provided template ID does not exist, the API will likely return an error. Verify the ID before running the node.
  • Malformed Body Content: Ensure the body string contains valid template data as expected by Portainer; otherwise, the update may fail.
  • Authentication Errors: Confirm that the API key credential is correctly set up and has sufficient permissions.
  • Connection Issues: Check the base URL and network connectivity to the Portainer server.

Links and References

Discussion