Portainer icon

Portainer

Interact with Portainer via API

Actions190

Users → User Create

AI-generated

Overview

This node allows creating a new user in the "Users" resource by sending user details to the target system via an API. It is useful in scenarios where you want to automate user management, such as onboarding new employees or registering users programmatically in an application that supports user creation through its API.

For example, you can use this node to:

  • Automatically create user accounts when a form is submitted.
  • Sync users from another system into the target platform.
  • Batch-create multiple users based on data from other workflows.

Properties

Name Meaning
Body User details in JSON string format. This property contains all necessary information about the user to be created, such as username, email, password, roles, etc., depending on the API's requirements.

Output

The node outputs the response from the API call in the json field of the output data. This typically includes the newly created user's details, such as their unique identifier, status, and any other metadata returned by the API.

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

Dependencies

  • Requires an API key credential for authenticating with the target system's API.
  • The base URL for the API must be configured in the node credentials.
  • The node depends on the target system's API supporting user creation via a POST request with user details in the request body.

Troubleshooting

  • Invalid JSON in Body: If the "Body" property contains malformed JSON, the API call will fail. Ensure the JSON string is correctly formatted.
  • Authentication Errors: Missing or incorrect API credentials will cause authentication failures. Verify that the API key or token is valid and properly configured.
  • API Endpoint Issues: If the base URL or endpoint path is incorrect, the request will not succeed. Confirm the API URL in the credentials.
  • Missing Required Fields: The API may reject requests missing mandatory user fields. Check the API documentation for required user properties.
  • Error Responses: The node will pass through error messages from the API. Review these messages to understand issues like duplicate users or validation errors.

Links and References

  • Refer to the target system's official API documentation for detailed information on user creation endpoints and required fields.
  • n8n documentation on how to configure API credentials and use HTTP request nodes for similar integrations.

Discussion