Lark Contacts icon

Lark Contacts

Lark Contacts Management

Overview

The "Search For Departments" operation in the Department resource allows users to query and retrieve department information from Lark Contacts. This node is useful for organizations that want to programmatically search their organizational structure, find specific departments by name or other criteria, and integrate this data into workflows such as employee onboarding, directory synchronization, or reporting.

For example, a company could use this node to fetch all departments matching a certain keyword to display in an internal app or to automate notifications targeted at specific teams.

Properties

Name Meaning
Authentication Method of authenticating API requests. Options: "Tenant Token" (using a tenant-specific token) or "OAuth2" (using OAuth2 authentication).
Query The search string used to find departments. This is sent as the query field in the request body.
Use Custom Body Boolean flag indicating whether to send a custom JSON body instead of the standard query parameter.
Custom Body A JSON object representing a fully custom request body to send when "Use Custom Body" is enabled. This allows advanced users to specify any valid request payload.

Output

The node outputs JSON data containing the search results for departments. The exact structure depends on the Lark Contacts API response but typically includes fields such as department IDs, names, parent department info, and other metadata.

No binary data output is produced by this node.

Dependencies

  • Requires access to the Lark Suite Open APIs.
  • Requires either a Tenant Token credential or OAuth2 credential configured in n8n for authentication.
  • The base URL for API requests is https://open.larksuite.com/open-apis.
  • Proper permissions/scopes must be granted to the credentials to allow department search operations.

Troubleshooting

  • Authentication errors: Ensure the selected authentication method is correctly configured with valid tokens or OAuth2 credentials.
  • Empty or no results: Verify the query string is correct and matches existing departments. Also check API permissions.
  • Invalid custom body: When using the custom body option, ensure the JSON is well-formed and matches the expected API schema.
  • API rate limits: If many requests are made in a short time, the API may throttle calls. Implement retries or backoff as needed.

Links and References

Discussion