Portainer icon

Portainer

Interact with Portainer via API

Actions190

Custom Templates → Custom Template Create String

AI-generated

Overview

This custom n8n node named "Portainer" is designed to interact with the Portainer API, a management tool for Docker environments. Specifically, the operation "Custom Template Create String" allows users to send a custom string as the body of an HTTP request to create or manipulate templates within Portainer.

Common scenarios where this node is beneficial include automating the deployment or updating of container templates in Portainer by sending custom JSON or other formatted strings directly via the API. For example, a user might use this node to programmatically create a new container template by providing the full template definition as a string in the request body.

Properties

Name Meaning
Body The raw string content to be sent as the HTTP request body. This should contain the custom template data formatted as required by the Portainer API.

Output

The node outputs data in JSON format representing the response from the Portainer API after sending the custom template string. The exact structure depends on the API's response but typically includes confirmation of the created or updated template, any error messages, or status information.

If the API returns binary data (unlikely in this context), it would be included in the binary output field, but this node primarily deals with JSON responses.

Dependencies

  • Requires an active connection to a Portainer instance.
  • Needs an API authentication token or key configured in the node credentials to authorize requests to the Portainer API.
  • The base URL for the Portainer API must be provided in the credentials configuration.

Troubleshooting

  • Authentication errors: Ensure that the API key or token is valid and has sufficient permissions to create or modify templates.
  • Invalid body format: The "Body" property must be correctly formatted according to Portainer's API specification (usually JSON). Malformed input will cause the API to reject the request.
  • Connection issues: Verify that the Portainer server URL is correct and accessible from the n8n environment.
  • API errors: Check the response message for details if the API returns an error status; adjust the body content accordingly.

Links and References

Discussion