Find-or-create person / org / deal in Pipedrive
WP calls this endpoint for four lifecycle events. The DO Function
uses email as the primary lookup key for the person. When stored
Pipedrive IDs are available (pipedrive_ids), they are passed so
the function can update existing records directly.
Event: demo_signup
A public visitor signs up to try a demo sage. No WP user is created.
No org_fields, no deal_fields, no pipedrive_ids.
Event: trial_created
A council_admin completes Stripe checkout for a $299 I-SKU trial.
council_name, org_fields, and deal_fields are included.
Event: paid_created
A council_admin is created for a directly-provisioned paid account.
Same shape as trial_created with customer_type: paid.
Event: user_added
A team member is added to an existing council by an admin.
council_name and org_fields.wp_council_id are included.
org_fields.wp_admin_email and deal_fields are omitted.
Stored org_id and deal_id are passed (no contact_id since
the new user has no stored PD ID yet).
Authorizations
Secret key appended by WP as ?k=<secret>.
Account-created uses ss_pipedrive_sync_secret.
Quote-sync uses ss_pipedrive_quote_sync_secret.
Body
Primary lookup key for the Pipedrive person record
"john@example.com"
"John"
"Doe"
SageScreen product tier for this event
demo, trial, paid "trial"
Custom Pipedrive person fields set on the contact record. Only fields with a value are sent.
Candidate or user phone number. Send whatever is available.
"555-1234"
Display name of the council / company. For demo signups, this is
the company field from the signup form. For council accounts,
this is the council post title. For user_added, it is get_the_title
of the council post.
"ACME Corp"
Included for trial_created, paid_created, and user_added. Omitted for demo_signup (no council relationship).
Included for trial_created and paid_created (wp_deal_type only). Omitted for demo_signup and user_added.
Included only when stored IDs exist in WP meta. On first sync for a new contact/council this field is absent entirely.
Response
Sync result with Pipedrive record IDs
true on success. An auth failure returns ok: false with no IDs.
WP checks ok === true AND the presence of pd_contact_id
before persisting any IDs — a bare {"ok": true} is treated
as a no-op (no IDs to store).
true
Pipedrive person ID. WP persists to user_meta.pipedrive_contact_id.
Absent on demo signups (no WP user to attach meta to — WP ignores it).
1234
Pipedrive org ID. WP persists to post_meta.pipedrive_company_id
on the ss_council post.
4001
Pipedrive deal ID. WP persists to post_meta.pipedrive_deal_id
on the ss_council post.
5001
true if the person record was newly created (vs updated)
true
true if the org record was newly created
false
true if the deal record was newly created
false
Human-readable error when ok is false
"Unauthorized"