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

# Call your backend from a funnel step and use photo uploads

> Send answers and uploaded photos from a Funeli step to your HTTPS backend, save the response into answers, branch on it, and pass a session id to checkout.

A step hook lets a funnel talk to your own backend in the middle of the quiz: Funeli sends the answers you choose to your HTTPS endpoint, waits for the response, saves fields from it into the visitor's answers, and then continues, so later steps can branch on or display the result. Combined with photo uploads, this powers flows such as a face or skin analysis before the paywall.

## How a hook works

1. The visitor finishes a step that has a hook.
2. Funeli sends a `POST` to your URL with the funnel, step and session ids and the answers you listed.
3. Funeli waits for the response (15 seconds by default) and copies the response fields you mapped into answers.
4. The step's rules run, so you can branch on the saved values.

Only `https` URLs that resolve to public addresses are called. Choose what happens on an error: continue the funnel, or stay on the step with an error message and a retry.

> [!NOTE]
>
> Hooks are set up through an AI agent, for example "add a hook to the photo step that sends photo\_url to [https://api.example.com/scan](https://api.example.com/scan) and saves result.label as face\_shape". The editor does not have a hook form yet.

## Photo upload, analysis and branching

**1. Upload step**

Add a form step with a file upload (camera or gallery), a consent checkbox and a button. For face photos, set a minimum image size and require exactly one face; the face check runs on the visitor's device before the upload.

**2. Hook**

Add a hook to that step that sends the photo URL to your endpoint and saves the result, for example a face shape, into an answer.

**3. Loader for long processing**

For processing that takes longer, put the hook on a loader step with a progress bar; it moves on when both the bar and the hook are done.

**4. Branch on the result**

Add rules on the next step, such as "face\_shape exists" or "face\_shape equals oval".

## Connect the session to payment

Each funnel session has a server-owned id, available as `{{runtime_id}}`. Pass it, or an id your hook returned, to Paddle as custom data in the funnel's **Settings**, **Payments** section (Paddle custom data), and to your web app in the [web handoff](https://docs.funeli.top/guides/app-handoff.md#web-handoff). Your backend can then match the upload, the payment and the user.

> [!WARNING]
>
> Custom data and redirect parameters identify a session; they are not proof of payment. Grant access only after your backend verifies the purchase, from the provider's signed webhook or the web handoff token exchange.


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