Skip to main content
FormBharo lets you turn any form — paper intake sheets, web surveys, clinical questionnaires — into a voice agent that asks questions out loud and saves the answers. This guide walks through the full process: mapping fields, adding a script, configuring conditional branches, and publishing.
1

Create a draft agent

Start by sending a POST /api/v1/agents request with at minimum a title and a questions array. The API returns a new agent in draft state along with its agent_id, which you’ll use in every subsequent request.
2

Map each field to a question type

Every question needs a response_type that tells FormBharo how to parse and store the caller’s spoken answer. Choose the type that matches the original form field.For single-select and multi-select, pass options as an array of strings. The agent reads the list aloud and maps the caller’s answer to the closest matching option.For number, omit number_format if the caller might say either integers or decimals; set it to "integer" or "decimal" when you know the expected format.
3

Add scripts

Scripts give the agent its opening and closing lines. Set them inside a scripts object on the agent body.
  • scripts.intro — What the agent says at the very start of the call, before the first question. Use this to greet the caller and explain the purpose of the call.
  • scripts.outro — What the agent says when all required questions have been answered and the call is complete.
  • scripts.outro_incomplete — What the agent says when the call ends before all questions are answered (for example, the caller hangs up early).
You cannot set outro_incomplete without also setting outro. Both must be present if you want to customise the incomplete ending.
4

Add conditional branches

Branches let you skip or show groups of questions based on a caller’s earlier answer. The flow works in two parts:
  1. Declare the branch — add an entry to the top-level branches array. Give it a unique id and a condition that references a question id and a rule.
  2. Tag questions — set branch_id on every question that belongs to the branch. Those questions are only asked if the condition evaluates to true at runtime.
A condition supports three fields:
present takes priority over equals. If both are set on the same condition, present is evaluated and equals is ignored.
Use equals to branch on a specific value (for example, only proceed if the caller answered “yes”). Use present to branch whenever the caller gave any answer at all, regardless of what it was.
5

Configure screening

Use end_call_values to end a call early when a caller gives a disqualifying answer. Supply an array of strings; if the agent records any of those exact values, it ends the call immediately and marks the conversation screened_out. Screened-out calls count as successes, not failures.
Screened-out calls appear in analytics separately from fully completed calls, so you can track the size of the disqualified cohort without it inflating your failure rate.
6

Publish

When your agent is ready, publish it with PUT /api/v1/agents/{agent_id}. Send the complete agent body — not just the changed fields — as the request body. The API validates the configuration and returns the published agent on success.
If validation fails, the API returns 400 with a validation_issues array describing each problem. Fix every issue before retrying — partial saves are not supported.

Preview changes before saving

Before you publish a new version, you can review exactly what will change by calling POST /api/v1/agents/{agent_id}/diff-preview with the proposed agent body. The response contains an array of diff lines, each with a type field: Use this endpoint in CI pipelines or review tools to catch unintended changes before they reach a live agent.
curl
See Agent Configuration for every field, Question Types for per-type options, and Branching for the full branch rules.