Draft replies for your support team in Front
In this tutorial, you build a Front rule that drafts a reply for every new inbound conversation, from all the knowledge you index with Kapa. Kapa indexes your knowledge sources (your documentation site, Notion, Confluence, GitHub, PDFs, support tickets) into one searchable knowledge base. The rule sends the customer's message to Kapa's Chat API and attaches the answer as a comment on the conversation: the draft is waiting before your agent even opens it, and they edit and send it, or discard it. Front is omnichannel, so the same rule covers whatever the inbox handles: email, chat, SMS, or WhatsApp.
Kapa is what you reach for when native AI features stop being enough: your knowledge sources grow in size and complexity, answers fall short, and getting drafts right becomes an indexing and retrieval problem.
The whole setup happens inside Front's UI, with no custom code and no separate hosting, and it is deterministic: you decide exactly when Kapa is called and where its answer lands, and a human decides what reaches the customer. Front does not allow app requests to reply to customers directly, so the comment is the handoff point to a human either way.
By the end of this tutorial, you will have:
- A custom Front app that calls Kapa's Chat API with the content of an inbound message.
- A rule that runs the app on every new inbound conversation and posts the drafted reply as a comment.
Before you start
You need:
- A Kapa project whose indexed knowledge sources contain the knowledge you want the drafts to draw from. Because every draft passes through a human before anything reaches the customer, internal sources (runbooks, past tickets, internal wikis) are as useful here as public documentation.
- A Front account with access to developer settings (Admin or Developer role).
Familiarity with Front's flow builder helps but is not required.
Get your Kapa credentials
The Front side needs three values from the Kapa platform:
- Project ID: the unique identifier of your Kapa project. Go to Settings > Projects and copy it from the table.
- Integration ID: navigate to Integrations (under Configuration in the sidebar), click Add new integration, choose Custom (API), and copy the new integration's ID. It attributes the drafting rule's conversations, so they show up separately in the dashboard and Analytics.
- API key: navigate to API Keys (under Configuration in the sidebar), click Add new API key, and copy the key.
Keep the three values at hand; you paste them into Front in the next sections.
Create the Kapa Connector app
Set up a custom app inside Front. This app handles the outbound API request to Kapa every time it is triggered, acting as the bridge between Front and the Kapa API.
- In Front, go to Settings > Developer Settings.
- Click Create New App.
- Inside the app, click Add New Feature and select App Request.
- Name the feature Kapa Connector.
This creates the request handler that your Front rules call later.
Configure the flow builder
After you create the app and feature, Front opens the Flow Builder, a three-step visual editor that defines what happens when the app is triggered.
Collect the input
This step captures the inbound message content so it can be passed to Kapa.
- Click Collect Input.
- Add a new input and name it
query. This variable holds the body of the incoming message, which is what gets sent to Kapa as the query.
Send the request
This step makes the API call to Kapa.
-
Click Send Request.
-
Set the Method to
POST. -
Under URL, click Add New Server and configure it as follows:
- Origin:
https://api.kapa.ai - Authentication strategy: API Key
- Property name:
X-API-KEY - Send as: HTTP Header
- Enter your Kapa API key when prompted.
- Property name:
- Origin:
-
Set the Path to
/query/v1/projects/:project_id/chat/, replacing:project_idwith your Kapa project ID. -
In the Body section, paste the following JSON, replacing
your_integration_idwith your real value:{"integration_id": "your_integration_id","query": "Suggest a response for this query, reply with only plaintext: {{query}}"}The
{{query}}placeholder marks where the dynamic input variable belongs. In the flow builder, wire it as a variable reference; do not type it literally with curly brackets. -
Click Run Test to send a sample request and confirm the connection works.
-
In the test response, click the
answerfield to save it as a dynamic variable. You use it in the next step.
Return the data
This step defines what the app sends back to Front after querying Kapa. Add one output:
- Type: String
- Name:
answer - Data: the
answervariable captured from the API response.
Once the output is configured, click Save.
Create the rule that triggers the drafts
The app is ready; now tell Front when to run it through Rules, Front's automation engine.
- Go to Settings > Rules & Macros.
- Click Create New Rule and select Create Linear Rule.
- As the trigger, select Inbound message is received (new conversation).
- Add any conditions that determine when the rule applies, for example limiting it to a specific inbox, tag, or sender domain, so the drafts only appear where they make sense.
- Click Add Action and select Send App Request:
- Choose the Kapa Connector app you created.
- In the
queryfield, click Add Variable and create a new dynamic variable for Message Body, which pulls the content of the incoming message. - Click Message Body, choose Add a Step, and select
answer. This chains the message through Kapa and retrieves the response.
- Click Add Action again and select Add Comment. In the body of the comment, insert the App Request variable, which contains the
answerfrom Kapa. This posts the draft as a comment on the conversation thread, visible to your team before anything is sent. - Click Create to activate the rule.
Tune the drafting style (optional)
Out of the box, the drafts follow Kapa's default response style. A customization shapes them into how your team actually writes, and because you associate it with the integration, nothing changes on the Front side.
- Navigate to Customizations (under Configuration in the sidebar) and create a new customization. Give it a name, for example
Front drafts. - Under Style & Tone, click + Add item for each rule the drafts should follow. Each instruction has a name and a description, for example:
No salutations: "Do not open with a greeting or close with a sign-off. Return only the body of the reply."Short and concise: "Keep the reply as short as possible while answering the question. Do not restate the question or add background the customer did not ask for."No internal links: "Never include links to internal sources, such as past support tickets or internal wiki pages. Use them to inform the answer, but only link public documentation."
- Check the preview panel on the right, which shows the system instructions with your changes applied.
- In the Integrations selector on the customization, pick your Custom (API) integration and save. The association also works the other way around, from the Customization column of the Integrations table.
Every draft the rule requests now follows these instructions. The third rule is also what makes internal knowledge sources safe to draw on: the model can use a past ticket to get the answer right without the draft pointing your customer at it. For guidance on writing instructions that models follow reliably, see Write effective instructions.
Verify it works
Send a test message, for example an email, to an inbox the rule covers. Open the conversation in Front: within a few moments, Kapa's drafted answer appears as a comment on the thread. Your team can copy it into a reply, edit it, and send it.
Summary
In this tutorial, you:
- Created a custom Front app with an App Request feature that calls Kapa's Chat API, authenticated with your API key.
- Configured the flow builder to pass the inbound message as the query and return the drafted
answeras its output. - Created a rule that runs the app on every new inbound conversation and posts the draft as a comment.
Next steps
- Knowledge sources: everything you can index, from documentation and API references to tickets and community threads, to widen what the drafts draw from.
- Draft replies for your support team in Intercom Fin: the same pattern for Intercom Fin inboxes.
- Draft replies for your support team in Zendesk: the same pattern for Zendesk tickets.
- Chat API: request-level detail on the endpoint this tutorial calls, including the Chat in thread endpoint for extending the drafts to follow-up messages.