TwentyDEV icon

TwentyDEV

Consume the Twenty API

Actions252

Overview

This node operation allows creating multiple workspace members in bulk within a specified workspace. It is useful for scenarios where you need to add several users to a workspace at once, such as onboarding new team members or migrating users from another system. Instead of creating each member individually, this operation streamlines the process by accepting an array of user data and sending it in one request.

Practical examples:

  • Adding a batch of new employees to a project workspace.
  • Importing users from an external HR system into your collaboration platform.
  • Automating membership updates when syncing with other tools.

Properties

Name Meaning
Depth Determines how much related nested information is included in the response:
- 0: Only the primary workspace member's information.
- 1: Primary member plus directly related objects.
- 2: Includes related objects of those related objects as well.
Body JSON object representing a workspace member to create. This includes fields like timeFormat, dateFormat, userId (the unique identifier of the user), and name (with firstName and lastName). The body should be a valid JSON string describing the member details.

Output

The output contains a JSON field representing the created workspace members. Each entry corresponds to a workspace member created by the operation, including their details and any related nested objects depending on the selected depth level.

If binary data is returned (not indicated here), it would typically represent files or attachments related to the workspace members, but this operation primarily deals with JSON data.

Dependencies

  • Requires an API key credential to authenticate requests to the external service managing workspace members.
  • The node expects the base URL and authentication token to be configured in the credentials.
  • The operation uses HTTP POST requests with JSON payloads to create members.

Troubleshooting

  • Invalid JSON in Body: If the JSON provided in the "Body" property is malformed, the request will fail. Ensure the JSON syntax is correct.
  • Missing Required Fields: The API may reject requests missing mandatory fields like userId or name. Verify all required properties are included.
  • Authentication Errors: If the API key or token is invalid or expired, the node will return authentication errors. Check and update credentials accordingly.
  • Depth Parameter Misuse: Setting an unsupported depth value might cause unexpected responses or errors. Use only 0, 1, or 2 as defined.
  • API Rate Limits: Creating many members at once might hit rate limits imposed by the external service. Consider batching requests if errors occur.

Links and References

  • Refer to the external API documentation for workspace members creation for detailed schema and constraints.
  • JSON formatting guides to help construct valid JSON bodies.
  • n8n documentation on using JSON input properties and handling API credentials.

Discussion