# lead.form_response_submitted

A Lead form was submitted.

Emitted for every submission, including the one that creates the Lead. A repeat submission from someone already in the pipeline emits only this event, because reusing an existing Lead does not change it and so does not emit `lead.updated`.

## Payload schema

- `object`
  - `api_version` (`any`)
  - `context` (`object`) - Present only when `source` is `api`. Identifies the acting project and API key.
    - `developer_platform_api_key_id` (`string | null`) - format: `uuid`
    - `developer_platform_project_id` (`string | null`) - format: `uuid`
  - `created_at` (`string`) - format: `date-time`; An ISO 8601 timestamp in UTC, with a `Z` suffix. For example, `2026-07-01T09:00:00Z`.
  - `data` (`object`)
    - `object` (`object`)
      - `answers` (`array`) - The questions and answers, in the order the respondent saw them. Layout blocks, hidden fields and the form's bot trap are omitted. A file upload question is omitted too; the uploaded files appear in the Lead's `attachments`.
        - `items` (`object`) - One question and its submitted answer, embedded in a FormResponse.
          - `field_name` (`string | null`) - The machine name of the question, for example `presenting_problem`. Match on this rather than on `label`, which an Organization can reword at any time.
          - `field_type` (`string | null`) - The kind of question asked, for example `text_area` or `date_field`. Use it to parse `value`.
          - `label` (`string`) - The question as it was shown to the respondent, with HTML sanitized. A question saved with no label returns an empty string.
          - `value` (`string | null`) - The submitted answer, always a string. A `date_field` returns an ISO 8601 date such as `1990-06-15`. A `consent_field` returns a UTC ISO 8601 timestamp. A `number_field` returns a decimal such as `12.5`. A `checkbox` returns `true` or `false`. A `dropdown` or `radio` returns the selected option's value, such as `both_knees`, not its display label. A `multiselect` returns null and uses `values` instead.
          - `values` (`array`) - The selected option values for a `multiselect` question, such as `["both_knees"]`. Empty for every other question type. Like `value`, these are option values rather than display labels, because a label is free text the Organization can reword at any time.
            - `items` (`string`)
      - `created_at` (`string`) - format: `date-time`; An ISO 8601 timestamp in UTC, with a `Z` suffix. For example, `2026-07-01T09:00:00Z`.
      - `form_name` (`string`) - The name of the form the respondent submitted.
      - `form_type` (`string`) - enum: `inquiry_form`, `referral_form`; Whether the submission came from an enquiry form or a referral form. This describes the form, not the Lead. A Lead whose `lead_type` is `referral` can still hold an `inquiry_form` submission.
      - `id` (`string`) - format: `uuid`; The resource's unique identifier, formatted as an RFC 4122 version 4 UUID.
      - `lead_id` (`string`) - format: `uuid`; The Lead the submission created or updated.
      - `links` (`object`) - URLs to related resources.
        - `lead` (`string`) - format: `uri`; The full URL of a related resource.
        - `self` (`string`) - format: `uri`; The full URL of a related resource.
      - `object` (`any`) - Discriminator value emitted at `object`.
      - `referral_notes` (`string | null`) - The referral notes captured with this submission. The Lead's own `referral_notes` is taken from its first submission that supplied one, so this can differ.
      - `referral_source` (`string | null`) - enum: `consultant`, `embassy`, `family_or_friend`, `gp_practice`, `hospital`, `insurance_company`, `physiotherapist`, `presentation_talk`, `previous_patient`, `private_practice`, `search_engine`, `self_referral`, `social_media`, `website`, `other`, `null`; How this submission reached the Organization. A form submitted on the Organization's website records `website`.
      - `referred_by_clinician_id` (`string | null`) - format: `uuid`; The Clinician who referred this submission, when one was identified.
      - `referred_by_organization_id` (`string | null`) - format: `uuid`; The Organization that referred this submission, when one was identified.
      - `submitted_at` (`string`) - format: `date-time`; An ISO 8601 timestamp in UTC, with a `Z` suffix. For example, `2026-07-01T09:00:00Z`.
      - `tracking` (`any`) - The marketing attribution captured with this submission.
      - `updated_at` (`string`) - format: `date-time`; An ISO 8601 timestamp in UTC, with a `Z` suffix. For example, `2026-07-01T09:00:00Z`.
  - `developer_platform_project_id` (`string | null`) - format: `uuid`; The project ID whose credential caused the change. Null for `dashboard` events.
  - `id` (`string`) - Event identifier prefixed with `evt_`.
  - `livemode` (`boolean`) - `false` for test-event deliveries.
  - `object` (`any`)
  - `source` (`string`) - enum: `api`, `dashboard`; Origin of the change. `api` means a Developer Platform mutation; `dashboard` means a Carebit-initiated change.
  - `type` (`any`)

### Example payload

```json
{
  "id": "evt_00000000-0000-4000-8000-000000000012",
  "object": "event",
  "api_version": "v1",
  "created_at": "2026-01-01T09:00:00Z",
  "data": {
    "object": {
      "id": "00000000-0000-4000-8000-000000000029",
      "object": "lead_form_response",
      "answers": [
        {
          "field_name": "first_name",
          "field_type": "text_field",
          "label": "First name",
          "value": "Test",
          "values": []
        },
        {
          "field_name": "presenting_problem",
          "field_type": "text_area",
          "label": "What is your main concern?",
          "value": "Persistent knee pain",
          "values": []
        },
        {
          "field_name": "affected_knee",
          "field_type": "radio",
          "label": "Which knee?",
          "value": "both_knees",
          "values": []
        }
      ],
      "created_at": "2026-01-01T09:00:00Z",
      "form_name": "Knee pain enquiry",
      "form_type": "inquiry_form",
      "lead_id": "00000000-0000-4000-8000-000000000013",
      "links": {
        "lead": "https://api.carebit.co/v1/leads/00000000-0000-4000-8000-000000000013",
        "self": "https://api.carebit.co/v1/lead_form_responses/00000000-0000-4000-8000-000000000029"
      },
      "referral_notes": "Referred by Dr Patel at Riverside Medical.",
      "referral_source": "gp_practice",
      "referred_by_clinician_id": null,
      "referred_by_organization_id": null,
      "submitted_at": "2026-01-01T09:00:00Z",
      "tracking": {
        "ad_id": null,
        "fbclid": null,
        "gad_campaign_id": null,
        "gad_source": null,
        "gbraid": null,
        "gclid": null,
        "landing_page_origin": "https://www.example.invalid",
        "utm_campaign": "knee-pain",
        "utm_content": null,
        "utm_medium": "cpc",
        "utm_source": "google",
        "utm_term": null
      },
      "updated_at": "2026-01-01T09:00:00Z"
    }
  },
  "developer_platform_project_id": null,
  "livemode": false,
  "source": "dashboard",
  "type": "lead.form_response_submitted"
}
```
