Connect a LINE Official Account to Puccha
Connect a LINE Official Account (LINE OA) to Puccha and the AI answers customers in LINE from your knowledge base automatically — in 1:1 chats and in LINE groups. Every conversation lands in the Puccha inbox for your team to review, reply, or take over from the AI. About 15–20 minutes, no code. Six steps: (1) prepare the LINE OA, (2) enable the Messaging API and copy the Channel Secret + Access Token, (3) add the channel in Puccha, (4) paste the Webhook URL into the LINE Developers Console, (5) turn off Auto-response in LINE OA Manager, (6) send a test message. Steps 1–2 and 4–5 happen in LINE; 3 and 6 in Puccha.
Web version of this guide: https://puccha.ai/help/line (ภาษาไทย: https://puccha.ai/th/help/line)
Before you start
Section titled “Before you start”- A LINE Official Account you administer — the account customers message. You need Admin rights to enable the Messaging API and change Response settings (check at manager.line.biz → pick the account → Settings → Permissions).
- A LINE Developers account (signed in with the same LINE or Business ID as the OA) — used to copy the Channel Secret, issue an Access Token and paste the Webhook URL (developers.line.biz/console).
- Owner or Admin in your Puccha organisation — only those two roles can create, edit or verify a channel. Editors and Viewers see the page but cannot change it (Puccha → Settings → Members).
- A knowledge base with at least one processed document — with no documents the AI answers “I don’t have that” to everything, so you cannot tell whether the connection actually worked (Puccha → Documents, status must be Ready).
Good to know: any LINE OA works, free (Communication) or paid (Light/Standard) — the plans differ only in monthly push-message quota, which does not affect the connection. One Puccha organisation connects one LINE OA. To connect a second account, delete the existing channel first or use a separate organisation.
Step 1 — Prepare the LINE Official Account
Section titled “Step 1 — Prepare the LINE Official Account”Already have a LINE OA? Skip to step 2. Creating one takes about 3 minutes.
- Open https://manager.line.biz and sign in with your company’s LINE or LINE Business ID.
- Click Create LINE Official Account, fill in the account name, email and business type, then confirm.
- Set the profile picture and the display name customers will see. Puccha shows this name when it confirms the connection.
- Note the account’s Basic ID (format
@xxxxxxx, top left of the Home page) — you need it to add the account as a friend when testing.
Tip: for a first run, create a separate test OA (for example “Company name - Test”), connect it to Puccha end to end, then repeat on the real OA. Real customers see nothing while you test.
Step 2 — Enable the Messaging API and copy the Channel Secret and Channel Access Token
Section titled “Step 2 — Enable the Messaging API and copy the Channel Secret and Channel Access Token”This step produces the Channel Secret and Channel Access Token — the only two values Puccha needs. Keep them in a scratch note for a few minutes; do not send them over chat or email.
2.1 Enable the Messaging API (in LINE OA Manager)
Section titled “2.1 Enable the Messaging API (in LINE OA Manager)”Since September 2024 the Messaging API can only be enabled from OA Manager — creating it directly in the Developers Console is no longer possible.
- In manager.line.biz choose the OA → Settings (top right) → Messaging API.
- Click Enable Messaging API.
- Choose a Provider — first time, create one named after your company. (A provider groups all of an organisation’s channels and cannot be changed later.)
- Accept the privacy policy / terms (you may enter your company’s policy URL or leave it blank) and click OK.
- The page then shows Messaging API: Enabled with a Channel ID and Channel secret.
2.2 Copy the Channel Secret
Section titled “2.2 Copy the Channel Secret”- Open https://developers.line.biz/console/ and sign in with the same account.
- Select the provider → the channel whose name matches your OA (green icon, type Messaging API).
- Basic settings tab → scroll to Channel secret → click the copy icon.
- Paste it into your note, labelled “Secret” (32 letters and digits).
2.3 Issue a Channel Access Token
Section titled “2.3 Issue a Channel Access Token”- In the same channel, open the Messaging API tab.
- Scroll to the bottom, Channel access token (long-lived) → click Issue.
- Copy the token (about 170 characters, ending in
=) into your note, labelled “Token”. - Do not click Reissue afterwards. Reissuing invalidates the old token, and Puccha cannot send messages until you paste the new one.
The Channel Secret verifies that an incoming message really came from LINE (Basic settings → Channel secret). The Channel Access Token is used to send replies, read profile names and fetch images customers send (Messaging API → Channel access token (long-lived) → Issue).
Step 3 — Add the LINE channel in Puccha
Section titled “Step 3 — Add the LINE channel in Puccha”Open Puccha → Settings → Channels (or go straight to https://app.puccha.ai/c/<your-org>/channels) and click + Add channel in the top right. The “New channel” form slides in from the right. It contains a Step-by-step setup guide (6 steps) button that opens a short version of this page.
Fields:
- Platform: choose LINE Official Account (the default). The type cannot be changed after creation. (required)
- Channel name: the name your team sees inside Puccha only — customers never see it. Naming it after the OA is easiest. (required)
- Channel Secret: the “Secret” from step 2.2 (shown as dots, because it is a secret). (required)
- Access Token: the “Token” from step 2.3. (required)
- Group trigger word: what members call the bot in a LINE group. Leave blank to use “ปุจฉา” or “puccha”; enter your own (for example “น้องซู”) to give the bot your brand’s name — setting one replaces the default. No effect on 1:1 chats. (optional)
- AI persona: pick a persona created under Personas to set the tone, which documents the bot may use, and which tools it may call. Default = the organisation’s AI settings. Changeable later. (optional)
At the bottom of the form, a Webhook URL box shows https://app.puccha.ai/c/<your-org>/api/channels/line. Copy it into your note now — step 4 needs it.
Click Create. On success you get a “Channel created” message and a green channel card marked Active on the Channels page.
Check the token immediately: click Verify on the channel card. Puccha calls LINE with the stored token; if it is right you see ✓ <OA name> (@basic-id). If you see “Invalid or expired access token”, click Edit and paste a fresh token. (This button checks the token only — the Channel Secret is checked when you press Verify in step 4.)
Errors you may see when creating:
- “LINE requires channelSecret and accessToken” — one of the two fields is empty. Paste both and create again.
- “This LINE OA (@xxx) is already connected as ‘…’” — that access token belongs to an OA already connected under that name. Edit the existing channel instead. (To connect a different OA, use that account’s own Secret/Token.)
- “Admin required” — your account is an Editor or Viewer. Ask an Owner to change your role under Members.
Step 4 — Set the Webhook URL in the LINE Developers Console
Section titled “Step 4 — Set the Webhook URL in the LINE Developers Console”This tells LINE to forward incoming messages to Puccha. Do it after step 3: LINE’s Verify button only succeeds once Puccha has the channel with a matching Channel Secret.
- Open https://developers.line.biz/console/ → your provider → the OA’s channel → Messaging API tab.
- Under Webhook settings, click Edit on Webhook URL.
- Paste the URL copied from Puccha —
https://app.puccha.ai/c/<your-org>/api/channels/line— and click Update. - Click Verify — you need a green Success. (LINE sends a test request signed with the Channel Secret; success means the URL is right and the secret matches.)
- Turn the Use webhook switch on. This is the most commonly forgotten step — Verify passes but the bot stays silent without it.
- Recommended: also enable Webhook redelivery. If Puccha is briefly slow, LINE resends the message; Puccha already de-duplicates, so customers never see a duplicate answer.
Verify results other than Success:
- 401 Unauthorized — the Channel Secret in Puccha does not match this channel (usually a partial copy, or copied from another channel). Puccha → Channels → Edit → paste the Channel Secret again → Update channel → Verify again.
- 404 Not Found — wrong URL, wrong organisation slug in the URL, or the LINE channel was never created in Puccha (or was deleted). Copy the URL from Puccha’s Webhook URL box again rather than typing it.
- Timeout / cannot connect — usually the first call after a quiet period. Wait 10 seconds and press Verify again.
Note: the Webhook URL belongs to the whole organisation, so every connected OA uses the same one. Puccha routes each message by its destination OA and checks the signature with that channel’s own Channel Secret — but every OA needs its own channel in Puccha first. An OA with no channel is rejected with 401.
Step 5 — Turn off Auto-response in LINE OA Manager
Section titled “Step 5 — Turn off Auto-response in LINE OA Manager”The most important step, and the most often skipped. Without it customers get two bubbles — LINE’s automatic “this account cannot reply to messages” followed by Puccha’s real answer — and the first message after connecting may vanish entirely.
- Open https://manager.line.biz → your OA → Settings → Response settings.
- Set the following and click Save:
- Webhooks: on — forwards customer messages to Puccha. (Same switch as “Use webhook” in step 4; either place works.)
- Auto-response messages: off — otherwise LINE answers in competition with Puccha and consumes the reply token, so answers overlap or disappear.
- Greeting message: off — Puccha already sends its own welcome to new friends. With both on, customers get two.
- Chat (replying by hand through OA Manager): off (recommended) — keep your team in the Puccha inbox so the whole history lives in one place. You may leave it on if you also want to reply from the LINE OA app, but those replies do not appear in Puccha.
LINE shows one of two versions of this page depending on the account’s age. If you see the older Response mode: Bot / Chat option, choose Bot and set Webhooks = on, Auto-response = off as above.
Symptom of forgetting: customers see “ต้องขออภัยเป็นอย่างยิ่งที่บัญชีนี้ไม่สามารถตอบข้อความใดๆ ได้…” before the real answer. That message comes from LINE, not from Puccha.
Step 6 — Test the connection from a real phone
Section titled “Step 6 — Test the connection from a real phone”Run these four checks in the LINE mobile app. All four passing means the connection is complete. Keep Puccha → Inbox open beside you to watch the team side.
- Add the OA as a friend with its Basic ID (
@xxxxxxx) or the QR code from OA Manager → in LINE you should get exactly one welcome bubble from Puccha. Nothing appears in Puccha yet (adding a friend does not create a conversation). - Ask something your documents answer — for example “what time do you open?” → a typing indicator for 3–10 seconds, then the answer, follow-up quick-reply buttons, and a “Sources” card when the answer came from a knowledge pack. In Puccha a new conversation appears in the inbox, the customer name is your LINE display name, with a LINE icon, and a new case under Cases.
- Send one sticker → “Thanks for the sticker! Type your question.” comes back immediately, and the sticker appears in the same conversation.
- Ask a follow-up to question 2 — for example “and on holidays?” → an answer that understands the earlier context (the bot remembers the conversation), appended to the same conversation rather than starting a new one.
Further checks: send an image (PNG/JPEG/WebP/HEIC up to 5 MB) → the bot reads it and answers; images containing ID cards, faces or payment cards are refused under the PDPA policy. Type “I’d like to talk to a person” → the bot hands off, the conversation moves to Waiting for agent, and the bot stays quiet until an agent replies from the inbox (the agent’s reply is delivered back to the customer’s LINE automatically). Ask about something not in your documents → the bot should say it cannot find the information rather than inventing an answer, and the question shows up under Knowledge gaps.
The first message after connecting can be a little slower while the system wakes up. If nothing arrives within 30 seconds, send the question once more before working through Troubleshooting.
Using the Puccha bot in LINE groups
Section titled “Using the Puccha bot in LINE groups”The bot works in LINE groups, but answers only messages that address it directly, and only after a group member activates it. Everything else members say is neither read nor stored (by design, for PDPA).
First allow the OA into groups: LINE Developers Console → Messaging API tab → Allow bot to join group chats = Enabled (or OA Manager → Settings → Response settings → allow joining groups).
The sequence: invite the OA to the group → the bot posts a consent notice → a member types “ปุจฉา เปิด” → the bot is active in that group → ask with “ปุจฉา
Group commands (replace “ปุจฉา” with your own Group trigger word if you set one in step 3):
- “ปุจฉา เปิด” or “puccha on” — activate the bot in this group (once per group).
- “ปุจฉา ปิด” or “puccha off” — deactivate it in this group.
- “ปุจฉา เปิดกี่โมง” — the bot answers from the knowledge base.
- “@bot-name เปิดกี่โมง” (@mention the OA) — the same, without typing the trigger word.
- Any message without the trigger — the bot stays silent, reads nothing, stores nothing.
Good to know: the trigger word must come first in the message — “เปิดกี่โมง ปุจฉา” does nothing. Before activation the bot replies asking a group admin to type “ปุจฉา เปิด” first. Follow-up quick replies the bot offers in a group already include the trigger word, so they work as-is. A group’s conversation appears in the inbox as one conversation per group, with each question attributed to the member who asked; agents can reply from Puccha and the reply lands in the group. A channel has one trigger word, shared by every group the OA is in.
After connecting
Section titled “After connecting”Everything is on the channel card in Puccha → Settings → Channels. The card has three buttons: Edit · Verify · Delete.
- Change the channel name / AI persona / group trigger word: Edit → change only what you need → Update channel. Leave Channel Secret and Access Token blank (“Leave blank to keep current”) and the stored values are kept. Effective from the next message.
- Replace the Access Token (suspected leak, or someone pressed Reissue in LINE): LINE Developers → Messaging API → Channel access token → Reissue → copy → Puccha → Edit → paste into Access Token → Update channel → Verify. Do it in one go: in between, the bot cannot send (customer messages still reach the inbox).
- Replace the Channel Secret (after issuing a new one in Basic settings): copy the new value → Puccha → Edit → paste into Channel Secret → Update channel → LINE Developers → Webhook → Verify. While the secrets differ, every message from LINE is rejected (401) and customers get no answer at all.
- Change the bot’s tone or knowledge scope in LINE: create a persona under Personas first, then select it in the channel’s AI persona field. LINE can use a different persona from the web widget — shorter and more casual, for instance.
- Pause the bot without deleting it: LINE Developers → Messaging API → turn Use webhook off, and back on when ready. Messages sent while it is off never reach Puccha and go unanswered.
- Disconnect permanently: Delete → confirm. The webhook stops immediately and old conversations stay in the inbox. Turn off Use webhook on the LINE side too, otherwise LINE keeps posting to a URL with no channel behind it (404).
Check the channel monthly: press Verify on the card — it must show ✓ <OA name> — and send one real test message from LINE. If the OA changed hands, confirm the provider in LINE Developers is still reachable.
Troubleshooting (symptom → cause → fix)
Section titled “Troubleshooting (symptom → cause → fix)”Almost everything traces to three places: a switch on the LINE side, a mismatched Secret/Token, or a knowledge base that has no answer.
- Nothing comes back at all → Use webhook is still off in LINE Developers (Verify passed but the switch was forgotten), or Webhooks is off in OA Manager → turn on Use webhook (step 4.5) and Webhooks in Response settings (step 5), then send again.
- Silent, and Verify returns 401 → the Channel Secret in Puccha does not match → Edit → paste the Channel Secret again → Update channel → Verify again.
- Silent, and Verify returns 404 → wrong URL, or the LINE channel in Puccha was deleted → copy the URL from Puccha’s Webhook URL box again; recreate the channel if it is gone.
- Silent, but Verify passes and conversations appear in the inbox → the Access Token is unusable (expired or reissued): Puccha receives but cannot send → press Verify on the card; if it says “Invalid or expired access token”, issue a new token and paste it into Access Token.
- Two bubbles: “this account cannot reply…” then the real answer → Auto-response messages is still on in OA Manager → turn it off (step 5).
- The first message after setup gets no answer, later ones work → a cold start plus Auto-response competing for the reply token → turn off Auto-response and send again. Not a permanent fault.
- Two welcome messages when adding the account as a friend → Greeting message is still on in OA Manager → turn it off (Puccha sends its own welcome).
- The bot says it cannot find information that is in your documents → the document is still processing, its permissions do not allow external channels, or the selected AI persona limits the document scope → check the document status under Documents, check that it is exposed to external channels, and check the persona’s scope for this channel.
- Answers take more than 10 seconds → a long question, or heavy load → normal in short bursts; if it persists, check Reliability.
- In a group, typing the trigger does nothing → the group was never activated with “ปุจฉา เปิด”, the Group trigger word was changed, or the OA is not allowed into groups → have a member type “
เปิด”, check the trigger word on the channel, and enable Allow bot to join group chats. - “This LINE OA … is already connected” when creating → the token belongs to an OA that is already connected → edit that channel, or use the other account’s Secret/Token.
- The bot goes quiet after a customer asks for a person → working as designed: it stays quiet until an agent picks the conversation up in the inbox → have an agent open the conversation and reply; the reply is delivered to the customer’s LINE.
If none of that resolves it, send the Puccha team four things: your organisation name (the slug in the URL), the OA’s Basic ID, the time you sent the test message, and a screenshot of the Verify result from the LINE Developers Console.
Does LINE charge for this? Replying to a message a customer sent (a reply) is free and unlimited, and Puccha uses replies for almost everything. It uses the push quota (counted against your OA plan’s monthly messages) only when an answer takes longer than a minute, or when an agent replies from the inbox later.
What language does the bot answer in? Whichever language the customer asked in, Thai or English, grounded in your documents. Tone is configurable under Personas.
Can I connect more than one OA? Yes — create one LINE channel in Puccha per OA and paste the same Webhook URL into each. Each channel gets its own persona and group trigger word. You can run Facebook Messenger, Instagram, WhatsApp, Telegram and others alongside; everything lands in one inbox, and the channel name shows which OA a message came from. If each brand needs a separate knowledge base, create a separate Puccha organisation per brand.
Can agents reply to customers themselves? Yes — open the conversation in the inbox and type. The message is delivered to the customer’s LINE as the OA. Once an agent takes over, the bot stops answering in that conversation.
What if a customer sends audio, video, a file or a location? Voice messages and videos up to 1 minute are transcribed and answered like typed text. This is on by default; turn it off under Settings → General → Understand voice notes, and the bot asks the customer to type instead. Files and locations can’t be answered — the bot asks the customer to type the question. Every message is recorded in the conversation so an agent can see it.
What customer data does Puccha store from LINE? The LINE user ID, display name, profile picture and the conversation messages. It does not store phone numbers or email addresses from LINE (LINE does not provide them). Individual data can be erased from the Customers menu under PDPA §33.
Security — the Channel Secret and Access Token are write-only: they cannot be read back after saving. If you lose one, issue a new one in LINE Developers. Every incoming message is signature-checked against the Channel Secret first, and anything not from LINE is rejected. Images customers send have their location/device metadata (EXIF) stripped before storage. In LINE groups, only messages that address the bot are recorded.
Checklist before going live
Section titled “Checklist before going live”- The OA’s Messaging API shows Enabled.
- The LINE channel in Puccha is marked Active, and Verify returns the correct OA name.
- The Webhook URL in LINE Developers matches the one Puccha shows, and Verify returned Success.
- The Use webhook switch is on.
- OA Manager → Response settings: Webhooks on / Auto-response off / Greeting message off.
- A question sent from a real phone returns an answer grounded in your documents, with no “this account cannot reply…” message in front of it.
- The test conversation appears in Puccha → Inbox with a LINE icon.
- The agents who will take over have Puccha accounts and can open the inbox.
- (If using groups) Allow bot to join group chats is on, and “
เปิด” has been tested in a test group. - The Secret/Token have been deleted from any note or chat used to pass them around.