> ## Documentation Index
> Fetch the complete documentation index at: https://docs.carescale.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> These guides connect a treatment facility's website forms to Carescale. Each facility has one website forms endpoint: an endpoint address and a secret, both copied from Carescale under Settings, Website forms.
> Send every submission as an HTTPS POST with a JSON body and the header Authorization: Bearer <secret>. Use the endpoint address exactly as Carescale shows it. Never put it behind a redirect or a proxy that redirects.
> Keep the secret out of committed code and out of client-side JavaScript. Put it in wp-config.php or a server-side environment setting.
> Gravity Forms Elite and Nonprofit licenses can use the Webhooks Add-On with no code. Basic and Pro licenses use the snippet. Any other form tool follows the payload contract on the Other form tools page.
> Never use real patient or client details in examples, logs or test submissions. Use made-up names, the 555 phone range and example.com addresses.
> Labels in bold match the Carescale app and Gravity Forms exactly. Quote them as written.

# Gravity Forms Webhooks Add-On

> Connect a Gravity Forms form to Carescale with the Webhooks Add-On, on an Elite or Nonprofit license, with no code.

The Webhooks Add-On comes with Gravity Forms **Elite** and **Nonprofit** licenses. On a Basic or Pro license, use the [snippet](/website-forms/gravity-forms-snippet) instead.

You need the **Endpoint address** and the secret from the facility's Carescale admin. See [Website forms](/website-forms) for where those come from.

## Before you start

* Install and activate the **Webhooks Add-On** from **Forms**, then **Add-Ons**.
* Work through the [privacy checklist](/website-forms/privacy-checklist) for each form.
* Make sure the site's background tasks run. Gravity Forms sends webhooks from a background request the site makes to itself. If those requests fail, the site sends only on its 5-minute WordPress cron, so a quiet site can deliver hours late. Check **Forms**, then **System Status**, for background task warnings.

## Add the feed

Add one feed to every form that should create leads.

<Steps>
  <Step title="Open the form's webhooks">
    Open the form, then **Settings**, then **Webhooks**, then **Add New**.
  </Step>

  <Step title="Name it and set the address">
    Set **Name** to `Carescale`. Paste the **Endpoint address** into **Request URL** exactly as Carescale shows it, starting with `https://`. Don't add a trailing slash or a query string.
  </Step>

  <Step title="Set the method and format">
    Set **Request Method** to `POST` and **Request Format** to `JSON`.
  </Step>

  <Step title="Add the Authorization header">
    Under **Request Headers**, add one row. Choose `Authorization` as the name, or add it as a custom key, and set the value to `Bearer `, followed by the secret.

    ```text theme={null}
    Authorization: Bearer wfs_your_secret_here
    ```
  </Step>

  <Step title="Choose the request body">
    Set **Request Body** to **Select Fields** and map the fields as described below. **All Fields** also works, but it sends field numbers with no labels, so the Carescale admin has to match every field by hand.
  </Step>

  <Step title="Save">
    Leave **Webhook Condition** off, so every submission is sent, and save the feed.
  </Step>
</Steps>

## Map the fields

With **Select Fields**, each row has a key you type and a form field or entry property. Use the keys below exactly as written: Carescale links each one to its lead field as soon as the form's first submission arrives, so even that first lead fills in. Any other key is turned into a label, so `date_of_birth` reads "Date of birth", and the Carescale admin confirms its link under **Review**.

| Key | Map to |
| - | - |
| `first_name`, `last_name` | The Name field's First and Last inputs |
| `phone` | Phone |
| `email` | Email |
| `message` | "How can we help?" or any free-text message |
| `who_for` | "Who is this for?" (myself, a loved one, a client I'm referring) |
| `your_first_name`, `your_last_name`, `relationship` | The person filling in the form, when it's for someone else |
| `preferred_contact`, `best_time` | How and when to reach them |
| `text_consent` | An "OK to text me" consent field |
| `insurance`, `member_id` | The insurance carrier and member ID |
| `insurance_card_front`, `insurance_card_back` | File upload fields for insurance card photos |
| `utm_source`, `utm_medium`, `utm_campaign`, `utm_term`, `utm_content`, `gclid`, `landing_page` | Hidden fields that capture campaign tracking. See [Other form tools](/website-forms/other-form-tools#campaign-tracking). |

Add these entry properties too, so Carescale can name the form, ignore repeats and place uploads:

| Key | Map to |
| - | - |
| `entry_id` | Entry ID |
| `form_id` | Form ID |
| `form_title` | Custom value `{form_title}` |
| `date_created` | Entry Date |
| `source_url` | Source URL |

<Warning>
  Map an **Address** field one input at a time: `street` to the street address input, `city` to City, `state` to State, and `zip` to ZIP code. A whole Address field is sent as one joined line that Carescale can't split.
</Warning>

With **Select Fields**, only the insurance card keys are downloaded into the lead. Any other upload arrives as a link that stays on the lead. If the form collects other documents, use the [snippet](/website-forms/gravity-forms-snippet), which downloads every upload field.

<Frame caption="A form's field links in Carescale (sample data)">
  <img src="https://mintcdn.com/carescale/3KN7i8IrZfoLs_1O/images/website-forms/form-field-links.png?fit=max&auto=format&n=3KN7i8IrZfoLs_1O&q=85&s=8e8b15684986efb8e81b7932a1820552" alt="The form sheet in Carescale showing each field with a Suggested or Review link." width="698" height="810" data-path="images/website-forms/form-field-links.png" />
</Frame>

Fields you don't map aren't sent. Anything Carescale can't match to a lead field is still kept, word for word, on the lead.

## How Gravity Forms sends

* **One attempt, no retries.** Gravity Forms sends each entry once. When Carescale refuses a delivery, Gravity Forms still notes it as sent and never tries again. The Carescale card shows the refusal under **Last rejected delivery**.
* **A 5-second limit.** Carescale answers within well under a second. A network failure pauses the site's webhook queue for a few minutes and drops that entry.
* **Spam isn't sent.** An entry Gravity Forms flags as spam is never sent. If you later mark it **Not Spam**, Gravity Forms sends it then, once.
* **Late deliveries keep their time.** An entry that waited in the queue arrives with its original submission time, and Carescale uses that time on the lead.

## Test it

1. Submit the form on the live site with made-up details: a 555 phone number and an `example.com` email.
2. In WordPress, open the entry under **Forms**, then **Entries**. Its notes should read "Webhook sent. Response code: 200."
3. In Carescale, the card reads **Receiving**, the form appears in the forms list, and a new lead is at New.
4. Clear the test lead with **Not an inquiry**.

Any other response code is explained in [Troubleshooting](/website-forms/troubleshooting).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.