For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
HomepageProduct HelpLog inTry for Free
Developers HomeAPI ReferenceMCP
Developers HomeAPI ReferenceMCP
  • Getting Started
    • Introduction
    • Authentication with API Keys
    • Authentication with OAuth
    • API Clients
    • Pagination
    • Specifying Fields
    • Filter Parameters
    • HTTP Response Codes
    • Rate Limits
    • Timezone Offsets
    • Rich Text Fields
    • Changelog
  • CRM Core
    • Leads
    • Contacts
    • Opportunities
    • Tasks
    • Files
    • Custom Objects
    • Comments
  • Activities
    • Activities
    • Notes
    • Calls
    • Emails
    • Email Threads
    • WhatsApp Messages
    • Meetings
    • Custom Activities
    • Creations
    • Form Submissions
    • Lead Status Changes
    • Opportunity Status Changes
    • Lead Merges
    • Task Completions
  • Events & Webhooks
    • Webhooks
      • Webhook Filters
      • GETList Webhook subscriptions
      • POSTCreate new Webhook subscription
      • GETRetrieve a single Webhook subscription
      • PUTUpdate existing Webhook subscription
      • DELDelete Webhook subscription
    • Events
  • Search & Reporting
    • Advanced Filtering
    • Smart Views
    • Reporting
  • Automation & Bulk Actions
    • Sequences (Workflows)
    • Bulk Actions
    • Exports
    • AI Field Enrichment
  • CRM Configuration
    • Custom Fields
    • Custom Activity Types
    • Custom Object Types
    • Pipelines
    • Opportunity Statuses
    • Lead Statuses
    • Integration Links
    • Forms
  • Communication Configuration
    • Email Templates
    • SMS Templates
    • Outcomes
    • Playbooks
    • Scheduling Links Guide
    • Scheduling Links
    • Connected Accounts
    • Send As
    • Unsubscribed Emails
    • Phone Numbers
    • Blocked Phone Numbers
    • Dialers
  • Users & Organizations
    • Users
    • Organizations
    • Memberships
    • Roles
    • Groups
Close

Product

OverviewCommunicationAutomationIntegrationsReportingSMSCallingSecurityForms

Pricing & Use Cases

PricingClose vs Other CRMsCustomer Stories

Resources

Sales BlogSales ResourcesSales GuidesWebinarsOn-Demand DemoSales Tools

Company

AboutCareersPartner with CloseBrand GuidelinesTermsPrivacyGDPRCCPA

Get Help

+1-833-GO-CLOSEHelp CenterDownload the Close AppProduct UpdatesSystem Status
LogoLogo
HomepageProduct HelpLog inTry for Free
On this page
  • Examples
Events & WebhooksWebhooks

Webhook Filters

Use JSON event filters to apply advanced filtering logic to webhook subscriptions.
||View as Markdown|
Was this page helpful?
Edit this page
Previous

Webhooks

Next

List Webhook subscriptions

Built with

More advanced event filtering can be achieved by specifying event filters when creating/modifying a webhook subscription. For a webhook to be fired the event must match these extra filters as well as the specified object_type and action values.

Event filters use JSON to specify filtering conditions on event fields. The following filter operators can be combined to apply sophisticated filtering logic.

  • Equals: {"type": "equals", "value": "<value>"} This filter matches only if the entire value is the same as provided.
  • Not Equals: {"type": "not_equals", "value": "<value>"} This filter matches only if the value does not match what is provided.
  • Is Null: {"type": "is_null"} This filter matches only if the value of the specified field is null.
  • Non Null: {"type": "non_null"} This filter matches only if the value of the specified field is non-null.
  • Contains: {"type": "contains", "value": "<value>"} This searches for a particular value in an array. It can also be used to match a partial string for string fields.
  • And: {"type": "and", "filters": [<filter1>, <filter2>, ...]} This matches when all provided individual filters match.
  • Or: {"type": "or", "filters": [<filter1>, <filter2>, ...]} This matches when one or more provided individual filters match.
  • Not: {"type": "not", "filter": <some other filter>} This matches when the provided filter does not match.

