SuperAPI AI Directory

lark-contact

Office & productivity

View repository

Updated 10-15 08:33

About this skill

Which command to choose

The user identity and the bot identity are two completely independent paths. First determine the current identity, then choose a command according to the table below:

What you want to do user identity bot identity
Search employees by name / email to get open_id +search-user Not supported
Search bots / agents visible to the current user by keyword +search-bot Not supported
Get another person's profile given an open_id +search-user --user-ids <id> +get-user --user-id <id>
View yourself +get-user or +search-user --user-ids me Not supported
Look up a colleague's personal status / signature user_profiles batch_query Not supported

If you already have an open_id and just want to send a message / schedule a meeting, you don't need to go through contact -- directly lark-im / lark-calendar。

The name doesn't make it clear whether it's a person or a bot / agent

Names given by users often don't indicate the type. For example, reviewDuck in "schedule a meeting with reviewDuck" could be a colleague's nickname or a bot.

  • When the name contains obvious markers such as bot / agent / AI / assistant / robot / intelligent agent / assistant, it's faster to search for bots first instead
  • If unsure, search both sides

Typical scenarios

Find Zhang San to send him a message: search first, confirm the open_id, then send:

lark-cli contact +search-user --query "张三" --has-chatted --as user
lark-cli im +messages-send --user-id ou_xxx --text "Hi!"

Batch query colleagues' personal status / personal signatures (use schema first to check the parameters).

lark-cli schema contact.user_profiles.batch_query
lark-cli contact user_profiles batch_query \
  --params '{"user_id_type":"open_id"}' \
  --data '{"user_ids":["ou_xxx","ou_yyy"],"query_option":{"include_personal_status":true,"include_description":true}}' \
  --as user

If the search returns multiple matches and the follow-up operation has side effects (sending messages, inviting to meetings, etc.), present the candidates to the user to choose; do not arbitrarily pick the first one.

Search bots / agents

+search-bot Use the user identity to search for bots visible to the current user by keyword, returning bot open_ids starting with ou_ . For parameter details, see lark-contact-search-bot.md。

lark-cli contact +search-bot --query '会议助手' --as user
lark-cli contact +search-bot --queries '会议助手,日报助手,审批助手' --as user

Notes

  • 41050 / Permission denied is limited by the visibility scope of the current identity (all three commands may encounter this). For details, see lark-shared。
  • Cross-tenant users(is_cross_tenant=true) Most business fields are empty strings; this is a Feishu visibility rule, and downstream should handle null values with fallbacks.
  • ID types:+get-user can be used via --user-id-type use open_id、union_id or user_id;+search-user use the user open_id;+search-bot does not support lookup by ID; it searches by keyword and returns bot open_ids.

Out of scope for this skill

  • Send messages / view chat history -> lark-im
  • Schedule meetings / invite to meetings -> lark-calendar
  • Department tree / list employees by department / organizational structure -> lark-openapi-explorer find the native API