Skip to main content

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:

  1. Project ID: the unique identifier of your Kapa project. Go to Settings > Projects and copy it from the table.
  2. 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.
  3. 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.

  1. In Front, go to Settings > Developer Settings.
  2. Click Create New App.
  3. Inside the app, click Add New Feature and select App Request.
  4. 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.

  1. Click Collect Input.
  2. 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.

  1. Click Send Request.

  2. Set the Method to POST.

  3. 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.
  4. Set the Path to /query/v1/projects/:project_id/chat/, replacing :project_id with your Kapa project ID.

  5. In the Body section, paste the following JSON, replacing your_integration_id with 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.

  6. Click Run Test to send a sample request and confirm the connection works.

  7. In the test response, click the answer field 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 answer variable 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.

  1. Go to Settings > Rules & Macros.
  2. Click Create New Rule and select Create Linear Rule.
  3. As the trigger, select Inbound message is received (new conversation).
  4. 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.
  5. Click Add Action and select Send App Request:
    • Choose the Kapa Connector app you created.
    • In the query field, 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.
  6. Click Add Action again and select Add Comment. In the body of the comment, insert the App Request variable, which contains the answer from Kapa. This posts the draft as a comment on the conversation thread, visible to your team before anything is sent.
  7. 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.

  1. Navigate to Customizations (under Configuration in the sidebar) and create a new customization. Give it a name, for example Front drafts.
  2. 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."
  3. Check the preview panel on the right, which shows the system instructions with your changes applied.
  4. 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 answer as its output.
  • Created a rule that runs the app on every new inbound conversation and posts the draft as a comment.

Next steps