MINARA

LINE

Outbound push messaging plus signed webhook events via the LINE Messaging API. Popular for Japan and Taiwan operators.

🟡 Outbound-ready, push only, Minara uses LINE's push API (metered, billed monthly). Reply tokens (free) are not yet wired, so every outbound message counts against your plan quota. Inbound webhook events are fully supported with HMAC-SHA256 signature verification.

What you get

  • Push messaging via POST /v2/bot/message/push. Send to a userId, groupId, or roomId.
  • Inbound webhook at /webhooks/line with X-Line-Signature HMAC-SHA256 over the raw body, verified per LINE's published recipe.
  • Text only in this PR, attachments (images, stickers, video) are a future enhancement.
  • 5000-char limit per text message. send_message truncates longer text at the tool boundary.

Setup

1. Create a LINE channel

  1. Go to LINE Developers Console
  2. Create a Provider, then create a Messaging API channel inside it
  3. From the channel page grab Channel access token (long-lived, click "Issue" if blank) and Channel secret

2. Find a user / group ID

When a user adds your bot, the webhook receives a follow event with their userId (an opaque U... string). For groups, send a message in the group, then read groupId off the inbound payload. There is no self-service way to dump every contact, you have to capture one ID during the first interaction.

3. Configure Minara

The fastest path is the interactive picker:

minara auth messaging add
# pick `line` from the list, paste the access token + channel secret +
# default userId / groupId when prompted

Or set env vars directly in your project .env file:

LINE_CHANNEL_ACCESS_TOKEN=<long-lived bearer token>
LINE_CHANNEL_SECRET=<signing key>
LINE_DEFAULT_USER_ID=<default Uxxxxxxxxxxxxxx>

4. Test

minara auth messaging test line

The bot account should receive "✅ Minara gateway test ping" within a second.

Inbound webhook

Configure the LINE channel to POST events to:

https://<your-host>/webhooks/line

LINE signs every webhook body with HMAC-SHA256 over the raw bytes using LINE_CHANNEL_SECRET, presented in the X-Line-Signature header. Minara verifies the signature before parsing the body, so a tampered POST returns 401 and is never forwarded to the agent.

Webhook event types accepted on inbound today: message with message.type === "text". Other types (stickers, media, follow / unfollow events) are ignored.

Limits & caveats

  • Push API is billed monthly. Free plan caps push at 500 / month on the Developer trial tier; paid plans scale higher. Use sparingly for production alerts.
  • Reply tokens are free but not yet wired. A future enhancement will let Minara reply via replyToken (within the 30-second window after an inbound message) without hitting the push quota.
  • 5000-char text limit. Longer text is truncated.

Troubleshooting

"Test message didn't arrive"

  • Confirm the bot is added as a friend (or in the group) on the receiving account
  • Check LINE_DEFAULT_USER_ID shape, the leading U is required
  • Inspect ~/.minara/logs/ for HTTP 4xx responses from api.line.me

"Inbound webhook returns 401"

  • The LINE_CHANNEL_SECRET value in your env does not match the channel secret in the LINE console
  • The signature header is computed over the raw body, double-check that your reverse proxy or CDN is not modifying the bytes

"Push API returns 429"

  • You have exhausted the monthly push quota. Upgrade the plan or switch to reply tokens for non-alerting messages.

Reference

On this page