Portainer icon

Portainer

Interact with Portainer via API

Actions190

Tags → Tag Create

AI-generated

Overview

This node allows you to create a new tag in the Portainer system by sending tag details as a JSON string in the request body. It is useful when you want to programmatically manage tags within Portainer, such as categorizing or labeling resources for better organization and filtering.

A practical example would be automating the creation of tags based on deployment environments (e.g., "production", "staging") or project names, enabling easier resource management through consistent tagging.

Properties

Name Meaning
Body The JSON string containing the details of the tag to create. This should include all necessary fields that define the tag in Portainer.

Output

The node outputs the response from the Portainer API after creating the tag. The json output field contains the newly created tag's details as returned by the API, typically including its ID, name, and other metadata.

If the API supports it, binary data output is not expected for this operation since it deals with JSON-based tag creation.

Dependencies

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

Troubleshooting

  • Invalid JSON in Body: If the "Body" property contains malformed JSON, the API will reject the request. Ensure the JSON string is correctly formatted.
  • Authentication Errors: Missing or invalid API credentials will cause authorization failures. Verify that the API key/token is correct and has sufficient permissions.
  • API Endpoint Issues: Incorrect base URL or network connectivity problems can prevent communication with Portainer. Confirm the URL and network access.
  • Missing Required Fields: The tag details JSON must include all required fields as per Portainer's API specification; otherwise, the creation will fail.

Links and References

Discussion