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

# Connect LINE WORKS to Cogno

> Connect your LINE WORKS Bot, assign conversations to Projects, and send Cogno replies to rooms and DMs.

![LINE WORKS](https://mintcdn.com/genaxis/zRS5HyVJ0PpwYnLV/images/integrations/lineworks.svg?fit=max\&auto=format\&n=zRS5HyVJ0PpwYnLV\&q=85\&s=f1b7a0644d8f1dd4e2fcfa81fd2ef649)

## At a glance

| | |
| - | - |
| **Direction** | Two-way in the rooms and DMs you connect to a Project. |
| **Connect with** | A LINE WORKS ClientApp's Client ID and Client Secret. |
| **Who can set up** | A Workspace administrator with security management access. |
| **You'll need** | Access to LINE WORKS Developer Console. |

Connect the Cogno Bot to your LINE WORKS tenant. Choose which conversations belong to each Project and which Workspace member represents each DM. Cogno reads new messages in enabled conversations and can reply there.

## Before you start

* Use a LINE WORKS tenant whose admin can create apps in Developer Console.
* Cogno creates and configures its own Bot. You do not create a Bot, a Service Account, or a Private Key.

## Connect LINE WORKS in Cogno

**1. Create a ClientApp**

Open **Integrations → LINE WORKS** in Cogno. In LINE WORKS Developer
Console, open **API → ClientApp → Add new app** and create an app. Add the
Redirect URL shown in Cogno, and under **OAuth Scopes** select `bot` and
`user.read`.

**2. Connect**

Enter the app's Client ID and Client Secret in Cogno and choose **Connect
with LINE WORKS**. Approve as a LINE WORKS admin. Cogno creates the Cogno
Bot in your domain, sets its Callback URL, and returns to the connection
page.

**3. Invite Cogno and assign conversations**

Invite Cogno to a LINE WORKS room or start a DM. The connection page lists
the rooms and DMs Cogno is in, with their latest message and the Projects
that read them. In each Project's settings, open **LINE WORKS** and select
the conversations that Project reads. A DM is read only when its sender is
mapped to a Cogno member under **Member mapping**.

**4. Choose how Cogno sends messages**

Under **LINE WORKS Agent tools**, set **Send to LINE WORKS** to **Allow**
for immediate replies. The permission applies only to conversations enabled
for the Project.

To check the connection, send a text message in the enabled DM or room. The **Last callback** time on the connection card updates when LINE WORKS delivers the event.

## Conversation and member mapping

| Conversation | Cogno settings |
| - | - |
| Room | Select it in the Project settings under LINE WORKS. |
| DM | Select it in the Project settings and map its sender under Member mapping. |
| Disconnected | Enter the Client ID and Client Secret to reconnect. Cogno keeps the same Bot. |

Cogno imports new messages only after the conversation is enabled for a Project. A Bot invitation alone does not add messages to Project context.

Under **Member mapping**, Cogno lists the users of your LINE WORKS domain and maps each one to the Cogno member with the same email address. Choose a member by hand for anyone it could not match, or choose **Sync members** to read the user list again. A mapped sender in a room is treated as the person asking, so Cogno can use their own calendar and tools. Reading the user list needs the `user.read` scope on the LINE WORKS app.

## Common states

| State | Meaning | Next action |
| - | - | - |
| **Connected** | Cogno can receive callbacks from the Bot. | Invite Cogno to a room or send it a DM, then choose **Refresh**. |
| **Disconnected** | Cogno has stopped receiving and sending messages. | Under **Reconnect LINE WORKS**, enter the Client ID and Client Secret and choose **Connect with LINE WORKS**. |
| No conversations | No room or DM has been discovered yet. | Invite Cogno to a room or send it a DM, then choose **Refresh**. |
| Last callback is empty | Cogno has not received an event from LINE WORKS yet. | Send a message in a room or DM that includes Cogno. |

## Reference URLs

* [LINE WORKS Bot setup](https://developers.worksmobile.com/jp/docs/bot)
* [LINE WORKS Callback](https://developers.worksmobile.com/jp/docs/bot-callback)
* [LINE WORKS User Account authentication (OAuth)](https://developers.worksmobile.com/jp/docs/auth-oauth)

## Related docs

* [Integrations](https://cogno.studio/docs/integrations.md)
* [Projects](https://cogno.studio/docs/projects.md)
* [Troubleshooting](https://cogno.studio/docs/troubleshooting.md)


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