Actions109
- Activity Actions
- Assets Actions
- Authentication Actions
- Collections Actions
- Extensions Actions
- Fields Actions
- Files Actions
- Folders Actions
- Items Actions
- Permissions Actions
- Presets Actions
- Relations Actions
- Revisions Actions
- Roles Actions
- Settings Actions
- Users Actions
- Utilities Actions
- Webhooks Actions
Overview
This node integrates with the Directus API to manage users, specifically supporting the operation to create multiple user accounts in one request. It allows sending an array of partial user objects to the Directus backend, which then creates these users accordingly.
Common scenarios where this node is beneficial include:
- Bulk onboarding of new users into a Directus-managed system.
- Migrating users from another system by creating them all at once.
- Automating user creation workflows where multiple accounts need to be provisioned simultaneously.
For example, you can provide a JSON array of user details including email, password, and role identifiers, and the node will create all those users in Directus in a single API call.
Properties
| Name | Meaning |
|---|---|
| Data (JSON) | An array of partial user objects to create. Each object should follow the Directus user object schema. Example: json<br>[<br> {<br> "email": "admin@example.com",<br> "password": "p455w0rd",<br> "role": "c86c2761-65d3-43c3-897f-6f74ad6a5bd7"<br> },<br> {<br> "email": "another@example.com",<br> "password": "d1r3ctu5",<br> "role": "c86c2761-65d3-43c3-897f-6f74ad6a5bd7"<br> }<br>]<br> |
Output
The output is an array of JSON objects representing the created users as returned by the Directus API. Each item corresponds to one user created in the batch operation and contains the full user data including any fields set or generated by Directus (such as user ID).
No binary data output is produced by this operation.
Dependencies
- Requires a valid connection to a Directus instance via an API key credential configured in n8n.
- The node uses the Directus REST API endpoint for users (
POST /users) to create multiple users. - Proper permissions are required on the Directus side to create users.
Troubleshooting
- Invalid JSON format: If the input JSON array is malformed, the node will throw a parsing error. Ensure the JSON syntax is correct.
- Insufficient permissions: If the API key does not have rights to create users, the API will return an authorization error.
- Missing required fields: Each user object must contain required fields such as
emailandpassword. Omitting these may cause the API to reject the request. - Duplicate emails: Attempting to create users with emails that already exist in Directus may result in errors.
- API connectivity issues: Network problems or incorrect Directus URL/credentials will cause request failures.
To resolve errors:
- Validate the JSON input carefully.
- Check API credentials and permissions.
- Review Directus API error messages for specific causes.
- Use the "Continue On Fail" option in n8n if you want the workflow to proceed despite some user creation failures.
Links and References
- Directus Users API documentation: https://docs.directus.io/reference/api/system/users/#the-user-object
- Directus API general docs: https://docs.directus.io/reference/api/
- n8n HTTP Request node documentation (for understanding API calls): https://docs.n8n.io/nodes/n8n-nodes-base.httpRequest/