Portainer icon

Portainer

Interact with Portainer via API

Actions190

Endpoint Groups → Endpoint Group Add Endpoint

AI-generated

Overview

This node operation allows you to add an existing endpoint to a specified endpoint group within Portainer. It is useful for organizing and managing multiple endpoints by grouping them logically, which simplifies administration and access control in environments where many endpoints are managed.

Practical example:
If you have several Docker or Kubernetes environments registered as endpoints in Portainer, you can use this operation to add a particular environment (endpoint) to a specific group, such as "Production Servers" or "Development Clusters," helping to keep your infrastructure organized.

Properties

Name Meaning
Id The identifier of the Endpoint Group to which you want to add an endpoint. This is a required numeric value.
Endpoint Id The identifier of the Environment (Endpoint) that you want to add to the specified Endpoint Group. This is a required numeric value.

Output

The node outputs JSON data representing the result of the add endpoint operation. Typically, this will include confirmation details such as success status, updated group information, or error messages if the operation failed.

No binary data output is expected from this operation.

Dependencies

  • Requires an API key credential for authenticating with the Portainer API.
  • The node expects the base URL of the Portainer instance to be configured in the credentials.
  • The Portainer API must be accessible from the n8n environment.

Troubleshooting

  • Common issues:

    • Invalid or missing Endpoint Group ID or Endpoint ID may cause the operation to fail.
    • Network connectivity problems between n8n and the Portainer API can prevent successful requests.
    • Insufficient permissions on the API key used might block modifications to endpoint groups.
  • Error messages:

    • "404 Not Found" — The specified Endpoint Group or Endpoint does not exist. Verify the IDs.
    • "401 Unauthorized" — Authentication failed. Check the API key credential.
    • "400 Bad Request" — Input parameters are invalid or missing. Ensure both IDs are provided and valid numbers.

Resolving these typically involves verifying input values, checking API credentials, and ensuring network accessibility.

Links and References

Discussion