Portainer icon

Portainer

Interact with Portainer via API

Actions190

Team Memberships → Team Membership Create

AI-generated

Overview

This node allows you to create a new team membership in Portainer by sending the team membership details as a JSON string in the request body. It is useful when you want to programmatically add users or entities to a team within Portainer, automating team management tasks.

Practical examples include:

  • Automatically adding new users to specific teams after user creation.
  • Managing team memberships in bulk via workflows.
  • Integrating team membership updates with other systems or processes.

Properties

Name Meaning
Body Team membership details provided as a JSON string. This should contain all necessary information to define the team membership according to Portainer's API requirements.

Output

The node outputs the response from the Portainer API after creating the team membership. The output is structured as JSON and typically contains details about the newly created team membership, such as its ID and associated properties.

If the API supports binary data in responses (not indicated here), it would be included accordingly, but this node primarily deals with JSON data.

Dependencies

  • Requires an API key credential for authenticating with the Portainer API.
  • Needs the base URL of the Portainer instance configured in the credentials.
  • Depends on the Portainer API being accessible and properly configured to accept team membership creation requests.

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 incorrect API credentials will cause authentication failures. Verify that the API key and URL are correct.
  • API Endpoint Issues: If the Portainer API endpoint is unreachable or returns errors, check network connectivity and API server status.
  • Insufficient Permissions: The API user must have permissions to create team memberships; otherwise, the request will fail.
  • Error Messages: Common error messages may include HTTP 400 for bad requests (e.g., invalid body), 401 for unauthorized access, or 403 for forbidden actions. Review the error message details to adjust the input or credentials accordingly.

Links and References

Discussion