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

# Front

> Answer conversations in a Front inbox with your agent by pointing a Front webhook at Lua

After this guide, each inbound message in a Front inbox reaches your [agent](/concepts/agents), and the agent's answer is posted back into the same Front conversation as a message from "Lua AI Assistant". You need a Front workspace with permission to create an API token and a webhook. The channel is set up in the admin dashboard  or with the admin REST API; there is no CLI command.

*Verified against lua-cli 3.33.0.*

**Before you begin**

* A Front API token for the workspace. Lua validates it against Front's `/me` endpoint when you save the channel.
* A Front webhook signing key. Lua uses it to verify the `X-Front-Signature` header on every delivery.
* Access to the agent in the admin dashboard, or an API key with the `channels:manage` scope on it.

<Steps>
  <Step title="Provider console: create the token and note the webhook key">
    In Front, create an API token for the workspace and find the signing key for webhooks . Keep both; Lua stores them with the channel and never returns them.
  </Step>

  <Step title="Dashboard: add the Front channel">
    Add a channel of type Front to the agent with the token as the workspace token and the signing key as the webhook key (`POST /admin/agents/<agentId>/channels` with `type: "front"` and a `front` object of `workspaceToken` and `webhookKey`). The response includes `webhookUrl`, of the form `https://wa.heylua.ai/front/<channelId>`. An invalid token fails with `Invalid workspace token. Please check your Front API credentials and try again.`
  </Step>

  <Step title="Provider console: send inbound messages to the webhook URL">
    In Front, create a webhook (or a rule whose action sends to a webhook) that targets the `webhookUrl` for new inbound messages in the inboxes the agent should handle . Lua processes deliveries whose `type` is `inbound` and ignores every other event.
  </Step>

  <Step title="Verify">
    Send an email or message to the inbox. Within the Front conversation, a reply appears from "Lua AI Assistant"; `Lua.request.channel` inside your tools is `front`. Confirm the turn with `lua logs --type agent_response`.
  </Step>
</Steps>

## Channel behavior

| Capability          | Supported                                                                                                                     |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| Inbound text        | Yes; the message text only, with the conversation id, inbox id, and inbox address in the runtime context                      |
| Inbound attachments | No                                                                                                                            |
| Outbound text       | Plain text; `:::` component blocks are not rendered and reach Front as written                                                |
| Reactions           | The `:::reaction` marker is stripped and its emoji stays as plain text; a reply with nothing left after stripping is not sent |
| Proactive sends     | Not in `Channels.send`, and `user.send()` can't reach it                                                                      |
| Identity            | One end user per Front conversation, named after the recipient or the inbox address                                           |
| Conversation scope  | One thread per end user, and the end user is the Front conversation, so each conversation is its own thread                   |

The reply is posted with Front's conversation messages API, leaves the conversation unarchived, and is recorded as a delivery with Front's message id; Front sends no receipts. Because the end user is the conversation, memory and `User` data don't carry across conversations with the same person.

## Limits

| Limit                                    | Value                                                                                          |
| ---------------------------------------- | ---------------------------------------------------------------------------------------------- |
| Time allowed for the reply post to Front | 5 seconds; on failure Lua returns `500` so Front retries the delivery                          |
| Webhook URL and signing key              | One of each per channel; a delivery is verified with the key stored for the channel in its URL |

## Troubleshooting

<AccordionGroup>
  <Accordion title="Webhook Key and Workspace Token are required">
    Both values are mandatory when the channel is created. Paste the Front API token as the workspace token and the webhook signing key as the webhook key.
  </Accordion>

  <Accordion title="Could not reach Front API, or Could not verify token with Front API">
    Lua couldn't call Front's `/me` endpoint to validate the token, or Front answered with an error other than 401 or 403. Retry; if it persists, check Front's status page.
  </Accordion>

  <Accordion title="Messages reach Front but the agent never replies">
    Deliveries whose signature doesn't match the stored webhook key are rejected, and events other than `inbound` are ignored. Re-create the channel with the current signing key, and make sure the Front webhook fires on inbound messages.
  </Accordion>
</AccordionGroup>

## Next steps

<Columns cols={2}>
  <Card title="Email" href="/channels/email">A Lua-managed inbox or forwarding from your own address.</Card>
  <Card title="Add human handoff" href="/build/add-human-handoff">Hand a conversation to a person.</Card>
  <Card title="About channels" href="/concepts/channels">How channels reach your code.</Card>
  <Card title="Channels overview" href="/channels/overview">Every channel and where it is set up.</Card>
</Columns>
