Skip to main content

Hooks API — Fields Reference

Written by Marcus Warren

This article describes all fields available through the Hooks API. Use it as a reference when creating, reading, or deleting webhook subscriptions.


Overview

The Hooks API lets you manage webhook subscriptions programmatically. A webhook subscription tells Envoke to send an HTTP POST to your endpoint whenever a specific event — a new contact, a form submission, an email open, or a lead activity — occurs in your account.

Each subscription has four fields: a unique ID, an event type, a destination URL, and an optional filter.

All endpoints require HTTP Basic Auth using your API ID and API Key.


Fields

Field

Type

Read-only

Required on Create

Description

id

string

Yes

Unique 32-character hex identifier assigned on creation.

type

string (enum)

Yes

Yes

The event type that triggers this subscription.

url

string (URI)

Yes

Yes

The destination URL that receives HTTP POST payloads.

filter

object

Yes

No

Optional key-value conditions that must match before delivery.

Note: All fields are immutable after creation. To change the type, url, or filter of an existing subscription, delete it and create a new one.


Field Details

id

  • Type: String

  • Read-only: Yes — assigned automatically on creation.

  • Format: 32-character lowercase hexadecimal string.

  • Example: "9f1c2a42baedb56c7e65b3eeaf1a8814"

Use this ID in GET /v1/hooks/{id}.json and DELETE /v1/hooks/{id}.json requests.


type

  • Type: String (enum)

  • Read-only: Yes — set at creation, cannot be updated.

  • Required on create: Yes

The event type that triggers delivery. Must be one of the following values:

Contact events

Value

Triggers when…

new_contact

A new contact is added to your account by any means.

consent_change

A contact's consent status changes.

Submission events

Value

Triggers when…

submission

Any form submission occurs (generic, covers all submission types below).

form_submission

A contact submits a website form.

preference_page_submission

A contact submits a preference page form.

api_submission

A contact is added or updated via the API.

import_submission

A contact is added via a list import.

ui_submission

A contact is added manually in the Envoke UI.

Email activity events

Value

Triggers when…

email_send

An email is sent to a contact.

email_open

A contact opens an email.

email_click

A contact clicks a link in an email.

email_autoresponder_send

An autoresponder email is sent to a contact.

Lead events

Value

Triggers when…

new_lead

A new lead is created.

passed_to_sales

A lead is passed to the sales team.

lead_update

A lead record is updated.

new_opportunity

An opportunity is created on a lead.

new_sale

A sale is recorded on a lead.


url

Envoke sends an HTTP POST to this URL when a matching event fires. Your endpoint should return an HTTP 2xx status to acknowledge delivery. On non-2xx responses, Envoke will retry once after 10 minutes. If your endpoint returns HTTP 410 (Gone), the subscription is automatically removed.


filter

  • Type: Object

  • Read-only: Yes — set at creation, cannot be updated.

  • Required on create: No — omit or pass {} to receive all events of the subscribed type.

  • Key type: String

  • Value type: Scalar (string, number, or boolean)

An optional set of key-value conditions. Before delivering an event, Envoke evaluates every key in the filter against the event payload. If all conditions match, the event is delivered. If any condition does not match, the event is silently skipped.

An empty object ({}) disables filtering — every event of the subscribed type is delivered.

Common filter keys by event type:

Event type(s)

Filter key

Description

form_submission, submission, preference_page_submission, api_submission, import_submission, ui_submission

form_id

Deliver only events from a specific form.

email_send, email_open, email_click, email_autoresponder_send

campaign_id

Deliver only events from a specific email campaign.

email_send, email_open, email_click, email_autoresponder_send

contact_remote_id

Deliver only events for a contact with a specific remote ID.

Example filter values:

{ "form_id": "abc123def456" }
{ "campaign_id": "789" }
{}

Error Responses

Validation errors (invalid request body):

{   "success": false,   "result_text": "Validation failed, see 'result_data' -> 'errors'",   "result_data": {     "errors": [       "'type' is required"     ]   } }

Duplicate subscription (same type and url already exists):

{   "success": false,   "result_text": "A webhook subscription with this type and URL already exists",   "result_data": {     "id": "9f1c2a42baedb56c7e65b3eeaf1a8814"   } }

result_data.id is the ID of the existing subscription.

Not-found behaviour by method:

  • GET /hooks/{id}.json — returns null when the ID is not found.

  • DELETE /hooks/{id}.json — returns success even when the ID does not exist (idempotent).


For code examples and interactive testing, visit api.envoke.com.

Did this answer your question?