LINE Messaging API
For shops and clinics that talk to customers on a LINE Official Account: answer chats with free reply tokens, push or broadcast text, sticker and Flex messages, look up a follower's profile and keep an eye on the monthly message quota before a campaign goes out.
Connect this API to an AI agent Browse all specs
What you can do with LINE Messaging API via MCP
Every endpoint below becomes a governed tool your AI agent (Claude, ChatGPT, or a customer-facing VX agent) can call — with scoped permissions, sandbox testing, and audit logs.
| Method | Path | Operation | Description |
|---|---|---|---|
| GET | /v2/bot/info |
getBotInfo | Get the Official Account's name, basic id and chat mode |
| GET | /v2/bot/message/quota |
getMessageQuota | Get the monthly limit for paid (push, multicast, broadcast) messages |
| GET | /v2/bot/message/quota/consumption |
getMessageQuotaConsumption | Get how many paid messages were sent this month |
| GET | /v2/bot/profile/{userId} |
getUserProfile | Get a friend's display name, picture and status message |
| GET | /v2/bot/followers/ids |
getFollowerIds | List user ids of people who added the account as a friend |
| POST | /v2/bot/message/validate/push |
validatePushMessage | Check that message objects are valid without sending them |
| POST | /v2/bot/message/reply |
replyMessage | Reply to a user's message using the webhook reply token (free) |
| POST | /v2/bot/message/push |
pushMessage | Send messages to one user, group or room at any time |
| POST | /v2/bot/message/multicast |
multicastMessage | Send the same messages to up to 500 user ids |
| POST | /v2/bot/message/broadcast |
broadcastMessage | Send messages to every friend of the account |
Authentication
Bearer
Bearer token — sent as Authorization: Bearer <token>
LINE channel access token, sent as Authorization: Bearer <token>.
How to get a credential
- Sign in to the LINE Developers Console with the LINE account that manages your LINE Official Account.
- Open your provider and the Messaging API channel linked to the Official Account (create one from LINE Official Account Manager > Settings > Messaging API if it does not exist).
- On the Messaging API tab, scroll to Channel access token (long-lived) and click Issue.
- Copy the token. Long-lived tokens do not expire until you reissue them; keep them secret.
Permissions used
| Access | Operations |
|---|---|
| Channel access token (no scopes) | all operations: replyMessage, pushMessage, multicastMessage, broadcastMessage, validatePushMessage, getMessageQuota, getMessageQuotaConsumption, getUserProfile, getFollowerIds, getBotInfo |
| Verified or premium account only | getFollowerIds |
Common errors
| Status | Meaning | Fix |
|---|---|---|
| 401 | Token missing, wrong or reissued | Issue a new long-lived token and update the credential |
| 403 | Plan or account type does not allow the call (e.g. follower ids on an unverified account) | Use a verified/premium account or skip the call |
| 400 | Invalid message object, expired or reused reply token, or bad user id | Validate the message first; a reply token works once and only shortly after the webhook event |
| 429 | Rate limit or monthly message quota reached | Back off; check getMessageQuota and getMessageQuotaConsumption |
Store the token as a VX Agents credential (bearer token) so it is never pasted into chats or prompts.
Usage guide
Setup
- Credential: a long-lived channel access token from the LINE Developers Console (Messaging API channel). Store it as a VX Agents bearer credential.
- Call
getBotInfoonce to confirm the token belongs to the right Official Account. - Reply tokens come from your webhook events (message, follow, postback); this spec does not receive webhooks itself.
Message a customer
- If you have a fresh
replyTokenfrom a webhook event, usereplyMessage(free, up to 5 messages). - Otherwise check
getMessageQuotaandgetMessageQuotaConsumption: push, multicast and broadcast count against the monthly quota. - Look up the person with
getUserProfileto address them by display name. - Build the messages and run
validatePushMessageto catch format errors. - Show the recipients and the exact text to the user and get confirmation, then call
pushMessage(one user, group or room),multicastMessage(up to 500 user ids) orbroadcastMessage(every friend).
Good to know
- Message objects:
text,sticker(packageId + stickerId),image(HTTPS URLs),flex(altText + contents bubble/carousel). Max 5 messages per request. - A reply token can be used once and expires shortly after the event (about a minute); fall back to push if it fails.
- User ids start with
Uand are per provider; group ids start withC, room ids withR. getFollowerIdsworks only for verified or premium accounts; page with thestarttoken (max 1,000 ids per page).- Send a UUID in
X-Line-Retry-Keywhen retrying a push, multicast or broadcast so a timeout does not deliver twice. - Broadcast reaches every friend and spends quota: always confirm first.
Source: LINE Messaging API reference (https://developers.line.biz/en/reference/messaging-api/), checked 2026-10-16.
How to use this spec
- Create a free VX Agents account (sandbox tools included).
- Open the marketplace and connect “LINE Messaging API” to an agent.
- Expose it as an MCP server for Claude/ChatGPT, or chat with it directly.