Lark¶
Send notifications to Lark using a custom bot webhook.
URL Format¶
lark://host/token?secret=secret&title=title&link=url
URL Fields¶
- Host - Custom bot URL Host
Default:
open.larksuite.com
URL part:lark://host/path - Path - Custom bot token (Required)
URL part:lark://host/path
Query/Param Props¶
Props can be either supplied using the params argument or through the URL using
?key=value&key=value etc.
-
link - Optional link URL Default: empty
-
secret - Custom bot secret Default: empty
-
title - Message Title Default: empty
-
host: The bot API host (open.larksuite.comfor Lark,open.feishu.cnfor Feishu). token: The bot webhook token (required), the last segment of the webhook URL. It must be one path segment, so a token with a slash, or a token of.or.., is rejected.secret: Optional bot secret for signed requests.title: Optional message title (switches to post format if set).link: Optional URL to include as a clickable link in the message.
Example URL¶
lark://open.larksuite.com/abc123?secret=xyz789&title=Alert&link=https://example.com
Message Size¶
Lark limits the request body of a custom bot message to 20 KB, which Shoutrrr counts as 20,480 bytes. The limit covers the whole JSON body, so all of these parts count toward it:
- The message, as UTF-8 with JSON escapes such as
\"and\n. - The
title, which turns the message into a post. - The
link, which only a post with a title includes. - The
timestampandsignfields that asecretadds.
A body over the limit fails the send before any request is made.
Create a Custom Bot in Lark¶
Official Documentation: Custom Bot Guide
-
Invite the Custom Bot to a Group: a. Open the target group, click
Morein the upper-right corner, and then selectSettings. b. In theSettingspanel, clickGroup Bot. c. ClickAdd a BotunderGroup Bot. d. In theAdd Botdialog, locateCustom Botand select it. e. Set the bot’s name and description, then clickAdd. f. Copy the webhook address and clickFinish. -
Get Host and Token:
- For Lark: Use
host = open.larksuite.com. - For Feishu: Use
host = open.feishu.cn. -
The
tokenis the last segment of the webhook URL. For example, inhttps://open.larksuite.com/open-apis/bot/v2/hook/xxxxxxxxxxxxxxxxx, the token isxxxxxxxxxxxxxxxxx. -
Get Secret (Optional): a. In group settings, open the bot list, find your custom bot, and select it to access its configuration. b. Under
Security Settings, enableSignature Verification. c. ClickCopyto save the secret. d. ClickSaveto apply the changes.