Zapier
The Zapier integration connects FilaForms to 7,000+ apps using the Automation API. When a form is submitted, data is instantly sent to all connected Zaps via REST Hook subscriptions.
How It Works
- You create a private Zapier app on the Zapier Developer Platform
- Users connect their account via OAuth (click "Connect", authorize, done)
- Zapier subscribes to form events via the REST Hook API
- On form submission, FilaForms POSTs data to all subscribed webhook URLs
Prerequisites
Install Laravel Passport
Publish and run the Passport migrations:
php artisan vendor:publish --tag=passport-migrations
php artisan migrate
Generate encryption keys:
php artisan passport:keys
Configure the Auth Guard
Add the api guard with the passport driver to config/auth.php:
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
'api' => [
'driver' => 'passport',
'provider' => 'users',
],
],
Use Passport's HasApiTokens
Your User model must use Passport's trait (not Sanctum's):
use Laravel\Passport\HasApiTokens;
class User extends Authenticatable
{
use HasApiTokens;
}
Laravel\Sanctum\HasApiTokens, replace it with the Passport version. Both cannot be used simultaneously.Create an OAuth Client
First, complete Step 2 of the Zapier authentication setup to get the redirect URL. Then create the Passport client:
php artisan passport:client --name="Zapier" --redirect_uri="https://zapier.com/dashboard/auth/oauth/return/App{ID}CLIAPI/"
{ID} with your Zapier app ID from the URL on the Zapier Developer Platform.Note the Client ID and Client Secret from the output -- you'll need them for Step 3.
Add Environment Variables
ZAPIER_CLIENT_ID=your_client_id
ZAPIER_CLIENT_SECRET=your_client_secret
Zapier Developer Platform Setup
Create a new integration at developer.zapier.com, then configure the following:
herd share, Expose, or ngrok during development. Note that fwd.host will not work -- Zapier needs to make direct POST requests to your server, not just browser redirects.Authentication (OAuth v2)
In your Zapier app, go to Authentication and select OAuth v2.
Step 1 -- Configure Fields: Skip this step (no custom fields needed).
Step 2 -- Redirect URL: Copy the redirect URL -- you'll use it when creating the Passport client (see Prerequisites above).
Step 3 -- Application Credentials:
| Field | Value |
|---|---|
| Client ID | Your Passport client ID |
| Client Secret | Your Passport client secret |
Step 4 -- Endpoint Configuration:
| Setting | Method | URL |
|---|---|---|
| Authorization URL | GET | https://{domain}/oauth/authorize |
| Access Token Request | POST | https://{domain}/oauth/token |
| Refresh Token Request | (leave empty) | |
| Test | GET | https://{domain}/api/filaforms/automations/auth/test |
Set Scope to forms:read and check "Automatically refresh on unauthorized error".
Step 5 -- Test: Click Save & Continue, then click the Sign in button to connect an account. This opens the OAuth authorization page -- log in and approve access. A successful test returns:
{
"status": "authenticated",
"message": "API credentials are valid"
}
Create the Form List Trigger
Before creating the main trigger, create a helper trigger that powers the form dropdown.
Go to Triggers and create a new trigger:
| Setting | Value |
|---|---|
| Key | form_list |
| Name | Form List |
| Noun | Form |
| Description | Gets a list of forms |
| Type | Polling |
| Hidden | Yes |
Skip the Input Designer (no input fields needed).
In API Configuration, set the polling URL to:
GET https://{domain}/api/filaforms/automations/forms
Test to verify it returns your forms list, then save.
Create the New Form Submission Trigger
Go to Triggers and create a new trigger:
| Setting | Value |
|---|---|
| Key | new_submission |
| Name | New Form Submission |
| Noun | Submission |
| Description | Triggers when a new form submission is received |
| Type | REST Hook (instant) |
Input Designer: Add a form_id field so users can select which form to watch:
| Setting | Value |
|---|---|
| Key | form_id |
| Label | Form |
| Type | String |
| Required | Yes |
| Dropdown | Yes (Dynamic) |
| Dropdown Source | Form List |
| Field Name | id |
| Field Label | name |
Configure the REST Hook API
In the API Configuration for the New Form Submission trigger, select REST Hook as the trigger type. Switch each endpoint to Code Mode and use the following:
Subscribe (POST):
const options = {
url: 'https://{domain}/api/filaforms/automations/subscribe',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
},
body: {
'target_url': bundle.targetUrl,
'form_id': bundle.inputData.form_id,
'event': 'submission.created',
'platform': 'zapier'
}
};
return z.request(options)
.then((response) => {
response.throwForStatus();
return response.json;
});
Unsubscribe (DELETE):
const options = {
url: 'https://{domain}/api/filaforms/automations/unsubscribe/' + bundle.subscribeData.id,
method: 'DELETE',
headers: {
'Accept': 'application/json'
}
};
return z.request(options)
.then((response) => {
response.throwForStatus();
return response.json;
});
Perform List (GET):
const options = {
url: 'https://{domain}/api/filaforms/automations/submissions',
method: 'GET',
headers: {
'Accept': 'application/json'
},
params: {
'form_id': bundle.inputData.form_id
}
};
return z.request(options)
.then((response) => {
response.throwForStatus();
return response.json;
});
Leave the Perform function as default.
Save and test -- Zapier will create a test subscription and pull sample data from your forms.
API Endpoints
All endpoints require auth:api middleware (Laravel Passport):
| Method | Endpoint | Purpose |
|---|---|---|
POST | /api/filaforms/automations/subscribe | Subscribe to form events |
DELETE | /api/filaforms/automations/unsubscribe/{id} | Unsubscribe |
GET | /api/filaforms/automations/forms | List user's forms |
GET | /api/filaforms/automations/submissions | Poll recent submissions |
GET | /api/filaforms/automations/auth/test | Test authentication |
Payload Format
When a form is submitted, the following payload is sent to all subscribed webhook URLs:
{
"id": "01HX...",
"form_id": "01HX...",
"form_name": "Contact Form",
"submitted_at": "2025-01-15T10:30:00+00:00",
"field_name": "Jane Doe",
"field_email": "jane@example.com"
}
Each form field is included as field_{name} with its submitted value.
Other Automation Platforms
The same REST Hook API works with Make (Integromat) and n8n. The endpoints and payload format are identical -- only the platform's webhook management UI differs.