Directus (flagbit) icon

Directus (flagbit)

Consume Directus API

User → Create

AI-generated

Overview

This node creates a new user in the Directus system. It supports creating users either by specifying individual user fields such as email, password, and additional optional fields like avatar, description, and role, or by providing the entire user data as a JSON/RAW input. This flexibility allows users to either use a form-based approach for common fields or a raw JSON input for more complex or bulk user creation scenarios.

Use Case Examples

  1. Creating a new user by specifying email, password, and optional fields like first name, last name, and role.
  2. Creating a new user by providing the entire user object as a JSON string for advanced use cases or bulk operations.

Properties

Name Meaning
JSON/RAW Parameters Whether the query and/or body parameter should be set via the value-key pair UI or JSON/RAW input. When true, the user provides the entire user data as JSON/RAW.
Body Parameters Body parameters as JSON or RAW input representing the user object. Required if JSON/RAW Parameters is true.
Password Password for the new user. Required if JSON/RAW Parameters is false.
Email Email address of the new user. Required if JSON/RAW Parameters is false.
Additional Fields Optional additional fields for the user such as avatar, description, first name, language, last name, location, role, tags, TFA secret, theme, and title. These fields are only used if JSON/RAW Parameters is false.

Output

JSON

  • id - Unique identifier of the created user.
  • email - Email address of the created user.
  • first_name - First name of the created user.
  • last_name - Last name of the created user.
  • role - Role assigned to the created user.
  • avatar - Avatar file ID associated with the created user.
  • description - Description of the created user.
  • language - Language preference of the created user.
  • location - Location of the created user.
  • tags - Tags associated with the created user.
  • tfa_secret - Two-factor authentication secret of the created user.
  • theme - Theme preference of the created user.
  • title - Title of the created user.

Dependencies

  • Directus API with user management capabilities
  • API authentication credentials for Directus

Troubleshooting

  • Ensure that the required fields (email and password) are provided when JSON/RAW Parameters is false, otherwise the node will throw validation errors.
  • If using JSON/RAW Parameters, ensure the JSON is correctly formatted and contains all necessary user fields to avoid API errors.
  • Check API authentication credentials if the node fails to connect or create the user.
  • Role values must correspond to existing roles in the Directus system; invalid roles will cause errors.

Links

Discussion