Lark Contacts icon

Lark Contacts

Lark Contacts Management

Overview

The "Create A Unit" operation in the "Unit" resource of the Lark Contacts node allows users to create a new organizational unit within their Lark workspace. This is useful for managing hierarchical structures such as departments, teams, or groups inside an organization. For example, a company can use this node to programmatically add a new department unit with a specific name, ID, and type, helping automate organizational management workflows.

Properties

Name Meaning
Authentication Method of authentication to use: either "Tenant Token" or "OAuth2".
Name The display name of the unit to be created.
Unit Id A unique identifier string for the unit.
Unit Type The type/category of the unit (e.g., department, team).
Use Custom Body Boolean flag indicating whether to send a custom JSON body instead of the standard fields.
Custom Body A JSON object representing a fully custom request body to send when "Use Custom Body" is enabled.

Output

The node outputs JSON data representing the response from the Lark API after creating the unit. This typically includes details about the newly created unit such as its ID, name, type, and any metadata returned by the API. The output does not include binary data.

Dependencies

  • Requires valid authentication credentials via either a Tenant Token or OAuth2 token.
  • Depends on access to the Lark Suite Open APIs endpoint at https://open.larksuite.com/open-apis.
  • Proper configuration of authentication credentials in n8n is necessary.

Troubleshooting

  • Authentication errors: Ensure that the provided Tenant Token or OAuth2 credentials are valid and have sufficient permissions to create units.
  • Invalid input data: If the unit name, ID, or type is missing or malformed, the API may reject the request. Double-check property values.
  • API rate limits: Frequent requests might hit Lark API rate limits; consider adding delays or retries.
  • Custom Body usage: When using the custom body option, ensure the JSON structure matches the API requirements exactly to avoid request failures.

Links and References

Discussion