App integration · All integrations

Connect Twilio to Formfy

Most teams collecting consent, intake, or liability waivers rely on email — then spend the next hour chasing a phone call when the client ignores the link. Clinic staff, fitness trainers, and agencies all share the same complaint: clients open texts, not emails. When a form needs to be signed before an appointment or service starts, email is the wrong channel. Every delay means a late start, a missed billing window, or a service that cannot legally proceed without that signature.

Formfy's API delivers forms directly to any phone number over SMS. When a client checks in or books an appointment, one API call dispatches the intake link by text. Pair Formfy webhooks with Twilio to fire confirmation messages the instant the form comes back signed.

The workflow at a glance

Trigger

A client books an appointment, checks in at the front desk, or enters a Twilio Studio flow

Action

Formfy dispatches the intake or consent form by SMS; a signed-form webhook fires back to Twilio

Result

Signed document lands in your Formfy dashboard before the appointment begins, with a Twilio confirmation SMS sent to staff

Step-by-step: connect Twilio to Formfy

Send Formfy intake and consent forms by SMS via the Formfy API, and trigger Twilio messages on signed-form webhook events.

  1. Generate a Formfy API key

    Open the Formfy dashboard, go to Settings → API Keys, and click Create key. Copy the fk_live_… token into a password manager — it is shown only once. Create a fk_test_… key for development so test sends do not consume live SMS credits while you wire up the integration.

  2. List your forms and note the form ID to send

    Call GET /api/v1/forms to retrieve every form in your account. Each record returns an id field — for example fm_abc123. Pick the intake or consent form you want to deliver by SMS and save its ID; you will pass it as the path parameter in the send step.

    GET/api/v1/formsSee in the OpenAPI spec →

  3. Send the form to a phone number via the API

    POST /api/v1/forms/{id}/send with the recipient's phone number in E.164 format and channel set to sms. Formfy dispatches the signing link by text within seconds. The recipient taps the link, completes the form on their phone, and adds their e-signature — no app download required.

    POST/api/v1/forms/{id}/sendSee in the OpenAPI spec →

  4. Subscribe to the form.signed webhook event

    POST /api/v1/webhooks with your Twilio Function URL as target_url and event_types set to ["form.signed"]. Formfy returns a signing secret — store it in a Twilio environment variable so your Function can verify the X-Formfy-Signature header on every delivery and reject any spoofed payloads.

    POST/api/v1/webhooksSee in the OpenAPI spec →

  5. Build a Twilio Function that fires on the signed-form event

    In Twilio Console, create a Function that receives the Formfy webhook payload, verifies the HMAC-SHA256 signature, and calls the Twilio Messages API to send a confirmation SMS to your staff or a follow-up text to the signer. The payload includes signer_email, signed_at, and the form submission_id for record lookup.

  6. Fetch the signed PDF if you need to attach or store it

    If your Twilio Function needs to reference the completed document, call GET /api/v1/forms/{id}/signed-pdf with the submission ID from the webhook payload. Formfy returns a short-lived download token; use GET /api/v1/files/pdf/{token} to pull the file and deliver it via MMS or route it to your document storage.

    GET/api/v1/forms/{id}/signed-pdfSee in the OpenAPI spec →

  7. Test end-to-end and rotate the webhook secret quarterly

    Send a test form to a real phone number, sign it, and confirm your Twilio Function fires and delivers the confirmation SMS. In production, POST /api/v1/webhooks/{id}/rotate-secret every quarter or on suspected credential exposure. Update the Twilio environment variable with the new secret — deliveries fail closed until both sides agree.

    POST/api/v1/webhooks/{id}/rotate-secretSee in the OpenAPI spec →

Send a Formfy intake form to a phone number via SMS

Dispatch the form link by text using the Formfy sendForm endpoint. Replace fm_abc123 with your form ID and supply the recipient's E.164 phone number.

curl -X POST https://formfy.ai/api/v1/forms/fm_abc123/send \
  -H "Authorization: Bearer fk_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "recipient_phone": "+15551234567",
    "channel": "sms",
    "message": "Hi — please sign your intake form before your appointment today."
  }'

Frequently asked questions

Does Formfy deliver forms via SMS natively, or do I need Twilio for that?

Formfy ships built-in SMS delivery — pass recipient_phone and channel: "sms" to POST /api/v1/forms/{id}/send and Formfy dispatches the link without any Twilio configuration on your end. Where Twilio adds value is downstream: firing confirmation texts to staff, routing inbound replies into a Studio flow, or triggering form sends from an existing IVR or appointment reminder automation.

How do I send a Formfy form to a phone number with the API?

POST /api/v1/forms/{id}/send with a JSON body containing recipient_phone in E.164 format (+15551234567) and channel set to sms. You can also include a custom message field to personalize the text. Formfy signs and delivers the link immediately; the recipient taps it, completes the form, and adds an e-signature entirely inside their mobile browser — no app install needed.

Can Twilio Studio trigger a Formfy form send automatically?

Yes. From a Twilio Studio flow or Twilio Function, make an HTTP Request widget call to POST /api/v1/forms/{id}/send with the contact's phone number and your Bearer token. This is the core pattern for appointment-reminder flows: when a contact enters the Studio flow — triggered by a booking event, CRM update, or inbound text — the flow immediately fires the intake form to their phone.

Which Formfy webhook events can trigger a Twilio SMS?

Five event types are available in v1: form.created, form.sent, form.viewed, form.signed, and form.expired. form.signed is the most common trigger — staff receive an instant confirmation the moment a client signs. form.expired is useful for re-engagement: when a form times out unsigned, your Twilio Function can send a follow-up text with a fresh link and a new expiry window.

How do I verify the Formfy webhook signature inside my Twilio Function?

Formfy includes an X-Formfy-Signature header on every webhook delivery, computed as HMAC-SHA256(secret, raw_body). In your Twilio Function, recompute the HMAC using the signing secret you received when you created the webhook subscription and compare it to the header value. Reject any request where the values do not match — this prevents spoofed payloads from triggering unwanted SMS sends.

Can I attach the signed PDF to a Twilio MMS after the form is completed?

Yes. When your Twilio Function receives the form.signed webhook, call GET /api/v1/forms/{id}/signed-pdf with the submission ID from the payload. Formfy returns a short-lived download token; fetch the PDF bytes via GET /api/v1/files/pdf/{token} and supply the URL as the media_url in a Twilio MMS. You can deliver the completed document to the signer or forward it to a staff member within seconds of signing.

What happens if the SMS signing link is never opened before the form expires?

Formfy fires a form.expired webhook event, which your Twilio Function can catch to send a follow-up SMS automatically. Create a fresh send via POST /api/v1/forms/{id}/send to regenerate the signing link and re-deliver it to the recipient's phone. You control the expiry window and how many re-send attempts you allow — there is no platform-level cap on redeliveries.

Does this integration work for clinic intake, fitness waivers, and agency contracts?

Yes — any Formfy form type (intake questionnaire, liability waiver, consent form, service agreement) can be delivered by SMS and signed on a mobile browser. Clinics use it for pre-appointment intake, gyms for injury-liability waivers before a first session, and agencies for client onboarding paperwork. The signed PDF is stored in Formfy and available any time via the dashboard or GET /api/v1/forms/{id}/signed-pdf.

Ready to wire Twilio into Formfy?

Spin up an API key, run your first webhook, and route signed forms wherever your team already works.