The matching operators above can be applied to individual parts of the event using these two methods of accessing field values:

  • Field Accessor: {"type": "field_accessor", "field": "<field name>", "filter": <some other filter>} This filter allows you to access a specific field in a JSON document and match this field’s value against the specified filter.
  • Any value in an array: {"type": "any_array_value", "filter": <some other filter>} This searches for any matching values inside a JSON list/array.

Examples

user_id string field of an event equals user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA

1{
2 "type": "field_accessor",
3 "field": "user_id",
4 "filter": {
5 "type": "equals",
6 "value": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA"
7 }
8}

Drill into event to match user_id of the data object to match events created by user user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA

1{
2 "type": "field_accessor",
3 "field": "data",
4 "filter": {
5 "type": "field_accessor",
6 "field": "user_id",
7 "filter": {
8 "type": "equals",
9 "value": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA"
10 }
11 }
12}

Match events not created by user user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA

1{
2 "type": "field_accessor",
3 "field": "data",
4 "filter": {
5 "type": "field_accessor",
6 "field": "user_id",
7 "filter": {
8 "type": "not",
9 "filter": {
10 "type": "equals",
11 "value": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA"
12 }
13 }
14 }
15}

You can also use not_equals as a filter type in this case:

1{
2 "type": "field_accessor",
3 "field": "data",
4 "filter": {
5 "type": "field_accessor",
6 "field": "user_id",
7 "filter": {
8 "type": "not_equals",
9 "value": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA"
10 }
11 }
12}

Match events where the user_id field is non-null

1{
2 "type": "field_accessor",
3 "field": "user_id",
4 "filter": {
5 "type": "non_null"
6 }
7}

Match events for leads with string travel in the name (e.g. ‘Bluth travel company’, case sensitive)

1{
2 "type": "field_accessor",
3 "field": "data",
4 "filter": {
5 "type": "field_accessor",
6 "field": "name",
7 "filter": {
8 "type": "contains",
9 "value": "travel"
10 }
11 }
12}

Match events for leads that had their name changed. This uses a contains filter because changed_fields is an array of field names.

1{
2 "type": "field_accessor",
3 "field": "changed_fields",
4 "filter": {
5 "type": "contains",
6 "value": "name"
7 }
8}

Match events for leads that had their name or description changed

1{
2 "type": "field_accessor",
3 "field": "changed_fields",
4 "filter": {
5 "type": "or",
6 "filters": [
7 {
8 "type": "contains",
9 "value": "name"
10 },
11 {
12 "type": "contains",
13 "value": "description"
14 }
15 ]
16 }
17}

Match events that have two custom fields set to specific values

1{
2 "type": "and",
3 "filters": [
4 {
5 "type": "field_accessor",
6 "field": "data",
7 "filter": {
8 "type": "field_accessor",
9 "field": "custom.cf_rR9HjgjI4SYy1X1IlMOozK2VkxMgU5NnHquTR8DVxoQ",
10 "filter": {
11 "type": "equals",
12 "value": "product_1234"
13 }
14 }
15 },
16 {
17 "type": "field_accessor",
18 "field": "data",
19 "filter": {
20 "type": "field_accessor",
21 "field": "custom.cf_vwqYhEFwzPyfCErS8uQ77is1wFLvr9BgVi6cTfbFM48",
22 "filter": {
23 "type": "equals",
24 "value": "sub_product_5678"
25 }
26 }
27 }
28 ]
29}

Use any_array_value to match events that have any address in Maryland, USA

1{
2 "type": "field_accessor",
3 "field": "data",
4 "filter": {
5 "type": "field_accessor",
6 "field": "addresses",
7 "filter": {
8 "type": "any_array_value",
9 "filter": {
10 "type": "and",
11 "filters": [
12 {
13 "type": "field_accessor",
14 "field": "state",
15 "filter": {
16 "type": "equals",
17 "value": "MD"
18 }
19 },
20 {
21 "type": "field_accessor",
22 "field": "country",
23 "filter": {
24 "type": "equals",
25 "value": "US"
26 }
27 }
28 ]
29 }
30 }
31 }
32}