> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kylon.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect a LINE Official Account

> Connect a LINE Messaging API channel so Kylon can receive new messages through a verified webhook.

Kylon connects to LINE through a bring-your-own LINE Official Account. You provide the account's **Channel Secret** and **Channel Access Token**. Kylon uses them to identify the Official Account, configure its webhook URL, verify webhook delivery, and send messages through the LINE Messaging API.

## Before you start

You need:

* Admin access to a LINE Official Account.
* Access to its matching Messaging API channel in the [LINE Developers Console](https://developers.line.biz/console/).
* A Channel Secret from the account's Basic settings.
* A Channel Access Token from the Messaging API tab.

If the account does not have a Messaging API channel yet, enable the Messaging API in LINE Official Account Manager. LINE creates the corresponding channel in the LINE Developers Console.

## Find the credentials

<Steps>
  <Step title="Open the LINE Official Account">
    Sign in to [LINE Official Account Manager](https://manager.line.biz/) and open the account you want to connect.

    <img src="https://mintcdn.com/kylon/2m-4TusfFdJoeDJl/images/connections/line/line-official-account-manager.png?fit=max&auto=format&n=2m-4TusfFdJoeDJl&q=85&s=12890140dad805aa0ec65c63e202e0f5" alt="LINE Official Account Manager account list" width="2706" height="1206" data-path="images/connections/line/line-official-account-manager.png" />
  </Step>

  <Step title="Copy the Channel Secret">
    Open **Settings** > **Messaging API**. Copy the Channel Secret, or open the matching channel in the LINE Developers Console and copy it from **Basic settings**.
  </Step>

  <Step title="Issue a Channel Access Token">
    Open the matching channel in the [LINE Developers Console](https://developers.line.biz/console/), choose **Messaging API**, and issue or copy a Channel Access Token.

    The token is not shown in LINE Official Account Manager. If necessary, match the numeric Channel ID in both products to make sure you opened the same account.
  </Step>
</Steps>

<Warning>
  The Channel Secret, Channel ID, and Channel Access Token are different values. A Channel Secret is commonly a 32-character value. A Channel ID is numeric. A Channel Access Token is an opaque token and is usually much longer. Do not paste the Channel ID into either Kylon field.
</Warning>

## Create the Kylon connection

You can start setup from either place:

* Click the LINE setup action an agent sent in chat.
* Open the agent's **Connections** page and choose **LINE Official Account**.

Enter both required credentials:

| Kylon field | LINE location | Purpose |
| - | - | - |
| Channel Secret | Official Account Manager, **Settings** > **Messaging API**, or Developers Console, **Basic settings** | Verifies that inbound webhook requests came from LINE. |
| Channel Access Token | Developers Console, **Messaging API** | Identifies the Official Account, configures and verifies the webhook, sends messages, and retrieves message details. |

When you submit the form, Kylon automatically:

1. Checks the Channel Access Token and reads the Official Account name.
2. Creates one pending connection.
3. Sets the Kylon webhook URL in LINE.
4. Tests the webhook endpoint.
5. Checks whether LINE reports webhook delivery as active.

Kylon only shows **LINE connection created** after all checks pass. A successful setup does not require you to copy a webhook URL.

<Note>
  If you close an unfinished chat setup, click the original agent action again to continue the same connection. Kylon does not create a duplicate. You can also repair a pending connection from its **Webhook** menu.
</Note>

## Turn on Webhooks in LINE

LINE's public Messaging API can set and test a webhook URL, but it cannot turn on the account's Webhooks switch. If Kylon asks you to enable webhooks, use either path below.

### LINE Official Account Manager

1. Open the Official Account.
2. Go to **Settings** > **Response settings**.
3. Turn on **Webhooks**.
4. Return to Kylon and click **Check again**.

### LINE Developers Console

1. Open the matching Messaging API channel.
2. Open the **Messaging API** tab.
3. Turn on **Use webhook**.
4. Return to Kylon and click **Check again**.

**Check again** reads and tests the existing webhook. It does not create another connection or replace the URL.

## Manual URL setup

Kylon displays a copyable webhook URL only when LINE rejects or cannot complete the automatic URL update. If Kylon shows **Set the webhook URL in LINE**:

<Steps>
  <Step title="Copy the URL from Kylon">
    Copy the URL shown in the setup dialog. The URL contains a private capability token; do not share it.
  </Step>

  <Step title="Paste it in LINE">
    In the LINE Developers Console, open the channel's **Messaging API** tab. Edit **Webhook URL**, paste the exact Kylon URL, and save it.

    <img src="https://mintcdn.com/kylon/2m-4TusfFdJoeDJl/images/connections/line/line-webhook-settings.png?fit=max&auto=format&n=2m-4TusfFdJoeDJl&q=85&s=3717a690ea0e45f3d4a64ffda38ab3c5" alt="LINE Developers Console webhook settings with Webhook URL, Verify, and Use webhook controls" width="704" height="250" data-path="images/connections/line/line-webhook-settings.png" />
  </Step>

  <Step title="Enable delivery and check again">
    Turn on **Use webhook**, return to Kylon, and click **Check again**. You do not need to create another connection.
  </Step>
</Steps>

## Recommended response settings

If Kylon should handle incoming messages:

* Turn off LINE's automatic replies so they do not compete with the agent.
* Keep Webhooks enabled.
* To receive group or room messages, enable **Allow bot to join group chats** in the LINE Developers Console before inviting the Official Account.

## Message coverage

After the connection is active, Kylon can receive new inbound messages from:

* One-to-one chats with the Official Account.
* Groups that the Official Account has joined.
* Multi-person chats (rooms) that the Official Account has joined.

A missing local Event does not prove that no LINE message exists. If Kylon reports that Event collection is unavailable, repair the webhook before relying on the local history.

For LINE's event and conversation behavior, see [Receive messages](https://developers.line.biz/en/docs/messaging-api/receiving-messages/) and [Group and multi-person chats](https://developers.line.biz/en/docs/messaging-api/group-chats/).

## Verify or repair an existing connection

Open the connection's menu and choose **Webhook**. The dialog shows the current status and the latest webhook activity.

* Click the refresh icon to verify the existing URL, test the endpoint, and recheck the Webhooks switch. Verification does not change LINE's URL.
* Choose **Reconfigure webhook** to replace invalid credentials or let Kylon restore a mismatched URL.
* If the dialog reports a problem, follow its direct recommendation or open this setup guide.

## Troubleshooting

| Symptom | What to do |
| - | - |
| Channel Access Token is invalid or expired | Issue or copy a current token from the channel's **Messaging API** tab, then re-enter it in Kylon. |
| Channel Secret looks like a Channel ID | Use the Channel Secret from **Basic settings**, not the numeric Channel ID. |
| Channel Access Token looks like a Channel Secret or Channel ID | Use the opaque token from **Messaging API**. Both fields are required. |
| Kylon says Webhooks or Use webhook is off | Enable the switch in Official Account Manager or Developers Console, then click **Check again**. |
| Kylon could not set the URL automatically | Copy the URL Kylon displays, paste it into LINE's **Webhook URL**, enable Webhooks, and click **Check again**. |
| LINE is using a different webhook URL | Open **Webhook** in Kylon and choose **Reconfigure webhook** so Kylon can restore the URL. |
| Endpoint verification fails | Confirm the Channel Secret belongs to the same Messaging API channel as the token, then reconfigure and verify again. |
| Setup was closed before it finished | Click the original agent action again, or open the pending connection's **Webhook** menu. |
| Messages do not appear in Kylon | Verify the connection, confirm Webhooks is on, and send a new message after the connection becomes active. Do not interpret an unhealthy connection's empty local history as "no messages." |
| Group or room messages do not appear | Enable **Allow bot to join group chats**, invite the Official Account, and verify the webhook is active. |
| Auto-replies appear instead of Kylon handling the message | Disable LINE's automatic reply features for the Official Account. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.