---
title: "Api Process Form Route Request"
method: POST
path: "/v1/embed/form/route"
tags: ["embed v1"]
---

# Api Process Form Route Request

`POST /v1/embed/form/route`

## Request

- Base URL: `https://api.branchly.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.branchly.io/v1/embed/form/route`
- Auth: none declared

## Headers

- `x-api-key` string, nullable

## Request body

- FormRouteRequest: Request for form routing (step 2). User received an answer but wants to submit a form.
  - `application_id` string, uuid, required
  - `session_id` string, uuid, required
  - `embed_type` 'chat' | 'search' | 'chat_widget' | 'search_interface' | 'voice' | 'api' | 'form', required
  - `locale` string, required
  - `browser_locale` string, nullable
  - `url` string, uri, nullable
  - `fields` FormInitFields, required
    - `email` string, email, required: The user's email address
    - `description` string, required: Description of user request that is used by agent to process the request.
  - `previous_answer` string, required: The answer from step 1 (form/init) that the user deemed insufficient.
  - `query` string: Synthetic query representing the user's intent to submit a form.

## Response `200`

Successful Response

- FormRouteResponse: Response for form routing endpoint. Contains the chosen form and agent's message.
  - `form` FormAPIOutput, required
    - `tool_id` string, required
    - `form_schema` FormAPISchema, required
      - `properties` union[], required
        - union
          - StringFieldAPI
            - `name` string, required
            - `description` string, nullable
            - `required` boolean
            - `field_type` 'string'
            - `format` 'text' | 'email' | 'tel': HTML input type
          - TextAreaFieldAPI
            - `name` string, required
            - `description` string, nullable
            - `required` boolean
            - `field_type` 'text_area'
            - `format` 'text': HTML input type
          - NumberFieldAPI
            - `name` string, required
            - `description` string, nullable
            - `required` boolean
            - `field_type` 'number'
            - `minimum` number, nullable
          - SelectFieldAPI
            - `name` string, required
            - `description` string, nullable
            - `required` boolean
            - `field_type` 'select'
            - `enum` string[], required
          - DateFieldAPI
            - `name` string, required
            - `description` string, nullable
            - `required` boolean
            - `field_type` 'date'
            - `format` 'date'
          - TimeFieldAPI
            - `name` string, required
            - `description` string, nullable
            - `required` boolean
            - `field_type` 'time'
            - `format` 'time'
          - CheckboxFieldAPI
            - `name` string, required
            - `description` string, nullable
            - `required` boolean
            - `field_type` 'checkbox'
    - `arguments` FormToolArguments, required
      - `object` 'form_tool_arguments'
      - `form_title` object, required
      - `submit_message` object, required
      - `submit_button_text` object, required
      - `show_data_privacy_text` boolean
      - `data_privacy_text` object, nullable: Optional data privacy text. If provided, a checkbox should be displayed to the user.
      - `notification_email` union: Used for email forwarding of form submissions. If not provided, no email will be forwarded
        - string, email
        - string[]
    - `values` object, required
  - `message` string, required: Agent's explanation of why this form was chosen.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/branchly/apis/branchly-io-api.md) · [All operations](https://skmtc.dev/branchly/apis/branchly-io-api/llms.txt) · [OpenAPI document](https://skmtc.dev/branchly/apis/branchly-io-api/revisions/9ffb024f8ec8?raw)
