Portainer icon

Portainer

Interact with Portainer via API

Actions190

Endpoints → Endpoint Create

AI-generated

Overview

This node allows you to create a new environment endpoint in Portainer, a container management platform. It is useful for automating the addition of different types of container environments such as local Docker, agent-managed, Azure, edge agents, or Kubernetes clusters into Portainer via API.

Typical use cases include:

  • Automatically registering new Docker hosts or Kubernetes clusters when they become available.
  • Managing multiple container environments centrally by scripting their creation.
  • Integrating environment provisioning workflows with other automation tools.

For example, you could use this node to add a new local Docker environment named "my-environment" or register an Azure environment by providing the necessary Azure credentials and configuration.

Properties

Name Meaning
Name Name used to identify the environment (endpoint), e.g., "my-environment".
Endpoint Creation Type Type of environment to create. Options: 1 (Local Docker), 2 (Agent), 3 (Azure), 4 (Edge agent), 5 (Local Kubernetes).
Container Engine Container engine used by the environment. Options: 'docker' or 'podman'.
URL URL or IP address of the Docker host. Defaults to local socket if not specified. Required if type is Edge agent (4).
Public URL URL or IP where exposed containers are reachable. Defaults to URL if not specified.
Group ID Identifier for grouping environments. Defaults to 1 (unassigned) if not specified.
TLS Whether to require TLS connection to the environment. Must be true if type is Agent (2).
TLS Skip Verify Skip server verification when using TLS. Must be true if type is Agent (2).
TLS Skip Client Verify Skip client verification when using TLS. Must be true if type is Agent (2).
TLS CA Cert File TLS Certificate Authority certificate file for secure connections.
TLS Cert File TLS client certificate file.
TLS Key File TLS client key file.
Azure Application ID Azure application ID. Required if type is Azure (3).
Azure Tenant ID Azure tenant ID. Required if type is Azure (3).
Azure Authentication Key Azure authentication key. Required if type is Azure (3).
Tag Ids JSON array of tag identifiers associated with this environment.
Edge Checkin Interval Check-in interval in seconds for edge agent environments.
Edge Tunnel Server Address URL or IP address used to establish a reverse tunnel for edge agents. Required.
Gpus JSON stringified array listing GPUs as objects with name and value properties.

Output

The node outputs JSON data representing the newly created environment endpoint as returned by the Portainer API. This typically includes details such as the environment's ID, name, type, URLs, TLS settings, tags, and other configuration parameters.

If any binary data were involved (e.g., certificate files), it would be handled accordingly, but in this case, the output is purely JSON describing the created endpoint.

Dependencies

  • Requires an API key credential for authenticating with the Portainer API.
  • The node uses the base URL from the provided credentials to send requests to the Portainer server.
  • No additional external dependencies beyond the Portainer API and its authentication.

Troubleshooting

  • Missing required fields: Ensure all mandatory properties like Name, Endpoint Creation Type, and for some types, Azure credentials or Edge Tunnel Server Address are provided.
  • Invalid Endpoint Creation Type: Use only the allowed numeric values (1 to 5).
  • TLS errors: If TLS is enabled, verify that certificates and keys are correctly provided and valid.
  • Connection failures: Check that the URL or IP address is reachable and correct, especially for remote or edge environments.
  • JSON parsing errors: For properties like TagIds and Gpus, ensure valid JSON strings are supplied.
  • API authentication issues: Confirm that the API key credential is valid and has sufficient permissions.

Links and References

Discussion