Why LINE?
- Popular in Asia: Dominant in Japan, Taiwan, Thailand, Indonesia
- Rich Features: Supports text, stickers, images, and interactive messages
- Official API: Uses LINE’s official Messaging API
- Group Support: Works in 1-on-1 chats and groups (responds to @mentions)
Prerequisites
- LINE account
- Access to LINE Developers Console
- PicoClaw installed with LLM provider configured
- Public HTTPS endpoint (webhook requirement)
- ~15 minutes for setup
Setup Instructions
Create a LINE Provider
- Go to LINE Developers Console
- Log in with your LINE account
- Click Create a new provider
- Enter a provider name (e.g., your company/project name)
- Click Create
A provider is a container for your LINE channels/bots. One provider can have multiple channels.
Create a Messaging API Channel
- Select your provider
- Click Create a Messaging API channel
- Fill in:
- Channel type: Messaging API
- Provider: Your provider (pre-selected)
- Channel name: Your bot name
- Channel description: Describe your bot
- Category: Choose appropriate category
- Subcategory: Choose subcategory
- Agree to terms of service
- Click Create
Get Channel Credentials
In your channel’s settings:
- Go to Basic settings tab
- Copy Channel Secret
- Go to Messaging API tab
- Scroll to Channel access token
- Click Issue (if not yet issued)
- Copy Channel access token
Set Up Webhook URL
LINE requires HTTPS webhooks. You need a public endpoint:Option 1: Use ngrok (testing)Copy the HTTPS URL (e.g.,
https://abc123.ngrok.io)Option 2: Reverse proxy (production)Set up nginx/Apache with SSL certificate pointing to localhost:18790Option 3: Cloud deploymentDeploy PicoClaw on a cloud server with public IP and SSLConfigure Webhook in LINE
In your channel’s Messaging API tab:
- Find Webhook settings
- Click Edit next to Webhook URL
- Enter:
https://your-domain/webhook/line - Click Update
- Enable Use webhook
- Click Verify to test the connection
The webhook path
/webhook/line is served on PicoClaw’s Gateway server (default 127.0.0.1:18790). All webhook channels share this single server.Configure PicoClaw
Edit Replace:
~/.picoclaw/config.json:channel_secret: From LINE Developers Consolechannel_access_token: Channel access token (long string)webhook_path: Default is/webhook/line(can customize)allow_from: LINE user IDs to allow (empty = allow all)
Configure Auto-Reply Settings
In LINE Developers Console → Messaging API tab:
- Disable Auto-reply messages (so only your bot replies)
- Disable Greeting messages (optional)
- Enable Webhooks
Configuration Options
Basic Configuration
| Field | Type | Required | Description |
|---|---|---|---|
enabled | boolean | Yes | Enable LINE channel |
channel_secret | string | Yes | Channel secret from LINE Developers Console |
channel_access_token | string | Yes | Channel access token |
webhook_path | string | Yes | Webhook path on Gateway server (default: /webhook/line) |
allow_from | array | No | List of allowed LINE user IDs (empty = allow all) |
Access Control
Allow specific users:U and are 33 characters long.
Finding user IDs:
- Check Gateway logs when a user messages the bot
- Use LINE Messaging API to query user profiles
- Inspect webhook payloads
Webhook Requirements
HTTPS Requirement
LINE requires HTTPS for webhook URLs. HTTP is not supported. Solutions:- ngrok (testing):
ngrok http 18790 - Reverse proxy: nginx/Apache with SSL
- Cloud deployment: Server with public IP and SSL certificate
Webhook Path
The webhook path is configured in two places:- PicoClaw config (
webhook_path):/webhook/line - LINE Developers Console:
https://your-domain/webhook/line
Verification
LINE will send a verification request when you click Verify in the console. PicoClaw automatically handles this.Features
Text Messages
Send and receive text messages with conversation context maintained per user.Group Chats
In group chats:- Bot responds only when @mentioned (to avoid spam)
- Replies quote the original message
- Maintains separate context per group
To use bots in LINE groups, the bot must be added to the group by an admin.
Rich Messages
LINE supports:- Text messages
- Images
- Stickers
- Template messages (buttons, carousels)
- Quick replies
- Flex messages (custom layouts)
Message Types
LINE bots can receive:- Text messages
- Image messages
- Video messages
- Audio messages
- Location messages
- Sticker messages
Troubleshooting
”Webhook verification failed”
Possible causes:- Gateway not running
- Webhook URL incorrect
- Firewall blocking incoming requests
- HTTPS certificate invalid
- Wrong webhook path in config
- Ensure
picoclaw gatewayis running - Check Gateway logs for errors
- Verify webhook URL matches:
https://your-domain/webhook/line - Test HTTPS endpoint with
curl - Check
webhook_pathinconfig.json
Bot doesn’t respond to messages
Check these:- Webhook enabled: LINE Developers Console → Messaging API → Use webhook = ON
- Auto-reply disabled: Disable auto-reply in LINE console
- Allow list: User ID in
allow_fromor empty array - LLM configured: Test with
picoclaw agent -m "test" - Gateway logs: Check for incoming webhook requests
”Invalid signature” errors
Cause: Channel secret mismatch Solution:- Verify
channel_secretinconfig.jsonmatches LINE Developers Console - Ensure no extra spaces when copying
- Regenerate channel secret if needed
- Restart gateway
”Unauthorized” errors
Cause: Invalid or expired channel access token Solution:- Go to LINE Developers Console → Messaging API
- Issue new channel access token
- Update
channel_access_tokeninconfig.json - Restart gateway
Webhook timeouts
LINE webhook timeout: 30 seconds maximum If your LLM takes longer than 30 seconds:- Use faster LLM providers (Groq, Cerebras)
- Implement async response pattern
- Send “thinking” acknowledgment immediately
Gateway not accessible from internet
Check:gateway.hostset to0.0.0.0(not127.0.0.1) if accessing from external network- Firewall allows port 18790
- Router port forwarding configured (if behind NAT)
- Cloud security groups allow inbound traffic
Rate Limits
LINE Messaging API has rate limits:- Reply messages: 50 requests/second
- Push messages: Depends on plan (free tier is limited)
- Multicast: 50 requests/second
- Broadcast: Depends on plan
Free LINE bot accounts have limited push message quota. Reply messages (responding to user messages) are unlimited.
Privacy & Security
Data Privacy
LINE bots can access:- Messages sent to the bot
- User display names
- User profile pictures
- Group information (if in groups)
LINE user IDs are unique per bot. The same user has different IDs across different bots (privacy protection).
- LINE privacy policies
- Local data storage in PicoClaw
- LLM provider data logging
- Regional data protection laws
Complete Example
Production Deployment
Using Reverse Proxy
Example nginx configuration:Docker Deployment
When using Docker:gateway.host to 0.0.0.0 in config to accept external connections.
Next Steps
WeCom Channel
Another Asian messaging platform
Telegram Channel
Easier setup without webhooks
Channel Overview
Compare all available channels
Configuration
Advanced configuration options