Zapier Webhook API Documentation

Overview

This API provides integration with Zapier for managing webhooks and retrieving recent leads. It supports actions such as subscribing to a webhook, unsubscribing from a webhook, and fetching recent leads.

Production Endpoint

The production endpoint is hosted on Firebase Cloud Functions.
GET https://zapierwebhook-qawek4gota-uc.a.run.app/

Request Parameters

ParameterTypeDescriptionRequired
zapierKeystringThe unique key used to identify the user in the database.Yes
actionstringThe action to be performed. Valid values: getRecentLeads, subscribeHook, unsubscribeHook.Yes
hookUrlstringThe URL for the webhook to be subscribed or unsubscribed (only required for subscribeHook and unsubscribeHook actions).No

Response Format

The API returns a JSON object containing the result of the request. The format of the response depends on the action performed.

Default Response

{
    "message": "Zapier Request Received",
    "user": "user_uid",
    "displayName": "User",
    "email": "user@example.com"
}

getRecentLeads Response

[
    {
        "name": "Lead Name",
        "email": "lead@example.com",
        "phone": "123-456-7890",
        "status": "Status",
        "type": "Type"
    },
    ...
]

subscribeHook Response

{
    "message": "Hook Url Saved",
    "hookUrl": "https://hookurl.com"
}

unsubscribeHook Response

{
    "message": "Hook Url Deleted",
    "hookUrl": "https://hookurl.com"
}

Error Handling

If an error occurs, the API will return a JSON object with a descriptive message.

{
    "message": "Zapier Key Not Found"
}