Home/Webhooks

Webhooks API

Subscribe to and manage form submission events via webhooks.

Overview

Minform's webhooks API allows you to subscribe to events such as new form submissions. When an event occurs, Minform will send an HTTP POST request to your specified URL with information about the event.

These webhooks are primarily used by Pipedream to trigger zaps when new form submissions are received.

Create Webhook Subscription

POSThttps://minform.io/api/pipedream/hooks

Subscribe to events for a specific form.

Request Body

ParameterTypeRequiredDescription
formIdStringYesThe slug identifier of the form to subscribe to
targetUrlStringYesThe URL to send webhooks to when events occur
eventStringNoThe event to subscribe to. Default: submission.created
{
  "formId": "contact-form",
  "targetUrl": "https://hooks.pipedream.com/hooks/catch/123456/abcdef/",
  "event": "submission.created"
}

Headers

HeaderRequiredDescription
AuthorizationYesBearer token for authentication. Format: Bearer <token>
Content-TypeYesMust be set to application/json

Response

The response contains details about the created webhook subscription:

{
  "id": "60a1b2c3d4e5f6g7h8i9j0k",
  "formId": "contact-form",
  "event": "submission.created",
  "targetUrl": "https://hooks.pipedream.com/hooks/catch/123456/abcdef/"
}
PropertyTypeDescription
idStringUnique identifier for the webhook subscription
formIdStringThe slug identifier of the subscribed form
eventStringThe event type subscribed to
targetUrlStringThe URL that will receive webhook notifications

Note: This endpoint requires the read:submissions scope.

Delete Webhook Subscription

DELETEhttps://minform.io/api/pipedream/hooks?hook_id=id

Unsubscribe from a previously created webhook subscription.

Query Parameters

ParameterTypeRequiredDescription
hook_idStringYesThe ID of the webhook subscription to delete

Headers

HeaderRequiredDescription
AuthorizationYesBearer token for authentication. Format: Bearer <token>

Response

The response indicates whether the deletion was successful:

{
  "success": true
}

Webhook Payload

When a form submission is created, Minform will send a webhook POST request to your specified URL with the following payload:

{
  "id": "submission_123456",
  "createdAt": "2023-08-01T12:00:00Z",
  "formId": "contact-form",
  "formName": "Contact Form",
  "fields": {
    "name": { 
      "value": "John Doe", 
      "label": "Name", 
      "type": "inputShort" 
    },
    "email": { 
      "value": "john@example.com", 
      "label": "Email", 
      "type": "inputEmail" 
    },
    "message": { 
      "value": "Hello! I'd like more information.", 
      "label": "Message", 
      "type": "inputLong" 
    }
  }
}

This payload matches the format returned by the form submissions API.

Error Responses

The API may return the following error responses:

Status CodeErrorDescription
400Bad RequestThe request was invalid or missing required fields
401UnauthorizedAuthentication failed or was not provided
403ForbiddenThe authenticated user doesn't have permission to access the form
404Not FoundThe specified form or webhook was not found
500Server ErrorAn error occurred on the server

Webhook Best Practices

  • Verify your webhooks: For security, validate that webhooks are coming from Minform.
  • Respond quickly: Your webhook endpoint should respond with a 2xx status code as quickly as possible.
  • Handle retries: Minform will retry failed webhook deliveries several times before giving up.
  • Process webhooks asynchronously: To avoid timeouts, process webhooks in the background after acknowledging receipt.