Documentation
Webhooks
Send bookings, portal purchases, abandoned carts, leads and chat handoffs to your CRM in real time
Webhooks send PestBooker events to any URL you choose — your CRM, Zapier, a data warehouse — the moment they happen. Each event is a signed JSON POST. Booking events carry the customer, their plan and price, the office they routed to (with its Field Routes office ID), and where they came from (UTMs and ad click IDs); returning customers who book again send a new sale, and current customers who add a plan or warranty in your customer portal send a portal purchase. You can also get out-of-area leads and chats the AI assistant hands to your team. Retries are built in, so a brief outage on your side doesn’t lose events. Fields are only ever added, never renamed or removed, so a mapping you build today keeps working.
Requirements
- Admin access to your PestBooker organization
- An HTTPS endpoint that accepts a JSON POST (a Zapier "Catch Hook" works)
Choose your events
- Go to Dashboard → Integrations → Webhooks and turn on the events you want. Each event can go to its own URL.
- Abandoned cart (cart.abandoned): Fires after the delay you choose if the customer still hasn’t finished booking. Independent of staff email timing.
- Completed sale (sale.completed): Fires when payment succeeds, including any promo or referral code, for new and returning customers. On plans that require a signed agreement it fires at payment, before signing.
- Unsigned contract (contract.unsigned): Fires ~4 hours after checkout when a signature-gated booking is still unsigned — same moment as the “Awaiting signature” staff email.
- Signed contract (contract.signed): Fires when a customer signs a signature-gated booking and its FieldRoutes appointment is created, with the appointment ID.
- Out-of-service lead (lead.out_of_service): Fires when someone outside your service area leaves their contact details — same moment as the “Out-of-Service Lead” staff email.
- Conversation handed off (conversation.handoff): Fires when the AI assistant hands a chat, text, Thumbtack or Google Local Services conversation to your team — same moment as the “Sales Handoffs” or “Support Handoffs” staff email. Includes a summary and the latest messages.
- Conversation message (conversation.message): Fires for each message after a conversation is handed to your team: the customer writing again, or your team replying from PestBooker. Turn it on with “Conversation handed off” to keep the whole conversation in your CRM.
- Portal purchase (portal.purchase): Fires when a current customer adds a plan or a warranty add-on in your customer portal — same moment as the staff email for it.
- Booking request (booking.requested): Fires when online scheduling is briefly unavailable and the customer leaves their details or asks for preferred days instead of booking — same moment as the booking-request staff email.
- Plan cancelled online (subscription.cancelled): Fires when a customer cancels a plan they bought online, using “Click to cancel” in your customer portal — same moment as the staff email for it.
Send a test event
- Save your URLs first, then pick a Test event and press Send test event. It goes to that event’s saved URL. Once you have leads, you can test with one of your recent leads instead of sample data.
- Test events have the same shape as live ones, so you can finish mapping fields before any real booking comes in.
Verify the signature
- An admin can reveal and copy your signing secret on Integrations → Webhooks → Signing secret. Keep it on your server.
- Every request carries X-PestBooker-Event (the event name) and X-PestBooker-Signature (the hex HMAC-SHA256 of the raw request body, keyed with your signing secret).
- Compute the signature over the body exactly as received, before parsing it, and reject the request if it does not match.
Map the payload
- Answer with any 2xx status to mark the event delivered. Answer quickly: acknowledge the request first, then do any slow work.
- Integrations → Webhooks → Deliveries shows your recent deliveries and whether your endpoint accepted each one, and each event on Endpoints shows how its latest delivery went. An admin can resend a delivery — handy after you fix your endpoint. It goes to the event’s current URL, signed with your current secret. A delivery we’re still trying automatically, or an abandoned cart whose customer has since booked, can’t be resent.
- To tie a customer’s events together, use data.leadId where it is present, and fall back to email or phone: the lead ID can be null, and a customer who comes back in a new session can get a new one.
- A former customer who books again sends a new Completed sale with existing_customer set to true and their original FieldRoutes customer ID. Work and credit it like any new sale; only the FieldRoutes account is reused.
- A current customer who adds a plan or a warranty in your customer portal sends a Portal purchase instead. Record it as revenue from an existing customer rather than as a new lead.
Payload reference
Every event is a JSON POST with the fields below. We only ever add fields, so a mapping you build today keeps working. Because of retries, the same event can occasionally arrive more than once. Match on the event’s IDs (listed with each event in the payload reference) so a repeat doesn’t create a duplicate.
Every event
| Field | Type | Description |
|---|---|---|
event | string | The event name (also the X-PestBooker-Event header). |
companySlug | string | Your PestBooker account slug. |
occurredAt | string | When the event was first sent (ISO 8601). It stays the same when the event arrives again — whether we tried again automatically or an admin pressed Resend in Integrations → Webhooks. |
test | boolean (optional) | true on test events (Send test event in Integrations → Webhooks); absent on real events. |
data | object | The event’s fields, below. |
Abandoned cart cart.abandonedShowHide
Fires once per lead, after the delay you set (5–60 minutes), if the customer gave their contact details but hasn’t booked. If a send is delayed on our side, it still goes out — retries are built in — but never once the customer has booked. To skip duplicates, match on data.leadId (or the customer’s email when leadId is null).
| Field | Type | Description |
|---|---|---|
data.customer | object | The customer record as the booking form submitted it. It can carry more than the fields below (UTMs, promo codes) — use attribution for the marketing source. |
data.customer.customerID | string (optional) | FieldRoutes customer ID. |
data.customer.fname | string | First name. |
data.customer.lname | string | Last name. |
data.customer.email | string | Email. |
data.customer.phone1 | string | Phone (E.164). |
data.customer.address | string | Service street address. |
data.customer.city | string | City. |
data.customer.state | string | State. |
data.customer.zip | string | ZIP code. |
data.customer.notes | string (optional) | Notes from the form. |
data.resumeUrl | string | Link that reopens the booking where they left off ("" when unavailable). |
data.pests | string[] | Pests the customer selected. |
data.quote | object | null | The plan and price the customer was shown: planId, planName, cadence, treatmentsPerYear, initialPrice, originalInitialPrice, recurringPrice, recurringUnit, addOns[], recurringTotal, discountCode, referralCode, summary, quotedAt. |
data.leadId | string | null | PestBooker lead ID. Usually the same across one customer’s events, but not guaranteed: a customer who comes back in a new session can get a new lead, and it can be null. Fall back to email or phone when matching. |
data.lastStep | string | null | Furthest step reached: "contact" (contact details and address), "plan", "appointment", or "payment" (a payment was attempted). null when unknown. |
data.office | object | null | The office the customer was routed to (by ZIP). null for a single-office account, or when it can’t be determined. |
data.office.id | string | PestBooker office ID. |
data.office.name | string | Office name as set in PestBooker. |
data.office.fieldRoutesOfficeID | number | The FieldRoutes office ID. |
data.attribution | object | Where the customer came from, as captured on the lead. Every key is always present; a value that wasn’t captured is null. |
data.attribution.utm_source | string | null | utm_source |
data.attribution.utm_medium | string | null | utm_medium |
data.attribution.utm_campaign | string | null | utm_campaign |
data.attribution.utm_content | string | null | utm_content |
data.attribution.utm_term | string | null | utm_term |
data.attribution.gclid | string | null | Google Ads click ID. |
data.attribution.fbclid | string | null | Meta (Facebook) click ID. |
data.attribution.msclkid | string | null | Microsoft Ads click ID. |
data.attribution.wbraid | string | null | Google web-to-app click ID. |
data.attribution.gbraid | string | null | Google app-to-web click ID. |
data.attribution.rwg_token | string | null | Reserve with Google conversion token. |
data.attribution.landing_page | string | null | The page the booking form was opened on. |
data.attribution.referrer | string | null | The outside site that sent the visitor (e.g. https://www.google.com/). |
data.attribution.fr_source | object | null | The FieldRoutes customer source PestBooker created the customer with — the same source the office sees in FieldRoutes. Null when there is no FieldRoutes customer yet, or when PestBooker didn’t create them (a returning customer, or a portal purchase whose original lead can’t be found). |
data.attribution.fr_source.id | number | The FieldRoutes source ID. |
data.attribution.fr_source.name | string | null | The FieldRoutes source name (e.g. "Google Ads"); null when your default source was used. |
data.attribution.fr_source.channel | string | Where the customer came from in plain words (e.g. "Google Ads", "Direct / untagged"). Always present. |
data.attribution.promoter_first_name | string | null | The first name of the existing customer who referred them through your referral partner (Clicki). Null when they didn’t come through a referral link. Informational only: it is separate from your own referral program’s code and referrer credit, credits nobody and changes no price — your referral partner rewards its own promoter. |
Sample
{
"event": "cart.abandoned",
"companySlug": "your-company",
"occurredAt": "2026-09-01T16:00:00.000Z",
"data": {
"customer": {
"customerID": "163318",
"fname": "Test",
"lname": "Customer",
"email": "test@example.com",
"phone1": "+15555550123",
"address": "123 Test St",
"city": "San Diego",
"state": "CA",
"zip": "92129",
"notes": "Pests to focus on: Ants, Roaches",
"gclid": "TEST-GCLID-VALUE"
},
"resumeUrl": "https://getpestcontrol.services/resume/test",
"pests": [
"Ants",
"Roaches"
],
"quote": {
"planId": "quarterly",
"planName": "Quarterly Pest Control",
"cadence": "4 visits/year",
"treatmentsPerYear": 4,
"initialPrice": 149,
"originalInitialPrice": 199,
"recurringPrice": 99,
"recurringUnit": "visit",
"addOns": [
{
"label": "Mice and Rat Warranty",
"amount": 30,
"unit": "service"
}
],
"recurringTotal": 129,
"discountCode": "SAVE50",
"summary": "Quarterly Pest Control — $149 initial, then $129/visit, incl. Mice and Rat Warranty $30/service, code SAVE50",
"quotedAt": "2026-09-01T15:30:00.000Z"
},
"leadId": "3f0a6c2e-5b1d-4e8f-a7c9-0d2b4e6f8a10",
"lastStep": "plan",
"office": {
"id": "6f1c2b9e-0d4a-4c1e-9a53-2e8f7b1d0c11",
"name": "North County",
"fieldRoutesOfficeID": 2
},
"attribution": {
"utm_source": "google",
"utm_medium": "cpc",
"utm_campaign": "fall-ants",
"utm_content": "hero-cta",
"utm_term": "ant exterminator",
"gclid": "TEST-GCLID-VALUE",
"fbclid": null,
"msclkid": null,
"wbraid": null,
"gbraid": null,
"rwg_token": null,
"landing_page": "https://www.example-pest.com/ant-control?utm_source=google&utm_medium=cpc",
"referrer": "https://www.google.com/",
"fr_source": {
"id": 10014,
"name": "Google Ads",
"channel": "Google Ads"
},
"promoter_first_name": null
}
}
}Completed sale sale.completedShowHide
Fires when payment succeeds — the FieldRoutes customer and subscription exist at that point. One per FieldRoutes subscription: a returning customer who books again sends another, with existing_customer true and the same customerID. It also fires when someone who started on your booking page buys their first plan in the customer portal (channel "portal"); a current customer buying more in the portal sends portal.purchase instead. On plans that require a signed agreement, it still fires at payment: heldForSignature is true and the FieldRoutes appointment is created only after the customer signs (see contract.signed). A free inspection booked as a single visit has no subscription: subscriptionID is null, appointmentId names the visit and saleType is "standalone_visit". To skip duplicates, match on data.subscriptionID (for a single-visit free inspection, on data.appointmentId; otherwise fall back to data.customerID when it’s null).
| Field | Type | Description |
|---|---|---|
data.planType | string (optional) | Plan name. |
data.frequency | number (optional) | Services per year. |
data.value | number | Initial service charge. |
data.currency | string | Always "USD". |
data.transaction_id | string (optional) | FieldRoutes subscription ID. |
data.phone_number | string | Phone (E.164). |
data.email | string | Email. |
data.first_name | string | First name. |
data.last_name | string | Last name. |
data.source | string | "referral", "promo" or "direct". |
data.promo_code | string (optional) | Promo code used. |
data.promo_amount | number (optional) | Promo discount. |
data.referral_code | string (optional) | Referral code used. |
data.referrer_name | string (optional) | Who referred them. |
data.customerID | string | FieldRoutes customer ID. |
data.subscriptionID | string | null | FieldRoutes subscription ID (the same value as transaction_id). One sale.completed per subscription. null for a free inspection booked as a single visit (see saleType). |
data.appointmentId | string (optional) | FieldRoutes appointment ID of the visit, when the sale is a free inspection booked as a single visit with no subscription. transaction_id is then "appt:" plus this ID. |
data.saleType | string (optional) | "standalone_visit" when the sale is one FieldRoutes visit with no subscription (a free inspection). Absent for every plan sale. |
data.existing_customer | boolean | true when the FieldRoutes customer already existed before this sale — a former customer booking again. No new FieldRoutes account was created; treat it as a new sale. |
data.channel | string | "booker" (your booking page) or "portal" (someone who started on your booking page bought their first plan in the customer portal). |
data.pairedInspection | object (optional) | The free inspection the customer kept with this plan, when the plan offers one. It is its own visit on its own day, separate from the first service, and it is free. Only sent when there is one. |
data.pairedInspection.planId | string (optional) | PestBooker ID of the inspection plan. |
data.pairedInspection.planLabel | string (optional) | Inspection plan name, as it appears on your booking page. |
data.pairedInspection.requested | object | string (optional) | The time the customer asked for: { dateKey (YYYY-MM-DD), window ("morning" or "afternoon") }, or "call" when they asked your team to call and schedule it. A requested time is not a confirmed booking: if it can’t be booked, a note on the customer’s FieldRoutes record asks your team to call them instead. |
data.address | string | null | Service street address. |
data.city | string | null | City. |
data.state | string | null | State. |
data.zip | string | null | ZIP code. |
data.appointmentDate | string | null | Requested first-service date (YYYY-MM-DD). |
data.appointmentTime | string | null | "morning" or "afternoon". |
data.appointmentWindowStart | string | null | Arrival window start for that half-day ("08:00" or "12:00"). |
data.appointmentWindowEnd | string | null | Arrival window end ("12:00" or "17:00"). |
data.heldForSignature | boolean | null | true when the plan requires a signed agreement: paid, but the FieldRoutes appointment is created only after signing. null when we couldn’t tell. |
data.leadId | string | null | PestBooker lead ID. Usually the same across one customer’s events, but not guaranteed: a customer who comes back in a new session can get a new lead, and it can be null. Fall back to email or phone when matching. |
data.office | object | null | The office the customer was routed to (by ZIP). null for a single-office account, or when it can’t be determined. |
data.office.id | string | PestBooker office ID. |
data.office.name | string | Office name as set in PestBooker. |
data.office.fieldRoutesOfficeID | number | The FieldRoutes office ID. |
data.attribution | object | Where the customer came from, as captured on the lead. Every key is always present; a value that wasn’t captured is null. |
data.attribution.utm_source | string | null | utm_source |
data.attribution.utm_medium | string | null | utm_medium |
data.attribution.utm_campaign | string | null | utm_campaign |
data.attribution.utm_content | string | null | utm_content |
data.attribution.utm_term | string | null | utm_term |
data.attribution.gclid | string | null | Google Ads click ID. |
data.attribution.fbclid | string | null | Meta (Facebook) click ID. |
data.attribution.msclkid | string | null | Microsoft Ads click ID. |
data.attribution.wbraid | string | null | Google web-to-app click ID. |
data.attribution.gbraid | string | null | Google app-to-web click ID. |
data.attribution.rwg_token | string | null | Reserve with Google conversion token. |
data.attribution.landing_page | string | null | The page the booking form was opened on. |
data.attribution.referrer | string | null | The outside site that sent the visitor (e.g. https://www.google.com/). |
data.attribution.fr_source | object | null | The FieldRoutes customer source PestBooker created the customer with — the same source the office sees in FieldRoutes. Null when there is no FieldRoutes customer yet, or when PestBooker didn’t create them (a returning customer, or a portal purchase whose original lead can’t be found). |
data.attribution.fr_source.id | number | The FieldRoutes source ID. |
data.attribution.fr_source.name | string | null | The FieldRoutes source name (e.g. "Google Ads"); null when your default source was used. |
data.attribution.fr_source.channel | string | Where the customer came from in plain words (e.g. "Google Ads", "Direct / untagged"). Always present. |
data.attribution.promoter_first_name | string | null | The first name of the existing customer who referred them through your referral partner (Clicki). Null when they didn’t come through a referral link. Informational only: it is separate from your own referral program’s code and referrer credit, credits nobody and changes no price — your referral partner rewards its own promoter. |
Sample
{
"event": "sale.completed",
"companySlug": "your-company",
"occurredAt": "2026-09-01T16:00:00.000Z",
"data": {
"planType": "Quarterly Pest Control",
"frequency": 4,
"value": 199,
"currency": "USD",
"transaction_id": "48291",
"phone_number": "+15555550123",
"email": "test@example.com",
"first_name": "Test",
"last_name": "Customer",
"source": "promo",
"promo_code": "SAVE20",
"promo_amount": 20,
"referral_code": "jane10",
"referrer_name": "Jane Smith",
"customerID": "163318",
"subscriptionID": "48291",
"existing_customer": false,
"channel": "booker",
"pairedInspection": {
"planId": "plan_termite_inspection",
"planLabel": "Free Termite Inspection",
"requested": {
"dateKey": "2026-09-08",
"window": "afternoon"
}
},
"address": "123 Test St",
"city": "San Diego",
"state": "CA",
"zip": "92129",
"appointmentDate": "2026-09-03",
"appointmentTime": "morning",
"appointmentWindowStart": "08:00",
"appointmentWindowEnd": "12:00",
"heldForSignature": false,
"leadId": "3f0a6c2e-5b1d-4e8f-a7c9-0d2b4e6f8a10",
"office": {
"id": "6f1c2b9e-0d4a-4c1e-9a53-2e8f7b1d0c11",
"name": "North County",
"fieldRoutesOfficeID": 2
},
"attribution": {
"utm_source": "google",
"utm_medium": "cpc",
"utm_campaign": "fall-ants",
"utm_content": "hero-cta",
"utm_term": "ant exterminator",
"gclid": "TEST-GCLID-VALUE",
"fbclid": null,
"msclkid": null,
"wbraid": null,
"gbraid": null,
"rwg_token": null,
"landing_page": "https://www.example-pest.com/ant-control?utm_source=google&utm_medium=cpc",
"referrer": "https://www.google.com/",
"fr_source": {
"id": 10014,
"name": "Google Ads",
"channel": "Google Ads"
},
"promoter_first_name": null
}
}
}Unsigned contract contract.unsignedShowHide
Fires once per booking when a plan that requires a signed agreement is still unsigned about 4 hours after payment. To skip duplicates, match on data.subscriptionID.
| Field | Type | Description |
|---|---|---|
data.customerID | string | FieldRoutes customer ID. |
data.subscriptionID | string | FieldRoutes subscription ID. |
data.planType | string (optional) | Plan name. |
data.frequency | number (optional) | Services per year. |
data.value | number (optional) | Initial service charge. |
data.currency | string | Always "USD". |
data.recurringCharge | number (optional) | Per-service recurring charge. |
data.agreementLengthMonths | number (optional) | Agreement length in months. |
data.quote | object | null | The plan and price the customer was shown: planId, planName, cadence, treatmentsPerYear, initialPrice, originalInitialPrice, recurringPrice, recurringUnit, addOns[], recurringTotal, discountCode, referralCode, summary, quotedAt. |
data.phone_number | string | Phone (E.164). |
data.email | string | Email. |
data.first_name | string | First name. |
data.last_name | string | Last name. |
data.address | string (optional) | Service street address. |
data.city | string (optional) | City. |
data.state | string (optional) | State. |
data.zip | string (optional) | ZIP code. |
data.appointmentDate | string (optional) | Requested first-service date (YYYY-MM-DD). |
data.appointmentTime | string (optional) | "morning" or "afternoon". |
data.appointmentWindowStart | string (optional) | Arrival window start for that half-day ("08:00" or "12:00"). |
data.appointmentWindowEnd | string (optional) | Arrival window end ("12:00" or "17:00"). |
data.contractUrl | string | Link to sign the agreement. |
data.paidAt | string | When they paid (ISO 8601). |
data.heldForSignature | boolean | Always true. |
data.gclid | string (optional) | Google Ads click ID. |
data.fbclid | string (optional) | Meta click ID. |
data.msclkid | string (optional) | Microsoft Ads click ID. |
data.wbraid | string (optional) | Google web-to-app ID. |
data.gbraid | string (optional) | Google app-to-web ID. |
data.rwg_token | string (optional) | Reserve with Google token. |
data.leadId | string | null | PestBooker lead ID. Usually the same across one customer’s events, but not guaranteed: a customer who comes back in a new session can get a new lead, and it can be null. Fall back to email or phone when matching. |
data.office | object | null | The office the customer was routed to (by ZIP). null for a single-office account, or when it can’t be determined. |
data.office.id | string | PestBooker office ID. |
data.office.name | string | Office name as set in PestBooker. |
data.office.fieldRoutesOfficeID | number | The FieldRoutes office ID. |
data.attribution | object | Where the customer came from, as captured on the lead. Every key is always present; a value that wasn’t captured is null. |
data.attribution.utm_source | string | null | utm_source |
data.attribution.utm_medium | string | null | utm_medium |
data.attribution.utm_campaign | string | null | utm_campaign |
data.attribution.utm_content | string | null | utm_content |
data.attribution.utm_term | string | null | utm_term |
data.attribution.gclid | string | null | Google Ads click ID. |
data.attribution.fbclid | string | null | Meta (Facebook) click ID. |
data.attribution.msclkid | string | null | Microsoft Ads click ID. |
data.attribution.wbraid | string | null | Google web-to-app click ID. |
data.attribution.gbraid | string | null | Google app-to-web click ID. |
data.attribution.rwg_token | string | null | Reserve with Google conversion token. |
data.attribution.landing_page | string | null | The page the booking form was opened on. |
data.attribution.referrer | string | null | The outside site that sent the visitor (e.g. https://www.google.com/). |
data.attribution.fr_source | object | null | The FieldRoutes customer source PestBooker created the customer with — the same source the office sees in FieldRoutes. Null when there is no FieldRoutes customer yet, or when PestBooker didn’t create them (a returning customer, or a portal purchase whose original lead can’t be found). |
data.attribution.fr_source.id | number | The FieldRoutes source ID. |
data.attribution.fr_source.name | string | null | The FieldRoutes source name (e.g. "Google Ads"); null when your default source was used. |
data.attribution.fr_source.channel | string | Where the customer came from in plain words (e.g. "Google Ads", "Direct / untagged"). Always present. |
data.attribution.promoter_first_name | string | null | The first name of the existing customer who referred them through your referral partner (Clicki). Null when they didn’t come through a referral link. Informational only: it is separate from your own referral program’s code and referrer credit, credits nobody and changes no price — your referral partner rewards its own promoter. |
Sample
{
"event": "contract.unsigned",
"companySlug": "your-company",
"occurredAt": "2026-09-01T16:00:00.000Z",
"data": {
"customerID": "163318",
"subscriptionID": "48291",
"planType": "Quarterly Pest Control",
"frequency": 4,
"value": 149,
"recurringCharge": 99,
"agreementLengthMonths": 12,
"quote": {
"planId": "quarterly",
"planName": "Quarterly Pest Control",
"cadence": "4 visits/year",
"treatmentsPerYear": 4,
"initialPrice": 149,
"originalInitialPrice": 199,
"recurringPrice": 99,
"recurringUnit": "visit",
"addOns": [
{
"label": "Mice and Rat Warranty",
"amount": 30,
"unit": "service"
}
],
"recurringTotal": 129,
"discountCode": "SAVE50",
"summary": "Quarterly Pest Control — $149 initial, then $129/visit, incl. Mice and Rat Warranty $30/service, code SAVE50",
"quotedAt": "2026-09-01T15:30:00.000Z"
},
"currency": "USD",
"phone_number": "+15555550123",
"email": "test@example.com",
"first_name": "Test",
"last_name": "Customer",
"address": "123 Test St",
"city": "San Diego",
"state": "CA",
"zip": "92129",
"appointmentDate": "2026-09-03",
"appointmentTime": "morning",
"appointmentWindowStart": "08:00",
"appointmentWindowEnd": "12:00",
"contractUrl": "https://pestroutes.com/esign/example",
"paidAt": "2026-09-01T16:00:00.000Z",
"heldForSignature": true,
"gclid": "TEST-GCLID-VALUE",
"leadId": "3f0a6c2e-5b1d-4e8f-a7c9-0d2b4e6f8a10",
"office": {
"id": "6f1c2b9e-0d4a-4c1e-9a53-2e8f7b1d0c11",
"name": "North County",
"fieldRoutesOfficeID": 2
},
"attribution": {
"utm_source": "google",
"utm_medium": "cpc",
"utm_campaign": "fall-ants",
"utm_content": "hero-cta",
"utm_term": "ant exterminator",
"gclid": "TEST-GCLID-VALUE",
"fbclid": null,
"msclkid": null,
"wbraid": null,
"gbraid": null,
"rwg_token": null,
"landing_page": "https://www.example-pest.com/ant-control?utm_source=google&utm_medium=cpc",
"referrer": "https://www.google.com/",
"fr_source": {
"id": 10014,
"name": "Google Ads",
"channel": "Google Ads"
},
"promoter_first_name": null
}
}
}Signed contract contract.signedShowHide
Fires once per booking when the customer signs a plan that requires a signed agreement and the FieldRoutes appointment is created — whether they sign right after paying or later from the email link. Same fields as contract.unsigned, plus the appointment. To skip duplicates, match on data.subscriptionID.
| Field | Type | Description |
|---|---|---|
data.appointmentID | string | null | FieldRoutes appointment ID of the first service, created at signing. |
data.appointmentCreatedAt | string | When the FieldRoutes appointment was created after signing (ISO 8601). Usually within moments of signing; if they sign from the email link, it can be up to about an hour later. |
data.heldForSignature | boolean | Always false — the agreement is signed and the visit is booked. |
data.customerID | string | FieldRoutes customer ID. |
data.subscriptionID | string | FieldRoutes subscription ID. |
data.planType | string (optional) | Plan name. |
data.frequency | number (optional) | Services per year. |
data.value | number (optional) | Initial service charge. |
data.currency | string | Always "USD". |
data.recurringCharge | number (optional) | Per-service recurring charge. |
data.agreementLengthMonths | number (optional) | Agreement length in months. |
data.quote | object | null | The plan and price the customer was shown: planId, planName, cadence, treatmentsPerYear, initialPrice, originalInitialPrice, recurringPrice, recurringUnit, addOns[], recurringTotal, discountCode, referralCode, summary, quotedAt. |
data.phone_number | string | Phone (E.164). |
data.email | string | Email. |
data.first_name | string | First name. |
data.last_name | string | Last name. |
data.address | string (optional) | Service street address. |
data.city | string (optional) | City. |
data.state | string (optional) | State. |
data.zip | string (optional) | ZIP code. |
data.contractUrl | string | Link to sign the agreement. |
data.paidAt | string | When they paid (ISO 8601). |
data.gclid | string (optional) | Google Ads click ID. |
data.fbclid | string (optional) | Meta click ID. |
data.msclkid | string (optional) | Microsoft Ads click ID. |
data.wbraid | string (optional) | Google web-to-app ID. |
data.gbraid | string (optional) | Google app-to-web ID. |
data.rwg_token | string (optional) | Reserve with Google token. |
data.leadId | string | null | PestBooker lead ID. Usually the same across one customer’s events, but not guaranteed: a customer who comes back in a new session can get a new lead, and it can be null. Fall back to email or phone when matching. |
data.office | object | null | The office the customer was routed to (by ZIP). null for a single-office account, or when it can’t be determined. |
data.office.id | string | PestBooker office ID. |
data.office.name | string | Office name as set in PestBooker. |
data.office.fieldRoutesOfficeID | number | The FieldRoutes office ID. |
data.attribution | object | Where the customer came from, as captured on the lead. Every key is always present; a value that wasn’t captured is null. |
data.attribution.utm_source | string | null | utm_source |
data.attribution.utm_medium | string | null | utm_medium |
data.attribution.utm_campaign | string | null | utm_campaign |
data.attribution.utm_content | string | null | utm_content |
data.attribution.utm_term | string | null | utm_term |
data.attribution.gclid | string | null | Google Ads click ID. |
data.attribution.fbclid | string | null | Meta (Facebook) click ID. |
data.attribution.msclkid | string | null | Microsoft Ads click ID. |
data.attribution.wbraid | string | null | Google web-to-app click ID. |
data.attribution.gbraid | string | null | Google app-to-web click ID. |
data.attribution.rwg_token | string | null | Reserve with Google conversion token. |
data.attribution.landing_page | string | null | The page the booking form was opened on. |
data.attribution.referrer | string | null | The outside site that sent the visitor (e.g. https://www.google.com/). |
data.attribution.fr_source | object | null | The FieldRoutes customer source PestBooker created the customer with — the same source the office sees in FieldRoutes. Null when there is no FieldRoutes customer yet, or when PestBooker didn’t create them (a returning customer, or a portal purchase whose original lead can’t be found). |
data.attribution.fr_source.id | number | The FieldRoutes source ID. |
data.attribution.fr_source.name | string | null | The FieldRoutes source name (e.g. "Google Ads"); null when your default source was used. |
data.attribution.fr_source.channel | string | Where the customer came from in plain words (e.g. "Google Ads", "Direct / untagged"). Always present. |
data.attribution.promoter_first_name | string | null | The first name of the existing customer who referred them through your referral partner (Clicki). Null when they didn’t come through a referral link. Informational only: it is separate from your own referral program’s code and referrer credit, credits nobody and changes no price — your referral partner rewards its own promoter. |
data.appointmentDate | string (optional) | Booked first-service date (YYYY-MM-DD). |
data.appointmentTime | string (optional) | "morning" or "afternoon". |
data.appointmentWindowStart | string (optional) | Arrival window start ("08:00" or "12:00"). |
data.appointmentWindowEnd | string (optional) | Arrival window end ("12:00" or "17:00"). |
Sample
{
"event": "contract.signed",
"companySlug": "your-company",
"occurredAt": "2026-09-01T16:00:00.000Z",
"data": {
"customerID": "163318",
"subscriptionID": "48291",
"planType": "Quarterly Pest Control",
"frequency": 4,
"value": 149,
"recurringCharge": 99,
"agreementLengthMonths": 12,
"quote": {
"planId": "quarterly",
"planName": "Quarterly Pest Control",
"cadence": "4 visits/year",
"treatmentsPerYear": 4,
"initialPrice": 149,
"originalInitialPrice": 199,
"recurringPrice": 99,
"recurringUnit": "visit",
"addOns": [
{
"label": "Mice and Rat Warranty",
"amount": 30,
"unit": "service"
}
],
"recurringTotal": 129,
"discountCode": "SAVE50",
"summary": "Quarterly Pest Control — $149 initial, then $129/visit, incl. Mice and Rat Warranty $30/service, code SAVE50",
"quotedAt": "2026-09-01T15:30:00.000Z"
},
"currency": "USD",
"phone_number": "+15555550123",
"email": "test@example.com",
"first_name": "Test",
"last_name": "Customer",
"address": "123 Test St",
"city": "San Diego",
"state": "CA",
"zip": "92129",
"appointmentDate": "2026-09-03",
"appointmentTime": "morning",
"appointmentWindowStart": "08:00",
"appointmentWindowEnd": "12:00",
"contractUrl": "https://pestroutes.com/esign/example",
"paidAt": "2026-09-01T16:00:00.000Z",
"heldForSignature": false,
"gclid": "TEST-GCLID-VALUE",
"leadId": "3f0a6c2e-5b1d-4e8f-a7c9-0d2b4e6f8a10",
"office": {
"id": "6f1c2b9e-0d4a-4c1e-9a53-2e8f7b1d0c11",
"name": "North County",
"fieldRoutesOfficeID": 2
},
"attribution": {
"utm_source": "google",
"utm_medium": "cpc",
"utm_campaign": "fall-ants",
"utm_content": "hero-cta",
"utm_term": "ant exterminator",
"gclid": "TEST-GCLID-VALUE",
"fbclid": null,
"msclkid": null,
"wbraid": null,
"gbraid": null,
"rwg_token": null,
"landing_page": "https://www.example-pest.com/ant-control?utm_source=google&utm_medium=cpc",
"referrer": "https://www.google.com/",
"fr_source": {
"id": 10014,
"name": "Google Ads",
"channel": "Google Ads"
},
"promoter_first_name": null
},
"appointmentID": "771204",
"appointmentCreatedAt": "2026-09-01T18:12:00.000Z"
}
}Out-of-service lead lead.out_of_serviceShowHide
Fires when someone whose address is outside every office’s service area leaves their contact details — on your booking page or through the ChatGPT booking app (see source) — at the same moment as the “Out-of-Service Lead” staff email. It also fires, with reason "office_unavailable", when the ZIP is in an area you serve but its office can’t be determined, and with reason "commercial_not_offered" or "apartment_not_offered" when the address is a property type you don’t book online. No FieldRoutes customer is created, and office is always null. To skip duplicates, match on data.leadId (or the visitor’s email when leadId is null).
| Field | Type | Description |
|---|---|---|
data.customer | object | The visitor’s contact details and address as they entered them. |
data.customer.first_name | string | First name. |
data.customer.last_name | string | Last name. |
data.customer.email | string | Email. |
data.customer.phone_number | string | Phone (E.164). |
data.customer.address | string | Street address. |
data.customer.city | string | City. |
data.customer.state | string | State. |
data.customer.zip | string | ZIP code (outside your service area). |
data.pests | string[] | Pests the visitor selected; [] when none. |
data.leadId | string | null | PestBooker lead ID. Usually the same across one customer’s events, but not guaranteed: a customer who comes back in a new session can get a new lead, and it can be null. Fall back to email or phone when matching. |
data.office | null | Always null — no office matched (see reason). |
data.attribution | object | Where the customer came from, as captured on the lead. Every key is always present; a value that wasn’t captured is null. |
data.attribution.utm_source | string | null | utm_source |
data.attribution.utm_medium | string | null | utm_medium |
data.attribution.utm_campaign | string | null | utm_campaign |
data.attribution.utm_content | string | null | utm_content |
data.attribution.utm_term | string | null | utm_term |
data.attribution.gclid | string | null | Google Ads click ID. |
data.attribution.fbclid | string | null | Meta (Facebook) click ID. |
data.attribution.msclkid | string | null | Microsoft Ads click ID. |
data.attribution.wbraid | string | null | Google web-to-app click ID. |
data.attribution.gbraid | string | null | Google app-to-web click ID. |
data.attribution.rwg_token | string | null | Reserve with Google conversion token. |
data.attribution.landing_page | string | null | The page the booking form was opened on. |
data.attribution.referrer | string | null | The outside site that sent the visitor (e.g. https://www.google.com/). |
data.attribution.fr_source | object | null | The FieldRoutes customer source PestBooker created the customer with — the same source the office sees in FieldRoutes. Null when there is no FieldRoutes customer yet, or when PestBooker didn’t create them (a returning customer, or a portal purchase whose original lead can’t be found). |
data.attribution.fr_source.id | number | The FieldRoutes source ID. |
data.attribution.fr_source.name | string | null | The FieldRoutes source name (e.g. "Google Ads"); null when your default source was used. |
data.attribution.fr_source.channel | string | Where the customer came from in plain words (e.g. "Google Ads", "Direct / untagged"). Always present. |
data.attribution.promoter_first_name | string | null | The first name of the existing customer who referred them through your referral partner (Clicki). Null when they didn’t come through a referral link. Informational only: it is separate from your own referral program’s code and referrer credit, credits nobody and changes no price — your referral partner rewards its own promoter. |
data.source | string | "booking" (your booking page) or "chatgpt" (the ChatGPT booking app). |
data.reason | string | Why no office took the lead: "outside_service_area" (the address is outside every office’s area), "office_unavailable" (the ZIP is in an area you serve, but its office couldn’t be determined — check your offices’ service areas; the visitor is still a lead), "commercial_not_offered" or "apartment_not_offered" (the address is a commercial property or an apartment, and you don’t book that property type online — Settings → Booker). More codes may be added; treat an unknown one like "outside_service_area". |
Sample
{
"event": "lead.out_of_service",
"companySlug": "your-company",
"occurredAt": "2026-09-01T16:00:00.000Z",
"data": {
"customer": {
"first_name": "Test",
"last_name": "Customer",
"email": "test@example.com",
"phone_number": "+15555550123",
"address": "456 Sample Ave",
"city": "Yuma",
"state": "AZ",
"zip": "85364"
},
"pests": [
"Ants",
"Spiders"
],
"leadId": "3f0a6c2e-5b1d-4e8f-a7c9-0d2b4e6f8a10",
"office": null,
"attribution": {
"utm_source": "google",
"utm_medium": "cpc",
"utm_campaign": "fall-ants",
"utm_content": "hero-cta",
"utm_term": "ant exterminator",
"gclid": "TEST-GCLID-VALUE",
"fbclid": null,
"msclkid": null,
"wbraid": null,
"gbraid": null,
"rwg_token": null,
"landing_page": "https://www.example-pest.com/ant-control?utm_source=google&utm_medium=cpc",
"referrer": "https://www.google.com/",
"fr_source": {
"id": 10014,
"name": "Google Ads",
"channel": "Google Ads"
},
"promoter_first_name": null
},
"source": "booking",
"reason": "outside_service_area"
}
}Conversation handed off conversation.handoffShowHide
Fires each time the AI assistant hands a conversation to your team — website chat, text messages, the checkout assistant, customer portal chat, or a Thumbtack or Google Local Services message thread (see channel) — at the same moment as the “Sales Handoffs” or “Support Handoffs” staff email. It carries what your team needs to pick the conversation up without opening PestBooker: who should take it (team), a short summary and the latest messages. Portal handoffs come from existing customers. A Thumbtack or Google thread usually sends one handoff; a website, text, checkout or portal conversation can be handed off more than once. To skip duplicates of the same handoff, match on data.sessionId together with occurredAt.
| Field | Type | Description |
|---|---|---|
data.channel | string | "web" (website chat), "sms" (text message), "checkout" (the checkout assistant on your booking page), "portal" (customer portal chat), "thumbtack" (a Thumbtack message thread) or "lsa" (a Google Local Services message thread). New channels may be added. |
data.reason | string | Why it was handed off, as a stable code — map on this: "ai_handoff" (the assistant reached the limit of what it may answer), "ai_unapproved_claim" (answering would have meant a claim the assistant isn’t approved to make), "customer_requested" (the customer asked for a person), "auto_escalated" (handed off automatically after the set number of messages), "ai_disabled" (the assistant is turned off, so the conversation goes straight to your team), "call_requested" (the customer asked to be phoned), "missing_booking_link" (there was no booking link for the assistant to send) or "assistant_failed" (the assistant couldn’t answer, so the customer hasn’t had a reply yet — answer them first). New codes may be added; treat one you don’t know as a general handoff. |
data.reasonDetail | string | The reason in words, for display (e.g. "Auto-escalated after 5 customer messages"). "" when there is none. |
data.customer | object | Who the conversation is with. A value we don’t know is "" (e.g. a texter who never gave an email). |
data.customer.name | string | Name, or "". |
data.customer.phone_number | string | Phone (E.164), or "". |
data.customer.email | string | Email, or "". |
data.customerMessage | string | The customer’s message that led to the handoff. |
data.aiReply | string | null | What the assistant replied as it handed off; null when it didn’t reply. |
data.conversationUrl | string | Link to the conversation in your PestBooker dashboard (sign-in required). |
data.sessionId | string | The conversation’s ID. Store it with the lead in your CRM to match later events to it. A conversation handed off again later sends another event with the same sessionId. |
data.team | string | Who should take it: "service" when the customer is someone you already serve (a customer portal chat, a conversation matched to a FieldRoutes customer, or a lead who booked online), else "sales". |
data.fieldRoutesCustomerId | string | null | The FieldRoutes customer ID this conversation is tied to: the existing customer’s, or the one created when a prospect started checkout. null when there is none. |
data.summary | string | One or two sentences on what the customer wants and what they’ve been told, written for the person calling them back. When one can’t be written, it’s their request or their last message. |
data.recentMessages | object[] | The latest messages (up to 10), oldest first, each { id, at, from, text, channel }: from is "customer", "assistant" or "team"; at is ISO 8601; channel is where it was sent. A Thumbtack or Google handoff includes only that thread’s messages. A very long message is cut off, ending with “…”. |
data.marketplace | object | null | For a Thumbtack or Google Local Services conversation, { source, threadId }: source is "thumbtack" or "lsa", threadId is Thumbtack’s negotiation ID or Google’s lead ID. null otherwise. |
data.leadId | string | null | PestBooker lead ID. Usually the same across one customer’s events, but not guaranteed: a customer who comes back in a new session can get a new lead, and it can be null. Fall back to email or phone when matching. |
data.office | object | null | The office the conversation belongs to: the office whose number the customer texted, or the chat or portal customer’s office. null when unknown. |
data.office.id | string | PestBooker office ID. |
data.office.name | string | Office name as set in PestBooker. |
data.office.fieldRoutesOfficeID | number | The FieldRoutes office ID. |
data.attribution | object | Where the customer came from, as captured on the lead. Every key is always present; a value that wasn’t captured is null. |
data.attribution.utm_source | string | null | utm_source |
data.attribution.utm_medium | string | null | utm_medium |
data.attribution.utm_campaign | string | null | utm_campaign |
data.attribution.utm_content | string | null | utm_content |
data.attribution.utm_term | string | null | utm_term |
data.attribution.gclid | string | null | Google Ads click ID. |
data.attribution.fbclid | string | null | Meta (Facebook) click ID. |
data.attribution.msclkid | string | null | Microsoft Ads click ID. |
data.attribution.wbraid | string | null | Google web-to-app click ID. |
data.attribution.gbraid | string | null | Google app-to-web click ID. |
data.attribution.rwg_token | string | null | Reserve with Google conversion token. |
data.attribution.landing_page | string | null | The page the booking form was opened on. |
data.attribution.referrer | string | null | The outside site that sent the visitor (e.g. https://www.google.com/). |
data.attribution.fr_source | object | null | The FieldRoutes customer source PestBooker created the customer with — the same source the office sees in FieldRoutes. Null when there is no FieldRoutes customer yet, or when PestBooker didn’t create them (a returning customer, or a portal purchase whose original lead can’t be found). |
data.attribution.fr_source.id | number | The FieldRoutes source ID. |
data.attribution.fr_source.name | string | null | The FieldRoutes source name (e.g. "Google Ads"); null when your default source was used. |
data.attribution.fr_source.channel | string | Where the customer came from in plain words (e.g. "Google Ads", "Direct / untagged"). Always present. |
data.attribution.promoter_first_name | string | null | The first name of the existing customer who referred them through your referral partner (Clicki). Null when they didn’t come through a referral link. Informational only: it is separate from your own referral program’s code and referrer credit, credits nobody and changes no price — your referral partner rewards its own promoter. |
Sample
{
"event": "conversation.handoff",
"companySlug": "your-company",
"occurredAt": "2026-09-01T16:00:00.000Z",
"data": {
"channel": "thumbtack",
"reason": "ai_handoff",
"reasonDetail": "",
"customer": {
"name": "Test Customer",
"phone_number": "+15555550123",
"email": "test@example.com"
},
"customerMessage": "(Test) What are my options for the wasps? Can someone call me?",
"aiReply": "(Test) Let me get someone from our team to help with that.",
"conversationUrl": "https://pestbooker.com/docs/webhooks",
"sessionId": "test-session",
"leadId": "3f0a6c2e-5b1d-4e8f-a7c9-0d2b4e6f8a10",
"office": {
"id": "6f1c2b9e-0d4a-4c1e-9a53-2e8f7b1d0c11",
"name": "North County",
"fieldRoutesOfficeID": 2
},
"attribution": {
"utm_source": "google",
"utm_medium": "cpc",
"utm_campaign": "fall-ants",
"utm_content": "hero-cta",
"utm_term": "ant exterminator",
"gclid": "TEST-GCLID-VALUE",
"fbclid": null,
"msclkid": null,
"wbraid": null,
"gbraid": null,
"rwg_token": null,
"landing_page": "https://www.example-pest.com/ant-control?utm_source=google&utm_medium=cpc",
"referrer": "https://www.google.com/",
"fr_source": {
"id": 10014,
"name": "Google Ads",
"channel": "Google Ads"
},
"promoter_first_name": null
},
"team": "sales",
"fieldRoutesCustomerId": null,
"summary": "(Test) Wasp nest under the back deck; was sent the booking link and asked to talk to someone about options.",
"recentMessages": [
{
"id": "test-message-1",
"at": "2026-11-11T17:02:00.000Z",
"from": "customer",
"text": "(Test) There’s a wasp nest under our back deck.",
"channel": "thumbtack"
},
{
"id": "test-message-2",
"at": "2026-11-11T17:02:20.000Z",
"from": "assistant",
"text": "(Test) We can take care of that. Here’s a link to pick a time: https://pestbooker.com/docs/webhooks",
"channel": "thumbtack"
},
{
"id": "test-message-3",
"at": "2026-11-11T17:04:00.000Z",
"from": "customer",
"text": "(Test) What are my options for the wasps? Can someone call me?",
"channel": "thumbtack"
}
],
"marketplace": {
"source": "thumbtack",
"threadId": "test-thread"
}
}
}Conversation message conversation.messageShowHide
Fires for each message in a conversation after it’s handed to your team: every message the customer writes (on any channel, including Thumbtack and Google Local Services threads), and every reply your team sends from PestBooker — from the dashboard, or by replying to a PestBooker email. The assistant’s own replies aren’t sent. Use it with conversation.handoff to keep the whole conversation in your CRM: data.sessionId is the same as the handoff’s. It can also fire for a conversation your team took over in PestBooker without a handoff (handoffReason "human_takeover"), so create the conversation from data.sessionId when you haven’t seen it. Each message is delivered and retried on its own: one can arrive before its handoff or before an earlier message, so order them by data.message.at. To skip duplicates, match on data.sessionId together with data.message.id; message ids are the same as the handoff’s recentMessages ids.
| Field | Type | Description |
|---|---|---|
data.sessionId | string | The conversation’s ID — the same sessionId its conversation.handoff carried. Match on it to add the message to that conversation in your CRM. |
data.channel | string | The conversation’s channel, as in conversation.handoff: "web", "sms", "checkout", "portal", "thumbtack" or "lsa". |
data.team | string | Who should take it: "service" when the customer is someone you already serve (a customer portal chat, a conversation matched to a FieldRoutes customer, or a lead who booked online), else "sales". |
data.handoffReason | string | null | Why the conversation is with your team: a conversation.handoff reason code, or "human_takeover" when someone on your team took it over in PestBooker. null when unknown. |
data.message | object | The message: { id, at, from, text, channel, authorName, via }. from is "customer" or "team"; at is ISO 8601; channel is where it was sent; a very long message is cut off, ending with “…”. For a team reply, authorName is who sent it (null when unknown) and via is "email" (they replied to a PestBooker email) or "dashboard"; both are null on a customer message. |
data.customer | object | Who the conversation is with. A value we don’t know is "" (e.g. a texter who never gave an email). |
data.customer.name | string | Name, or "". |
data.customer.phone_number | string | Phone (E.164), or "". |
data.customer.email | string | Email, or "". |
data.fieldRoutesCustomerId | string | null | The FieldRoutes customer ID this conversation is tied to: the existing customer’s, or the one created when a prospect started checkout. null when there is none. |
data.marketplace | object | null | For a Thumbtack or Google Local Services conversation, { source, threadId }: source is "thumbtack" or "lsa", threadId is Thumbtack’s negotiation ID or Google’s lead ID. null otherwise. |
data.conversationUrl | string | Link to the conversation in your PestBooker dashboard (sign-in required). |
data.leadId | string | null | PestBooker lead ID. Usually the same across one customer’s events, but not guaranteed: a customer who comes back in a new session can get a new lead, and it can be null. Fall back to email or phone when matching. |
data.office | object | null | The office the conversation belongs to: the office whose number the customer texted, or the chat or portal customer’s office. null when unknown. |
data.office.id | string | PestBooker office ID. |
data.office.name | string | Office name as set in PestBooker. |
data.office.fieldRoutesOfficeID | number | The FieldRoutes office ID. |
data.attribution | object | Where the customer came from, as captured on the lead. Every key is always present; a value that wasn’t captured is null. |
data.attribution.utm_source | string | null | utm_source |
data.attribution.utm_medium | string | null | utm_medium |
data.attribution.utm_campaign | string | null | utm_campaign |
data.attribution.utm_content | string | null | utm_content |
data.attribution.utm_term | string | null | utm_term |
data.attribution.gclid | string | null | Google Ads click ID. |
data.attribution.fbclid | string | null | Meta (Facebook) click ID. |
data.attribution.msclkid | string | null | Microsoft Ads click ID. |
data.attribution.wbraid | string | null | Google web-to-app click ID. |
data.attribution.gbraid | string | null | Google app-to-web click ID. |
data.attribution.rwg_token | string | null | Reserve with Google conversion token. |
data.attribution.landing_page | string | null | The page the booking form was opened on. |
data.attribution.referrer | string | null | The outside site that sent the visitor (e.g. https://www.google.com/). |
data.attribution.fr_source | object | null | The FieldRoutes customer source PestBooker created the customer with — the same source the office sees in FieldRoutes. Null when there is no FieldRoutes customer yet, or when PestBooker didn’t create them (a returning customer, or a portal purchase whose original lead can’t be found). |
data.attribution.fr_source.id | number | The FieldRoutes source ID. |
data.attribution.fr_source.name | string | null | The FieldRoutes source name (e.g. "Google Ads"); null when your default source was used. |
data.attribution.fr_source.channel | string | Where the customer came from in plain words (e.g. "Google Ads", "Direct / untagged"). Always present. |
data.attribution.promoter_first_name | string | null | The first name of the existing customer who referred them through your referral partner (Clicki). Null when they didn’t come through a referral link. Informational only: it is separate from your own referral program’s code and referrer credit, credits nobody and changes no price — your referral partner rewards its own promoter. |
Sample
{
"event": "conversation.message",
"companySlug": "your-company",
"occurredAt": "2026-09-01T16:00:00.000Z",
"data": {
"sessionId": "test-session",
"channel": "thumbtack",
"team": "sales",
"handoffReason": "ai_handoff",
"message": {
"id": "test-message-4",
"at": "2026-11-11T17:09:00.000Z",
"from": "customer",
"text": "(Test) Any time after 5pm works for a call.",
"channel": "thumbtack",
"authorName": null,
"via": null
},
"customer": {
"name": "Test Customer",
"phone_number": "+15555550123",
"email": "test@example.com"
},
"fieldRoutesCustomerId": null,
"marketplace": {
"source": "thumbtack",
"threadId": "test-thread"
},
"conversationUrl": "https://pestbooker.com/docs/webhooks",
"leadId": "3f0a6c2e-5b1d-4e8f-a7c9-0d2b4e6f8a10",
"office": {
"id": "6f1c2b9e-0d4a-4c1e-9a53-2e8f7b1d0c11",
"name": "North County",
"fieldRoutesOfficeID": 2
},
"attribution": {
"utm_source": "google",
"utm_medium": "cpc",
"utm_campaign": "fall-ants",
"utm_content": "hero-cta",
"utm_term": "ant exterminator",
"gclid": "TEST-GCLID-VALUE",
"fbclid": null,
"msclkid": null,
"wbraid": null,
"gbraid": null,
"rwg_token": null,
"landing_page": "https://www.example-pest.com/ant-control?utm_source=google&utm_medium=cpc",
"referrer": "https://www.google.com/",
"fr_source": {
"id": 10014,
"name": "Google Ads",
"channel": "Google Ads"
},
"promoter_first_name": null
}
}
}Portal purchase portal.purchaseShowHide
Fires when a current customer buys more in your customer portal: a new plan (kind "service") or warranty add-ons on a plan they already have (kind "addon"), at the same moment as the staff email for it. Route it as revenue from an existing customer, not a new lead. To skip duplicates, match on data.subscriptionID together with data.kind and, for add-ons, the labels in data.addOns.
| Field | Type | Description |
|---|---|---|
data.kind | string | "service" (a new plan) or "addon" (warranty add-ons added to a plan they already have). |
data.customerID | string | FieldRoutes customer ID. |
data.subscriptionID | string | FieldRoutes subscription ID: the new plan, or the plan the add-ons were added to. |
data.existing_customer | boolean | Always true — portal purchases come from current customers. |
data.phone_number | string | Phone (E.164). "" when unknown. |
data.email | string | Email. "" when unknown. |
data.first_name | string | First name. "" when unknown. |
data.last_name | string | Last name. "" when unknown. |
data.address | string | null | Service street address. |
data.city | string | null | City. |
data.state | string | null | State. |
data.zip | string | null | ZIP code. |
data.planType | string | null | Plan name. |
data.frequency | number | null | Services per year. |
data.value | number | Initial charge for a new plan; 0 for add-ons. |
data.recurringCharge | number | null | Per-service recurring charge: the new plan’s, or the plan’s new total with the add-ons. null when unknown. |
data.currency | string | Always "USD". |
data.addOns | object[] | The add-ons bought, each { label, amount } (amount per service). [] for a new plan. |
data.appointmentDate | string | null | Requested first-service date (YYYY-MM-DD). null for add-ons. |
data.appointmentTime | string | null | "morning" or "afternoon". null for add-ons. |
data.appointmentWindowStart | string | null | Arrival window start for that half-day ("08:00" or "12:00"). null for add-ons. |
data.appointmentWindowEnd | string | null | Arrival window end ("12:00" or "17:00"). null for add-ons. |
data.heldForSignature | boolean | null | false — a portal purchase is booked right away, with no signing step. Present so one mapping fits sale.completed too. |
data.leadId | string | null | PestBooker lead ID. Usually the same across one customer’s events, but not guaranteed: a customer who comes back in a new session can get a new lead, and it can be null. Fall back to email or phone when matching. |
data.office | object | null | The office the customer’s account belongs to. null for a single-office account, or when it can’t be determined. |
data.office.id | string | PestBooker office ID. |
data.office.name | string | Office name as set in PestBooker. |
data.office.fieldRoutesOfficeID | number | The FieldRoutes office ID. |
data.attribution | object | Where the customer came from, as captured on the lead. Every key is always present; a value that wasn’t captured is null. |
data.attribution.utm_source | string | null | utm_source |
data.attribution.utm_medium | string | null | utm_medium |
data.attribution.utm_campaign | string | null | utm_campaign |
data.attribution.utm_content | string | null | utm_content |
data.attribution.utm_term | string | null | utm_term |
data.attribution.gclid | string | null | Google Ads click ID. |
data.attribution.fbclid | string | null | Meta (Facebook) click ID. |
data.attribution.msclkid | string | null | Microsoft Ads click ID. |
data.attribution.wbraid | string | null | Google web-to-app click ID. |
data.attribution.gbraid | string | null | Google app-to-web click ID. |
data.attribution.rwg_token | string | null | Reserve with Google conversion token. |
data.attribution.landing_page | string | null | The page the booking form was opened on. |
data.attribution.referrer | string | null | The outside site that sent the visitor (e.g. https://www.google.com/). |
data.attribution.fr_source | object | null | The FieldRoutes customer source PestBooker created the customer with — the same source the office sees in FieldRoutes. Null when there is no FieldRoutes customer yet, or when PestBooker didn’t create them (a returning customer, or a portal purchase whose original lead can’t be found). |
data.attribution.fr_source.id | number | The FieldRoutes source ID. |
data.attribution.fr_source.name | string | null | The FieldRoutes source name (e.g. "Google Ads"); null when your default source was used. |
data.attribution.fr_source.channel | string | Where the customer came from in plain words (e.g. "Google Ads", "Direct / untagged"). Always present. |
data.attribution.promoter_first_name | string | null | The first name of the existing customer who referred them through your referral partner (Clicki). Null when they didn’t come through a referral link. Informational only: it is separate from your own referral program’s code and referrer credit, credits nobody and changes no price — your referral partner rewards its own promoter. |
Sample
{
"event": "portal.purchase",
"companySlug": "your-company",
"occurredAt": "2026-09-01T16:00:00.000Z",
"data": {
"kind": "service",
"customerID": "163318",
"subscriptionID": "48307",
"existing_customer": true,
"phone_number": "+15555550123",
"email": "test@example.com",
"first_name": "Test",
"last_name": "Customer",
"address": "123 Test St",
"city": "San Diego",
"state": "CA",
"zip": "92129",
"planType": "Mosquito Service",
"frequency": 6,
"value": 99,
"recurringCharge": 79,
"currency": "USD",
"addOns": [],
"appointmentDate": "2026-09-10",
"appointmentTime": "morning",
"appointmentWindowStart": "08:00",
"appointmentWindowEnd": "12:00",
"heldForSignature": false,
"leadId": null,
"office": {
"id": "6f1c2b9e-0d4a-4c1e-9a53-2e8f7b1d0c11",
"name": "North County",
"fieldRoutesOfficeID": 2
},
"attribution": {
"utm_source": null,
"utm_medium": null,
"utm_campaign": null,
"utm_content": null,
"utm_term": null,
"gclid": null,
"fbclid": null,
"msclkid": null,
"wbraid": null,
"gbraid": null,
"rwg_token": null,
"landing_page": null,
"referrer": null,
"fr_source": {
"id": 10062,
"name": null,
"channel": "Direct / untagged"
},
"promoter_first_name": null
}
}
}Booking request booking.requestedShowHide
Fires when online scheduling is briefly unavailable on your booking page and PestBooker captures the customer instead of booking them. With stage "request", the customer picked the days that work for them, and it fires at the same moment as the booking-request staff email; it fires again if they change the days. With stage "contact", they left their contact details but didn’t pick days, and it fires about 30 minutes later. No payment is taken, so your team confirms the appointment with the customer; sale.completed is sent only if they later book and pay online. PestBooker adds the customer to FieldRoutes on its own once it can. To skip duplicates, match on data.leadId together with data.stage and data.request.preferred_days.
| Field | Type | Description |
|---|---|---|
data.stage | string | "request" (the customer picked preferred days — see request) or "contact" (they left their contact details but didn’t pick days). |
data.leadId | string | null | PestBooker lead ID. Usually the same across one customer’s events, but not guaranteed: a customer who comes back in a new session can get a new lead, and it can be null. Fall back to email or phone when matching. |
data.customer | object | The customer’s contact details and address as they entered them. A value we don’t know is "". |
data.customer.first_name | string | First name. |
data.customer.last_name | string | Last name. |
data.customer.email | string | Email. |
data.customer.phone_number | string | Phone (E.164). |
data.customer.address | string | Service street address. |
data.customer.city | string | City. |
data.customer.state | string | State. |
data.customer.zip | string | ZIP code. |
data.office | object | null | The office the customer was routed to (by ZIP). null for a single-office account, or when it can’t be determined. |
data.office.id | string | PestBooker office ID. |
data.office.name | string | Office name as set in PestBooker. |
data.office.fieldRoutesOfficeID | number | The FieldRoutes office ID. |
data.attribution | object | Where the customer came from, as captured on the lead. Every key is always present; a value that wasn’t captured is null. |
data.attribution.utm_source | string | null | utm_source |
data.attribution.utm_medium | string | null | utm_medium |
data.attribution.utm_campaign | string | null | utm_campaign |
data.attribution.utm_content | string | null | utm_content |
data.attribution.utm_term | string | null | utm_term |
data.attribution.gclid | string | null | Google Ads click ID. |
data.attribution.fbclid | string | null | Meta (Facebook) click ID. |
data.attribution.msclkid | string | null | Microsoft Ads click ID. |
data.attribution.wbraid | string | null | Google web-to-app click ID. |
data.attribution.gbraid | string | null | Google app-to-web click ID. |
data.attribution.rwg_token | string | null | Reserve with Google conversion token. |
data.attribution.landing_page | string | null | The page the booking form was opened on. |
data.attribution.referrer | string | null | The outside site that sent the visitor (e.g. https://www.google.com/). |
data.attribution.fr_source | object | null | The FieldRoutes customer source PestBooker created the customer with — the same source the office sees in FieldRoutes. Null when there is no FieldRoutes customer yet, or when PestBooker didn’t create them (a returning customer, or a portal purchase whose original lead can’t be found). |
data.attribution.fr_source.id | number | The FieldRoutes source ID. |
data.attribution.fr_source.name | string | null | The FieldRoutes source name (e.g. "Google Ads"); null when your default source was used. |
data.attribution.fr_source.channel | string | Where the customer came from in plain words (e.g. "Google Ads", "Direct / untagged"). Always present. |
data.attribution.promoter_first_name | string | null | The first name of the existing customer who referred them through your referral partner (Clicki). Null when they didn’t come through a referral link. Informational only: it is separate from your own referral program’s code and referrer credit, credits nobody and changes no price — your referral partner rewards its own promoter. |
data.pests | string[] | Pests the customer selected; [] when none. |
data.fieldRoutesCustomerID | string | null | The customer’s FieldRoutes customer ID when they already have one; null when they aren’t in FieldRoutes yet. |
data.request | object | null | What the customer asked for. null with stage "contact". |
data.request.preferred_days | string[] | The days the customer can do (YYYY-MM-DD), earliest first. |
data.request.window | string | "am" (morning), "pm" (afternoon) or "any" (whatever’s soonest). |
data.request.note | string | The customer’s note for your team; "" when none. |
data.request.plan | object | null | The plan they chose, as { id, name } (your PestBooker plan). null when they didn’t pick one. |
data.request.quoted_initial | number | null | The initial service price they were shown. null when unknown. |
data.request.quoted_recurring | number | null | The recurring per-service price they were shown. null when unknown. |
Sample
{
"event": "booking.requested",
"companySlug": "your-company",
"occurredAt": "2026-09-01T16:00:00.000Z",
"data": {
"stage": "request",
"leadId": "3f0a6c2e-5b1d-4e8f-a7c9-0d2b4e6f8a10",
"customer": {
"first_name": "Test",
"last_name": "Customer",
"email": "test@example.com",
"phone_number": "+15555550123",
"address": "123 Test St",
"city": "San Diego",
"state": "CA",
"zip": "92129"
},
"office": {
"id": "6f1c2b9e-0d4a-4c1e-9a53-2e8f7b1d0c11",
"name": "North County",
"fieldRoutesOfficeID": 2
},
"attribution": {
"utm_source": "google",
"utm_medium": "cpc",
"utm_campaign": "fall-ants",
"utm_content": "hero-cta",
"utm_term": "ant exterminator",
"gclid": "TEST-GCLID-VALUE",
"fbclid": null,
"msclkid": null,
"wbraid": null,
"gbraid": null,
"rwg_token": null,
"landing_page": "https://www.example-pest.com/ant-control?utm_source=google&utm_medium=cpc",
"referrer": "https://www.google.com/",
"fr_source": {
"id": 10014,
"name": "Google Ads",
"channel": "Google Ads"
},
"promoter_first_name": null
},
"pests": [
"Ants",
"Spiders"
],
"fieldRoutesCustomerID": null,
"request": {
"preferred_days": [
"2026-09-10",
"2026-09-11"
],
"window": "am",
"note": "(Test) Gate code is 1234.",
"plan": {
"id": "quarterly",
"name": "Quarterly Pest Control"
},
"quoted_initial": 99,
"quoted_recurring": 49
}
}
}Plan cancelled online subscription.cancelledShowHide
Fires when a customer cancels a plan they bought online through PestBooker, using “Click to cancel” in your customer portal, at the same moment as the staff email for it. California and Colorado require this online cancellation for plans bought online, so it’s offered only there and only on plans PestBooker sold. By the time it fires, the plan is inactive in FieldRoutes and its upcoming appointments are cancelled. Nothing is charged: when underContract is true, bill any early-cancellation amount your agreement provides. To skip duplicates, match on data.subscriptionID.
| Field | Type | Description |
|---|---|---|
data.customerID | string | FieldRoutes customer ID. |
data.subscriptionID | string | FieldRoutes subscription ID of the cancelled plan. |
data.channel | string | Where the customer cancelled. Always "portal_click_to_cancel" today. |
data.cancelledAt | string | When the customer cancelled (ISO 8601, UTC). |
data.reason | string | null | The reason the customer picked, if any. null when they skipped it. |
data.legalBasis | string | null | The state law that requires this online cancellation for the service address, e.g. "Cal. Bus. & Prof. Code §17602". |
data.phone_number | string | Phone (E.164). "" when unknown. |
data.email | string | Email. "" when unknown. |
data.first_name | string | First name. "" when unknown. |
data.last_name | string | Last name. "" when unknown. |
data.address | string | null | Service street address. |
data.city | string | null | City. |
data.state | string | null | State. |
data.zip | string | null | ZIP code. |
data.planType | string | null | Plan name. |
data.frequency | number | null | Services per year. |
data.recurringCharge | number | null | The plan’s per-service recurring charge. null when unknown. |
data.currency | string | Always "USD". |
data.underContract | boolean | true when the customer cancelled before their agreement term ended. Any early-cancellation amount is yours to bill under your agreement; PestBooker charges nothing. |
data.agreementLength | number | null | Agreement length in months. null when unknown. |
data.termEndDate | string | null | When the agreement term ends (YYYY-MM-DD). null when unknown. |
data.cancelledAppointmentIDs | string[] | FieldRoutes IDs of the upcoming appointments that were cancelled. [] when none. |
data.leadId | string | null | PestBooker lead ID. Usually the same across one customer’s events, but not guaranteed: a customer who comes back in a new session can get a new lead, and it can be null. Fall back to email or phone when matching. |
data.office | object | null | The office the customer’s account belongs to. null for a single-office account, or when it can’t be determined. |
data.office.id | string | PestBooker office ID. |
data.office.name | string | Office name as set in PestBooker. |
data.office.fieldRoutesOfficeID | number | The FieldRoutes office ID. |
data.attribution | object | Where the customer came from, as captured on the lead. Every key is always present; a value that wasn’t captured is null. |
data.attribution.utm_source | string | null | utm_source |
data.attribution.utm_medium | string | null | utm_medium |
data.attribution.utm_campaign | string | null | utm_campaign |
data.attribution.utm_content | string | null | utm_content |
data.attribution.utm_term | string | null | utm_term |
data.attribution.gclid | string | null | Google Ads click ID. |
data.attribution.fbclid | string | null | Meta (Facebook) click ID. |
data.attribution.msclkid | string | null | Microsoft Ads click ID. |
data.attribution.wbraid | string | null | Google web-to-app click ID. |
data.attribution.gbraid | string | null | Google app-to-web click ID. |
data.attribution.rwg_token | string | null | Reserve with Google conversion token. |
data.attribution.landing_page | string | null | The page the booking form was opened on. |
data.attribution.referrer | string | null | The outside site that sent the visitor (e.g. https://www.google.com/). |
data.attribution.fr_source | object | null | The FieldRoutes customer source PestBooker created the customer with — the same source the office sees in FieldRoutes. Null when there is no FieldRoutes customer yet, or when PestBooker didn’t create them (a returning customer, or a portal purchase whose original lead can’t be found). |
data.attribution.fr_source.id | number | The FieldRoutes source ID. |
data.attribution.fr_source.name | string | null | The FieldRoutes source name (e.g. "Google Ads"); null when your default source was used. |
data.attribution.fr_source.channel | string | Where the customer came from in plain words (e.g. "Google Ads", "Direct / untagged"). Always present. |
data.attribution.promoter_first_name | string | null | The first name of the existing customer who referred them through your referral partner (Clicki). Null when they didn’t come through a referral link. Informational only: it is separate from your own referral program’s code and referrer credit, credits nobody and changes no price — your referral partner rewards its own promoter. |
Sample
{
"event": "subscription.cancelled",
"companySlug": "your-company",
"occurredAt": "2026-09-01T16:00:00.000Z",
"data": {
"customerID": "163318",
"subscriptionID": "48307",
"channel": "portal_click_to_cancel",
"cancelledAt": "2026-11-02T18:04:11.000Z",
"reason": "Moving",
"legalBasis": "Cal. Bus. & Prof. Code §17602",
"phone_number": "+15555550123",
"email": "test@example.com",
"first_name": "Test",
"last_name": "Customer",
"address": "123 Test St",
"city": "San Diego",
"state": "CA",
"zip": "92129",
"planType": "Quarterly Pest Control",
"frequency": 4,
"recurringCharge": 49,
"currency": "USD",
"underContract": true,
"agreementLength": 12,
"termEndDate": "2027-03-03",
"cancelledAppointmentIDs": [
"902114"
],
"leadId": null,
"office": {
"id": "6f1c2b9e-0d4a-4c1e-9a53-2e8f7b1d0c11",
"name": "North County",
"fieldRoutesOfficeID": 2
},
"attribution": {
"utm_source": null,
"utm_medium": null,
"utm_campaign": null,
"utm_content": null,
"utm_term": null,
"gclid": null,
"fbclid": null,
"msclkid": null,
"wbraid": null,
"gbraid": null,
"rwg_token": null,
"landing_page": null,
"referrer": null,
"fr_source": {
"id": 10062,
"name": null,
"channel": "Direct / untagged"
},
"promoter_first_name": null
}
}
}Verifying the signature
Each request carries X-PestBooker-Event (the event name) and X-PestBooker-Signature: the hex HMAC-SHA256 of the raw request body, keyed with your signing secret. Compute it over the body exactly as received, before parsing it. A 2xx response counts as delivered. Retries are built in: if your endpoint doesn’t answer with a 2xx, we automatically try again.
import { createHmac, timingSafeEqual } from 'node:crypto'
// rawBody: the request body exactly as received (before JSON.parse)
function isFromPestBooker(rawBody, signatureHeader, secret) {
const expected = createHmac('sha256', secret).update(rawBody).digest('hex')
const a = Buffer.from(expected)
const b = Buffer.from(String(signatureHeader ?? ''))
return a.length === b.length && timingSafeEqual(a, b)
}Pro Tips
- • Your signing secret is generated the first time you save. Keep it server-side, never in a browser or a public Zap step.
- • If your secret may have leaked, an admin can roll it on the Signing secret tab. The new secret takes effect immediately, so update your receiver right away.
- • Using Zapier? Integrations → Zapier walks you through connecting an event to a Zap.
Need help with setup?
Email us and we'll walk you through any integration or setup process.
Contact Sales