For the complete documentation index, see llms.txt. This page is also available as Markdown.

Integrate with Platform: LINE WORKS

LINE WORKS is the enterprise version of LINE's communication tool. Once integrated, employees can chat directly with the AI assistant within LINE WORKS without opening another system. Both one-on-one direct messages and group conversations are supported.

LINE WORKS and LINE are two different platforms with entirely different credentials and configuration methods. If you want to integrate with a consumer-facing LINE Official Account, refer to Integrate with Platform: LINE.

Pre-Integration Checklist


Step 1: Create a Client App and Obtain the Service Account

1. Go to the ClientApp Page in Developer Console

Log in to the LINE WORKS Developer Console, click APIClientApp in the left menu, then click Add client app to create an App.

2. Obtain Four Sets of Credentials

Go to the App's detail page and obtain the following four items:

Credential
Location in Console

Client ID

Client ID field

Client Secret

Client Secret field

Service Account

Service Account field, in the format xxxxx.serviceaccount@yourdomain

Private Key

Private Key section, downloadable as a .key file during creation

3. Configure OAuth Scopes

In the OAuth Scopes section on the same page, grant the following permissions. Without these, the AI assistant cannot send or receive messages or look up member names:

Scope
Description

bot

Manage Bot

bot.message

Send messages

bot.read

Read Bot settings

user.read

