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

# Send a LINE message

> Send text to a linked contact through the Public API or MCP and inspect the send receipt.

Create a Public API key in Settings → API with `line:send`. Add `line:read` to query receipts. Existing keys do not gain either permission automatically.

The organization must have a configured LINE channel and an enabled LINE module. The recipient must be an organization contact with exactly one linked personal LINE account that follows the official account. Missing links, unfollowed accounts and multiple active links return `409 resource_state_conflict` with a reason in `error.details.reason`. Group messages are not supported.

## Send text

This operation sends a real LINE message. Use the authorized recipient and text, with a unique, nonsecret `Idempotency-Key` for each intended send.

```curl theme={null}
curl --request POST 'https://api.brightalk.ai/line-messages' \
  --header "Authorization: Bearer $BRIGHTALK_API_KEY" \
  --header "Brightalk-Version: 2026-07-16" \
  --header "Content-Type: application/json" \
  --header "Idempotency-Key: line-example-update-1" \
  --data '{"contact_id":"123e4567-e89b-42d3-a456-426614174000","message":"Hello, your requested update is ready."}'
```

Text is sent literally, without Automation template expansion. The limit is 5000 UTF-16 code units; some emoji count as two units. LINE user IDs, channel credentials, organization IDs and arbitrary recipient overrides are not accepted.

A `201` creates a send receipt. Always inspect `status`:

| status | Meaning | Next action |
| - | - | - |
| `sent` | LINE accepted the request; delivery or read is not guaranteed | Keep the `id`; do not resend |
| `failed` | The provider rejected the request or a prerequisite failed | Resolve the issue identified by `error_code`, then use a new key for a new send attempt |
| `pending` | Processing, without a confirmed result | Read the receipt using the same key or query its status |
| `unknown` | The outcome is uncertain; it may have been sent | Investigate; do not send again with a new key |

## Query and retry

```curl theme={null}
curl --request GET 'https://api.brightalk.ai/line-messages/123e4567-e89b-42d3-a456-426614174000' \
  --header "Authorization: Bearer $BRIGHTALK_API_KEY" \
  --header "Brightalk-Version: 2026-07-16"
```

Replace the path ID with the send response's `id`. This reads receipts created by the Public API or MCP, not inbox history. Messages also appear in the CRM LINE inbox.

Repeating the same `Idempotency-Key` and body returns the same receipt's current status with `Idempotency-Replayed: true`, without another send. A different body using the same key returns `409 idempotency_conflict`. These receipts do not expire; deleting an inbox message or contact does not allow another send. After one minute, preparation that never started dispatch is `failed` with `dispatch_not_started` and cannot send later. A started dispatch without a recorded outcome is `unknown`. LINE HTTP 429 (rate limit or monthly quota) is a definite refusal: `failed` with `provider_rejected`. Wait for the limit to clear or resolve the quota, then use a new key. A timeout or provider 5xx remains `unknown`.

## MCP

Use `brightalk_send_line_message` with:

```json theme={null}
{
  "body": {
    "contact_id": "123e4567-e89b-42d3-a456-426614174000",
    "message": "Hello, your requested order update is ready."
  },
  "idempotency_key": "contact-order-update-1"
}
```

Use `brightalk_get_line_message` with `{ "message_id": "the returned id" }` to read the result. Read-only mode hides the send tool. Enable action mode and provide a key with `line:send` to send messages.

## Conflict reasons

A `409 resource_state_conflict` includes `error.details.reason`. These conflicts occur before a receipt is claimed, so correct the cause and retry with the same key.

| reason | Meaning and recovery |
| - | - |
| `line_not_linked` | No personal LINE account is linked; link the contact |
| `line_not_following` | The linked account does not follow the official account; ask the recipient to follow |
| `line_multiple_accounts` | Multiple followed personal accounts are linked; select one binding |
| `line_recipient_invalid` | The linked LINE user ID is invalid; repair the binding |
| `line_channel_missing` | The organization has no LINE channel; configure it |


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