Read member information (used to display the sender's name in conversations)

The Token Settings on the same page allows you to adjust the Access Token expiration period. MaiAgent automatically manages token issuance and renewal, so keep the default values.

The private key must be in unencrypted PEM format: the first line is a BEGIN PRIVATE KEY or BEGIN RSA PRIVATE KEY marker (with five hyphens before and after), and the last line is the corresponding END marker. If your private key is password-protected, MaiAgent cannot use it — regenerate an unencrypted one.


Step 2: Create a Bot and Obtain the Bot ID and Bot Secret

Click Bot in the left menu of the Developer Console, create a Bot, and obtain:

Credential
Location in Console

Bot ID

Bot ID field

Bot Secret

Bot Secret field, used to verify that messages from LINE WORKS actually originate from your Bot

Required Settings for Group Conversations

On the Bot's Edit page, find Bot PolicyJoin Chat Room, and check Allow to be invited to teams/groups and 1:N chat rooms.

Without this checked, the Bot can only handle one-on-one direct messages and cannot be invited to groups.

Bot Name is also set on this page. This name is what users type when @mentioning the Bot in a group, so choose a name that is easy to type.

Skip the Callback URL for now. It requires the Webhook URL generated by MaiAgent, which we will fill in during Step 4.


Step 3: Create a LINE WORKS Channel in MaiAgent

1. Go to Channel Integration

In the MaiAgent left menu, click Channels, click Integrate Channel in the upper right corner, and select LINE WORKS.

2. Fill in Basic Settings

Field
Description

Name

Give this integration a name (required). This is only a label on the MaiAgent side and is unrelated to the Bot name displayed in LINE WORKS.

AI Assistant

Select the AI assistant to bind

Bot ID

Obtained in Step 2 (required)

Bot Secret

Obtained in Step 2 (required)

Client ID

Obtained in Step 1 (required)

Client Secret

Obtained in Step 1 (required)

Service Account

Obtained in Step 1 (required)

Private Key

Paste the full content of the .key file downloaded in Step 1, including the begin and end marker lines (required)

The form is divided into two sections. The upper section contains the name, AI assistant, and the Bot ID and Bot Secret from Step 2:

Scroll down for the three Client App credentials and private key from Step 1:

Bot Secret and Client Secret are masked with dots after entry. Click the eye icon on the right side of the field to verify the content. For Private Key, paste the full content of the .key file directly — line breaks are preserved as-is.

3. Chat Room Settings

Setting
Description

Require @Bot to reply in groups

When enabled, the Bot only replies in group conversations when @mentioned. Recommended when using in groups — otherwise, every message in the group triggers an AI assistant response.

Enable reset command

When enabled, you can customize a keyword that allows users to clear conversation memory and start over.

"Require @Bot to reply in groups" matches against the Bot name set in Developer Console, not the Inbox name entered in the "Name" field above. If you change the Bot name in Developer Console, the name to @ in the group also changes accordingly.

4. Integration Test

Click Integration Test. MaiAgent will actually request an access token from LINE WORKS to verify the credential combination is correct.

On failure, the screen displays the specific reason. The two most common ones:

  • Credential verification failed — Check in order: whether the Private Key was fully pasted (including the begin and end marker lines, with no missing line breaks), whether it is in unencrypted format, whether the Service Account is complete (including the .serviceaccount@domain suffix), whether Client ID and Client Secret are from the same App, and whether the App has been granted the four Scopes listed in Step 1

  • This Bot ID is already bound to another inbox — The same Bot cannot be connected to two channels simultaneously. Use a different Bot, or delete the existing channel first

The failure message appears to the left of the button:

5. Create and Copy the Webhook URL

Click Integrate Channel to complete the creation. The system generates a Webhook URL — copy it for the next step, where you will paste it back into the Developer Console.

You can also return to the channel's settings page at any time and copy this URL from the API Integration field.


Step 4: Return to Developer Console to Configure the Callback URL

Go back to the Bot created in Step 2 and open the Edit page:

  1. Set Callback URL to On and enter the Webhook URL generated by MaiAgent

  2. Under Callback Event Settings, check the events to receive. It is recommended to check all options under Message Event so the AI assistant can handle all types of messages:

Event
Corresponding User Action

TEXT

Send a text message

Photo

Send an image

File

Send a file

Audio

Send a voice message

Video

Send a video

Location

Share a location

Sticker

Send a sticker

  1. If using in groups, it is also recommended to check Join Event and Joined Event

  2. Save the settings


Step 5: Activate the Bot in the Admin Console

Log in to the LINE WORKS Admin console, go to ServiceBot in the left menu, and click Add Bot in the upper right corner to add the Bot created in Step 2.

After adding, this page lists the Bot and allows you to configure which members can see it in the Usage Permissions column (set to All for all members).


Getting Started

Direct Message

Search for the Bot name in LINE WORKS and start a conversation. The AI assistant replies automatically.

LINE WORKS chat rooms display plain text only and do not render Markdown. If the AI assistant outputs tables or syntax like **bold** or ###, users will see the raw symbols. It is recommended to add a formatting rule in the assistant's role prompt, requesting numbered lists with line breaks instead of Markdown syntax.

Group Conversation

Invite the Bot to a group. If "Require @Bot to reply in groups" is enabled, type @BotName your question to trigger a reply.

In MaiAgent's All Conversations, the same group appears as a single conversation with the sender's name displayed on each message. Multiple people speaking in the group will not be split into separate parallel conversations.

Supported Message Types

User Sends
AI Assistant Handling

Text

Replies directly

Image

Can recognize image content

File (PDF, Excel, Word, etc.)

Reads the content and answers related questions

Voice message

Converts to text before processing

Video

Saved as an attachment and recorded in the conversation

Location

Displayed as "📍 Location shared"

Sticker

Displayed as "🏷 Sticker"

The AI assistant supports text and attachments in replies. If a single text message exceeds LINE WORKS' 1,000-character limit, the system automatically splits it into segments — nothing is truncated.


FAQ

The AI Assistant Suddenly Stopped Replying

First, go to the channel's settings page and check whether a credentials expired warning is displayed.

The most common cause of credential expiration is regenerating the private key or Service Account in Developer Console. Once the old credentials are replaced, MaiAgent can no longer obtain an access token.

Since credentials cannot be modified in place, create a new LINE WORKS channel and enter the new credentials.

The only external symptom of expired credentials is that the AI assistant goes silent — users will not receive any error message. If a colleague reports "the bot isn't responding," this is the first place to check.

Why Can't Credentials Be Modified?

Credentials are sensitive data. After MaiAgent stores them, they are never sent back to the frontend, and the settings page does not accept modifications to avoid repeated exposure of credentials during transmission and on screen. Bot ID, Client ID, and Service Account are displayed in read-only mode so you can verify which Bot is currently connected.

To replace any credential, delete this channel and create a new one.

@Mentioned the Bot in a Group but Got No Response

  • Verify that the @ name matches the Bot name in Developer Console, not the Inbox name in MaiAgent

  • Verify that on the Bot edit page, Bot PolicyJoin Chat Room has Allow to be invited to teams/groups and 1:N chat rooms checked

  • Verify that Callback Event Settings has TEXT checked

Do I Need to Periodically Renew the Token?

No. MaiAgent uses Service Account authentication, where access tokens are automatically issued and renewed by the system. They do not expire over time. As long as the credentials in Developer Console have not been regenerated, the integration remains active.

Last updated

Was this helpful?