{"openapi":"3.1.0","info":{"title":"LeadJourney API","version":"2.0.0","description":"Two APIs on one server. The Public API (paths under /v1/public/workspaces/{workspace}) authenticates with a workspace token (ljw_...) carrying scopes; the plaintext is shown once, a workspace has at most 5 active tokens, and expiry is at most 360 days. Rate limits: 60 requests per minute per workspace, 30 per token, 120 per IP. The Integrations API (the other /v1 paths) powers the Zapier app and authenticates with a user token from Settings, then API & Integrations. Successful responses are wrapped as { success: true, data: { ... } }."},"servers":[{"url":"https://api.leadjourney.io/api","description":"Production"}],"tags":[{"name":"Reports & dashboards","description":"Describe the report vocabulary, run a report ad hoc, and manage dashboards and their saved report cards. Scope: reports."},{"name":"Leads","description":"Resolve a lead from a click id, email or phone, and read its full journey. Read-only, and the answers carry personal data (email, phone). Scope: leads."},{"name":"Tags","description":"Tags and the rules that apply them automatically, with an optional backfill over existing data. Scope: tags."},{"name":"Tracking","description":"Tracking domains, the onboarding state, the script check, stack detection and the CRM webhook details. Scope: tracking."},{"name":"Traffic channels, UTM & short links","description":"Custom traffic channels, tracking link templates per channel, and short links on a verified tracking domain. Scope: traffic_channels."},{"name":"API tokens","description":"List, create and revoke the workspace's API tokens over the API itself. Scope: tokens."},{"name":"Agency client workspaces","description":"List an agency's client workspaces and create new ones, each with its own provisioning token. Scope: agency.workspaces, on the agency HQ workspace only."},{"name":"Account","description":"Identify the authenticated token and list the workspaces it can act on."},{"name":"Conversions & leads","description":"Read conversion types and push leads or revenue conversions into a workspace."},{"name":"Tags","description":"Manage tags and apply them to individual leads."},{"name":"Custom fields","description":"Read, create, update and delete the custom fields stored on each lead."},{"name":"Lead lookup","description":"Find a single lead by click id, email, or phone."},{"name":"Webhooks (REST hooks)","description":"Subscribe and unsubscribe webhook targets. Zapier uses these to power instant triggers."},{"name":"Recent items (polling)","description":"Most recent items per type. Used for trigger sample data and as a polling fallback."}],"components":{"securitySchemes":{"workspaceToken":{"type":"http","scheme":"bearer","description":"Public API workspace token (ljw_ followed by 40 characters), bound to one workspace. Scopes: reports (Reports & Dashboards), tags (Tags), leads (Leads & Attribution (read)), tracking (Tracking), traffic_channels (Traffic Channels), agency.workspaces (Create Client Workspaces), tokens (Manage API Tokens)."},"bearerAuth":{"type":"http","scheme":"bearer","description":"Integrations API: personal API token from LeadJourney Settings, then API & Integrations."}}},"paths":{"/v1/public/workspaces/{workspace}/reports/describe":{"get":{"operationId":"reports-describe","summary":"Describe the report vocabulary","description":"Everything a report can be built from: metrics, windows, dimensions, filters, attribution settings, chart types and time periods. Not paginated.","tags":["Reports & dashboards"],"security":[{"workspaceToken":["reports"]}],"responses":{"200":{"description":"Lists shortened. group_by: time, day_of_week, sources, channel_category, country, city, device, browser, os, isp, landing_page, domain, form, keyword, url_parameters, campaign, ad_group, ad, affiliate_campaign, affiliate_offer, affiliate_network, custom_field:<key>. secondary_group_by: time, sources, channel_category, country, city, device, browser, os, isp, landing_page, domain, keyword, url_parameters, campaign, ad_group, ad. filter_fields: country, device, landing_page, domain, campaign_name, ad_group, ad, keyword, traffic_channel, medium, tag, campaign_id, adset_id, ad_id. The affiliate_* entries only appear when affiliate features are on for the workspace. metrics are the known base metric ids of the workspace.","content":{"application/json":{"example":{"success":true,"data":{"metrics":["<metric_id>","..."],"metric_windows":{"note":"Append a window as metric@window. At most 6 distinct windows per report.","ids":["last_7d","last_14d","last_30d","last_60d","last_90d"]},"group_by":["time","day_of_week","sources","channel_category","country","campaign","custom_field:<key>"],"channel_category":["<channel category>","..."],"secondary_group_by":["time","sources","channel_category","country","campaign"],"granularity":["Hour","Day","Week","Month","Quarter","Year"],"filter_fields":["country","device","landing_page","campaign_name","traffic_channel","tag"],"filter_conditions":["is_equal_to","is_not_equal_to","contains","does_not_contain","starts_with","ends_with"],"attribution_method":["first_click","last_click","Linear","Time Decay","U-Shaped","Progressive"],"attribution_date_mode":["click_date","conversion_date"],"chart_types":["line","column","bar","area","donut","table"],"time_periods":["allTime","today","yesterday","thisWeek","lastWeek","thisMonth","lastMonth","thisQuarter","lastQuarter","thisYear","lastYear","rollingDateRange","customRange"],"traffic_channels":[{"key":"google_ads","label":"Google Ads","is_active":true}],"pagination":{"default_per_page":20,"max_per_page":50}}}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}}]}},"/v1/public/workspaces/{workspace}/reports/run":{"post":{"operationId":"reports-run","summary":"Run a report","description":"Runs an ad-hoc report and returns its rows. Nothing is saved.","tags":["Reports & dashboards"],"security":[{"workspaceToken":["reports"]}],"responses":{"200":{"description":"Example trimmed. data also carries dimension_meta, datasets, totals, previous_totals and metric_meta, plus trends when _trend metrics are requested. The secondary keys are null unless a secondary dimension is used.","content":{"application/json":{"example":{"success":true,"data":{"labels":["Google Ads","Meta Ads","LinkedIn Ads"],"primary_labels":null,"secondary_labels":null,"secondary_group_by":null,"secondary_granularity":null,"pagination":{"page":1,"per_page":20,"total":3,"has_more":false}},"meta":{"current_page":1,"per_page":20,"max_per_page":50}}}}},"422":{"description":"report_failed: Any other failure while running the report. Validation errors, including an unknown base metric, in the standard message and errors shape."},"503":{"description":"report_too_large: The query timed out. Narrow the date range or the dimensions."}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"metrics":{"type":"array","items":{"type":"string"},"description":"At least one. Each item is at most 100 characters, matches ^[a-z0-9_]+(@(last_7d|last_14d|last_30d|last_60d|last_90d))?$ and names a known base metric (see /reports/describe). Append @window for a rolling window, at most 6 distinct windows per report. A _trend suffix (with no @) requests a trend series, returned under trends."},"group_by":{"type":"string","description":"One entry of the group_by list from /reports/describe, or custom_field:<key> (key matching [a-z][a-z0-9_]*)."},"granularity":{"type":"string","enum":["Hour","Day","Week","Month","Quarter","Year"],"description":"Time bucket."},"secondary_group_by":{"type":"string","description":"One entry of the secondary_group_by list from /reports/describe."},"secondary_granularity":{"type":"string","enum":["Day","Week","Month","Quarter","Year"],"description":"Time bucket of the secondary dimension."},"date_from":{"type":"string","description":"Start date, Y-m-d."},"date_to":{"type":"string","description":"End date, Y-m-d."},"traffic_channels":{"type":"array","items":{"type":"string"},"description":"Channel keys. Empty means all channels."},"filters":{"type":"array","items":{},"description":"Array of { field, condition, value }. field is one of filter_fields, condition one of the six filter_conditions from /reports/describe, value is required."},"attribution_method":{"type":"string","enum":["first_click","last_click","Linear","Time Decay","U-Shaped","Progressive"],"description":"Defaults to last_click. First and Last are accepted as aliases; an unknown value falls back to last_click."},"attribution_window":{"type":"string","description":"Defaults to lifetime."},"attribution_date_mode":{"type":"string","enum":["click_date","conversion_date"],"description":"Defaults to click_date."},"sort_direction":{"type":"string","enum":["asc","desc"],"description":"Defaults to desc."},"sort_column":{"type":"string","description":"A known metric id."},"limit":{"type":"integer","enum":[5,10,15,20],"description":"Defaults to 10."},"display_only_dates_with_data":{"type":"boolean","description":"Defaults to true."},"page":{"type":"integer","description":"Minimum 1. Accepted in the body or the query string."},"per_page":{"type":"integer","description":"Validated as 1 to 100, then clamped to 50. Defaults to 20. Accepted in the body or the query string."}},"required":["metrics","group_by"]}}}}}},"/v1/public/workspaces/{workspace}/dashboards":{"get":{"operationId":"dashboards-list","summary":"List dashboards","description":"Lists the workspace's dashboards, ordered by order, each with its report cards.","tags":["Reports & dashboards"],"security":[{"workspaceToken":["reports"]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"example":{"success":true,"data":[{"id":"b2c3d4e5-f607-4819-2a3b-4c5d6e7f8091","name":"Paid channels","icon_key":"google_ads","column_layout":2,"order":1,"reports":[{"id":"d4e5f607-1829-4a3b-5c6d-7e8f90a1b2c3","order":1,"name":"Leads by source","chart_type":"column","metrics":["<metric_id>"],"group_by":"sources"}]}],"meta":{"current_page":1,"per_page":20,"last_page":1,"total":1,"max_per_page":50}}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}},{"name":"page","in":"query","required":false,"description":"Page number. Defaults to 1, minimum 1.","schema":{"type":"integer"}},{"name":"per_page","in":"query","required":false,"description":"Items per page. Defaults to 20, maximum 50. A larger value is clamped to 50, a value below 1 falls back to 20.","schema":{"type":"integer"}}]},"post":{"operationId":"dashboards-create","summary":"Create a dashboard","description":"Creates an empty dashboard.","tags":["Reports & dashboards"],"security":[{"workspaceToken":["reports"]}],"responses":{"201":{"description":"Successful response.","content":{"application/json":{"example":{"success":true,"data":{"id":"b2c3d4e5-f607-4819-2a3b-4c5d6e7f8091","name":"Paid channels","icon_key":"google_ads"}}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Max 255 characters."},"icon_key":{"type":"string","description":"A traffic channel key, for example meta_ads, google_ads, bing_ads, linkedin_ads, reddit_ads, chatgpt_ads, x_ads, taboola_ads, outbrain_ads, tiktok_ads, email, gmb, plus direct, referral and the organic keys."}},"required":["name"]}}}}}},"/v1/public/workspaces/{workspace}/dashboards/{dashboard}":{"get":{"operationId":"dashboards-get","summary":"Get a dashboard","description":"Returns one dashboard with every report card and its full report configuration.","tags":["Reports & dashboards"],"security":[{"workspaceToken":["reports"]}],"responses":{"200":{"description":"report_config is the full configuration in the frontend's camelCase shape.","content":{"application/json":{"example":{"success":true,"data":{"id":"b2c3d4e5-f607-4819-2a3b-4c5d6e7f8091","name":"Paid channels","icon_key":"google_ads","column_layout":2,"order":1,"reports":[{"id":"d4e5f607-1829-4a3b-5c6d-7e8f90a1b2c3","order":1,"name":"Leads by source","chart_type":"column","report_config":{"...":"the frontend's camelCase report configuration"}}]}}}}},"404":{"description":"not_found: The dashboard is not in this workspace."}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}},{"name":"dashboard","in":"path","required":true,"description":"Dashboard id.","schema":{"type":"string","format":"uuid"}}]},"delete":{"operationId":"dashboards-delete","summary":"Delete a dashboard","description":"Deletes the dashboard and detaches its icon.","tags":["Reports & dashboards"],"security":[{"workspaceToken":["reports"]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"example":{"success":true,"data":{"id":"b2c3d4e5-f607-4819-2a3b-4c5d6e7f8091","name":"Paid channels","deleted":true}}}}},"404":{"description":"not_found: The dashboard is not in this workspace."}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}},{"name":"dashboard","in":"path","required":true,"description":"Dashboard id.","schema":{"type":"string","format":"uuid"}}]}},"/v1/public/workspaces/{workspace}/dashboards/{dashboard}/reports":{"post":{"operationId":"dashboards-reports-create","summary":"Save a report card","description":"Saves a report card on a dashboard. Takes the fields of /reports/run (without page and per_page) plus the card's own.","tags":["Reports & dashboards"],"security":[{"workspaceToken":["reports"]}],"responses":{"201":{"description":"Successful response.","content":{"application/json":{"example":{"success":true,"data":{"id":"d4e5f607-1829-4a3b-5c6d-7e8f90a1b2c3","dashboard_id":"b2c3d4e5-f607-4819-2a3b-4c5d6e7f8091","dashboard_name":"Paid channels","name":"Leads by source","order":1}}}}},"404":{"description":"not_found: The dashboard is not in this workspace."}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}},{"name":"dashboard","in":"path","required":true,"description":"Dashboard id.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"report_name":{"type":"string","description":"Max 255 characters."},"chart_type":{"type":"string","enum":["line","column","bar","area","donut","table"],"description":"Defaults to line."},"time_period":{"type":"string","description":"One of time_periods from /reports/describe. Defaults to customRange when dates are given, otherwise lastMonth."},"rolling_value":{"type":"integer","description":"Minimum 1."},"rolling_unit":{"type":"string","enum":["days","weeks","months","quarters","years"],"description":"Unit of a rolling range."},"metrics":{"type":"array","items":{"type":"string"},"description":"At least one. Each item is at most 100 characters, matches ^[a-z0-9_]+(@(last_7d|last_14d|last_30d|last_60d|last_90d))?$ and names a known base metric (see /reports/describe). Append @window for a rolling window, at most 6 distinct windows per report. A _trend suffix (with no @) requests a trend series, returned under trends."},"group_by":{"type":"string","description":"One entry of the group_by list from /reports/describe, or custom_field:<key> (key matching [a-z][a-z0-9_]*)."},"granularity":{"type":"string","enum":["Hour","Day","Week","Month","Quarter","Year"],"description":"Time bucket."},"secondary_group_by":{"type":"string","description":"One entry of the secondary_group_by list from /reports/describe."},"secondary_granularity":{"type":"string","enum":["Day","Week","Month","Quarter","Year"],"description":"Time bucket of the secondary dimension."},"date_from":{"type":"string","description":"Start date, Y-m-d."},"date_to":{"type":"string","description":"End date, Y-m-d."},"traffic_channels":{"type":"array","items":{"type":"string"},"description":"Channel keys. Empty means all channels."},"filters":{"type":"array","items":{},"description":"Array of { field, condition, value }. field is one of filter_fields, condition one of the six filter_conditions from /reports/describe, value is required."},"attribution_method":{"type":"string","enum":["first_click","last_click","Linear","Time Decay","U-Shaped","Progressive"],"description":"Defaults to last_click. First and Last are accepted as aliases; an unknown value falls back to last_click."},"attribution_window":{"type":"string","description":"Defaults to lifetime."},"attribution_date_mode":{"type":"string","enum":["click_date","conversion_date"],"description":"Defaults to click_date."},"sort_direction":{"type":"string","enum":["asc","desc"],"description":"Defaults to desc."},"sort_column":{"type":"string","description":"A known metric id."},"limit":{"type":"integer","enum":[5,10,15,20],"description":"Defaults to 10."},"display_only_dates_with_data":{"type":"boolean","description":"Defaults to true."}},"required":["report_name","metrics","group_by"]}}}}}},"/v1/public/workspaces/{workspace}/dashboards/{dashboard}/reports/{report}":{"delete":{"operationId":"dashboards-reports-delete","summary":"Delete a report card","description":"Removes a report card from a dashboard.","tags":["Reports & dashboards"],"security":[{"workspaceToken":["reports"]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"example":{"success":true,"data":{"id":"d4e5f607-1829-4a3b-5c6d-7e8f90a1b2c3","name":"Leads by source","deleted":true}}}}},"404":{"description":"not_found: The dashboard is not in this workspace, or it has no such card."}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}},{"name":"dashboard","in":"path","required":true,"description":"Dashboard id.","schema":{"type":"string","format":"uuid"}},{"name":"report","in":"path","required":true,"description":"Report card id.","schema":{"type":"string","format":"uuid"}}]}},"/v1/public/workspaces/{workspace}/leads/find":{"get":{"operationId":"leads-find","summary":"Find a lead","description":"Resolves a lead from a click id, an email or a phone number and returns its first and last touch. The click id is tried first, following merges for up to 5 hops; if the email or phone passed contradicts the lead behind the click id, identity matching wins, email first, then phone.","tags":["Leads"],"security":[{"workspaceToken":["leads"]}],"responses":{"200":{"description":"When nothing matches, data.lead is null with status 200, not a 404. matched_by is click_id, email or phone. Every key of a touch object is always present; timestamps are ISO 8601 UTC.","content":{"application/json":{"example":{"success":true,"data":{"lead":{"id":"5d6e7f80-1a2b-3c4d-5e6f-708192a3b4c5","click_id":"0c1d2e3f-4a5b-6c7d-8e9f-a0b1c2d3e4f5","email":"maria@example.com","phone":"+4915112345678","is_unattributed":false,"matched_by":"click_id","created_at":"2026-10-02T08:16:40Z","first_touch":{"clicked_at":"2026-10-02T08:14:03Z","channel":"Google Ads","channel_key":"google_ads","utm_source":"google","utm_medium":"cpc","utm_campaign":"brand-search","utm_content":null,"utm_term":"lead attribution","campaign":"Brand Search","campaign_id":"1234567890","ad_set":"Brand Exact","ad_set_id":"2345678901","ad":"RSA 1","ad_id":"3456789012","keyword":"lead attribution","keyword_id":"4567890123","placement":null,"gclid":"EAIaIQobChMI_example","wbraid":null,"gbraid":null,"fbclid":null,"li_fat_id":null,"msclkid":null,"rdt_cid":null,"twclid":null,"oppref":null,"tblci":null,"obclid":null,"ttclid":null,"landing_page":"/pricing","full_url":"https://acme.com/pricing?utm_source=google&utm_medium=cpc","referrer_domain":"google.com","device_type":"desktop","os":"macOS","browser":"Chrome","country":"DE","city":"Berlin"},"last_touch":{"clicked_at":"2026-10-02T08:14:03Z","channel":"Google Ads","channel_key":"google_ads","utm_source":"google","utm_medium":"cpc","utm_campaign":"brand-search","utm_content":null,"utm_term":"lead attribution","campaign":"Brand Search","campaign_id":"1234567890","ad_set":"Brand Exact","ad_set_id":"2345678901","ad":"RSA 1","ad_id":"3456789012","keyword":"lead attribution","keyword_id":"4567890123","placement":null,"gclid":"EAIaIQobChMI_example","wbraid":null,"gbraid":null,"fbclid":null,"li_fat_id":null,"msclkid":null,"rdt_cid":null,"twclid":null,"oppref":null,"tblci":null,"obclid":null,"ttclid":null,"landing_page":"/pricing","full_url":"https://acme.com/pricing?utm_source=google&utm_medium=cpc","referrer_domain":"google.com","device_type":"desktop","os":"macOS","browser":"Chrome","country":"DE","city":"Berlin"}}}}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}},{"name":"click_id","in":"query","required":false,"description":"Max 255. Required unless email or phone is given.","schema":{"type":"string"}},{"name":"email","in":"query","required":false,"description":"Max 255.","schema":{"type":"string"}},{"name":"phone","in":"query","required":false,"description":"Max 64.","schema":{"type":"string"}}]}},"/v1/public/workspaces/{workspace}/leads/{lead}/journey":{"get":{"operationId":"leads-journey","summary":"Get a lead's journey","description":"The full timeline behind a lead: its conversions whole, its clicks paged oldest first.","tags":["Leads"],"security":[{"workspaceToken":["leads"]}],"responses":{"200":{"description":"meta paginates the clicks; the conversions come whole.","content":{"application/json":{"example":{"success":true,"data":{"lead":{"id":"5d6e7f80-1a2b-3c4d-5e6f-708192a3b4c5","click_id":"0c1d2e3f-4a5b-6c7d-8e9f-a0b1c2d3e4f5","email":"maria@example.com","phone":"+4915112345678","is_unattributed":false,"matched_by":"click_id","created_at":"2026-10-02T08:16:40Z","first_touch":{"clicked_at":"2026-10-02T08:14:03Z","channel":"Google Ads","channel_key":"google_ads","utm_source":"google","utm_medium":"cpc","utm_campaign":"brand-search","utm_content":null,"utm_term":"lead attribution","campaign":"Brand Search","campaign_id":"1234567890","ad_set":"Brand Exact","ad_set_id":"2345678901","ad":"RSA 1","ad_id":"3456789012","keyword":"lead attribution","keyword_id":"4567890123","placement":null,"gclid":"EAIaIQobChMI_example","wbraid":null,"gbraid":null,"fbclid":null,"li_fat_id":null,"msclkid":null,"rdt_cid":null,"twclid":null,"oppref":null,"tblci":null,"obclid":null,"ttclid":null,"landing_page":"/pricing","full_url":"https://acme.com/pricing?utm_source=google&utm_medium=cpc","referrer_domain":"google.com","device_type":"desktop","os":"macOS","browser":"Chrome","country":"DE","city":"Berlin"},"last_touch":{"clicked_at":"2026-10-02T08:14:03Z","channel":"Google Ads","channel_key":"google_ads","utm_source":"google","utm_medium":"cpc","utm_campaign":"brand-search","utm_content":null,"utm_term":"lead attribution","campaign":"Brand Search","campaign_id":"1234567890","ad_set":"Brand Exact","ad_set_id":"2345678901","ad":"RSA 1","ad_id":"3456789012","keyword":"lead attribution","keyword_id":"4567890123","placement":null,"gclid":"EAIaIQobChMI_example","wbraid":null,"gbraid":null,"fbclid":null,"li_fat_id":null,"msclkid":null,"rdt_cid":null,"twclid":null,"oppref":null,"tblci":null,"obclid":null,"ttclid":null,"landing_page":"/pricing","full_url":"https://acme.com/pricing?utm_source=google&utm_medium=cpc","referrer_domain":"google.com","device_type":"desktop","os":"macOS","browser":"Chrome","country":"DE","city":"Berlin"}},"conversions":[{"id":"11223344-5566-4788-99aa-bbccddeeff00","type":"Deal won","occurred_at":"2026-10-21T14:00:00Z","revenue":4800,"cash_collected":4800,"currency":"EUR","original_revenue":4800,"original_currency":"EUR","form_name":null,"first_source_channel":"Google Ads","first_source_channel_key":"google_ads","last_source_channel":"LinkedIn Ads","last_source_channel_key":"linkedin_ads"}],"clicks":[{"id":"aa00bb11-cc22-4d33-8e44-ff5566778899","clicked_at":"2026-10-02T08:14:03Z","channel":"Google Ads","channel_key":"google_ads","utm_source":"google","utm_medium":"cpc","utm_campaign":"brand-search","utm_content":null,"utm_term":"lead attribution","campaign":"Brand Search","campaign_id":"1234567890","ad_set":"Brand Exact","ad_set_id":"2345678901","ad":"RSA 1","ad_id":"3456789012","keyword":"lead attribution","keyword_id":"4567890123","placement":null,"gclid":"EAIaIQobChMI_example","wbraid":null,"gbraid":null,"fbclid":null,"li_fat_id":null,"msclkid":null,"rdt_cid":null,"twclid":null,"oppref":null,"tblci":null,"obclid":null,"ttclid":null,"landing_page":"/pricing","full_url":"https://acme.com/pricing?utm_source=google&utm_medium=cpc","referrer_domain":"google.com","device_type":"desktop","os":"macOS","browser":"Chrome","country":"DE","city":"Berlin"}]},"meta":{"current_page":1,"per_page":20,"last_page":1,"total":1,"max_per_page":50}}}}},"404":{"description":"not_found: The lead is not in this workspace."}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}},{"name":"lead","in":"path","required":true,"description":"The lead id (uuid) or a click_id.","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number. Defaults to 1, minimum 1.","schema":{"type":"integer"}},{"name":"per_page","in":"query","required":false,"description":"Items per page. Defaults to 20, maximum 50. A larger value is clamped to 50, a value below 1 falls back to 20.","schema":{"type":"integer"}}]}},"/v1/public/workspaces/{workspace}/tags/rule-fields":{"get":{"operationId":"tags-rule-fields","summary":"Describe the tag rule vocabulary","description":"Tag types, rule fields, operators, timing and the lists a rule value can come from.","tags":["Tags"],"security":[{"workspaceToken":["tags"]}],"responses":{"200":{"description":"Lists shortened. rule_fields ids: entry_page, entry_full_url, referrer_domain, landing_domain, traffic_channel, campaign, adset, ad, keyword, placement, form, form_url, source_integration, conversion_type, custom_field. operators: contains, equals, starts_with, ends_with, not_contains. integrations are the conversion sources (tracking, postback, gohighlevel, hubspot, salesforce, and more). timing holds a description of each mode.","content":{"application/json":{"example":{"success":true,"data":{"tag_types":["source","entry","action","lead","lead_type","product","funnel","referrer","status"],"rule_fields":[{"id":"entry_page","label":"Entry page","requires_field_key":false}],"operators":[{"id":"contains","label":"Contains"}],"rule_logic":["and","or"],"timing":{"anytime":"...","before_conversion":"..."},"integrations":[{"id":"hubspot","label":"HubSpot"}],"traffic_channels":[{"id":"google_ads","label":"Google Ads"}],"conversion_types":["Lead","Deal won"]}}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}}]}},"/v1/public/workspaces/{workspace}/tags":{"get":{"operationId":"tags-list","summary":"List tags","description":"Lists the workspace's tags with their rules, newest first.","tags":["Tags"],"security":[{"workspaceToken":["tags"]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"example":{"success":true,"data":[{"id":"a1f2e3d4-5c6b-7a89-90b1-c2d3e4f5a6b7","name":"Webinar lead","type":"funnel","color":"#03c879","rule_logic":"and","show_in_journey":true,"rules":[{"field":"entry_page","field_key":null,"operator":"contains","value":"/webinar","timing":"before_conversion","timing_event":null,"is_active":true}],"created_at":"2026-10-20T09:12:00Z"}],"meta":{"current_page":1,"per_page":20,"last_page":1,"total":1,"max_per_page":50}}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}},{"name":"page","in":"query","required":false,"description":"Page number. Defaults to 1, minimum 1.","schema":{"type":"integer"}},{"name":"per_page","in":"query","required":false,"description":"Items per page. Defaults to 20, maximum 50. A larger value is clamped to 50, a value below 1 falls back to 20.","schema":{"type":"integer"}}]},"post":{"operationId":"tags-create","summary":"Create a tag","description":"Creates a tag, optionally with rules and a backfill over existing data.","tags":["Tags"],"security":[{"workspaceToken":["tags"]}],"responses":{"201":{"description":"Successful response.","content":{"application/json":{"example":{"success":true,"data":{"id":"a1f2e3d4-5c6b-7a89-90b1-c2d3e4f5a6b7","name":"Webinar lead","type":"funnel","color":"#03c879","rule_logic":"and","show_in_journey":true,"rules":[{"field":"entry_page","field_key":null,"operator":"contains","value":"/webinar","timing":"before_conversion","timing_event":null,"is_active":true}],"created_at":"2026-10-20T09:12:00Z","backfill_queued":true}}}}},"422":{"description":"invalid_tag: The name is taken, or a custom_field rule has no field_key."}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"1 to 50 characters, unique in the workspace (a duplicate returns 422 invalid_tag)."},"type":{"type":"string","enum":["source","entry","action","lead","lead_type","product","funnel","referrer","status"],"description":"Tag type."},"color":{"type":"string","description":"#RRGGBB. Defaults to #03c879."},"show_in_journey":{"type":"boolean","description":"Show the tag in the lead journey."},"rule_logic":{"type":"string","enum":["and","or"],"description":"Defaults to and."},"rules":{"type":"array","items":{},"description":"Rules that apply the tag automatically."},"apply_to_existing":{"type":"boolean","description":"Queues a backfill over existing data, only if the tag has active rules."}},"required":["name","type"]}}}}}},"/v1/public/workspaces/{workspace}/tags/{tag}":{"get":{"operationId":"tags-get","summary":"Get a tag","description":"Returns one tag with its rules.","tags":["Tags"],"security":[{"workspaceToken":["tags"]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"example":{"success":true,"data":{"id":"a1f2e3d4-5c6b-7a89-90b1-c2d3e4f5a6b7","name":"Webinar lead","type":"funnel","color":"#03c879","rule_logic":"and","show_in_journey":true,"rules":[{"field":"entry_page","field_key":null,"operator":"contains","value":"/webinar","timing":"before_conversion","timing_event":null,"is_active":true}],"created_at":"2026-10-20T09:12:00Z"}}}}},"404":{"description":"not_found: The tag is not in this workspace."}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}},{"name":"tag","in":"path","required":true,"description":"Tag id.","schema":{"type":"string","format":"uuid"}}]},"patch":{"operationId":"tags-update","summary":"Update a tag","description":"Changes a tag. Same fields as create, all optional.","tags":["Tags"],"security":[{"workspaceToken":["tags"]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"example":{"success":true,"data":{"id":"a1f2e3d4-5c6b-7a89-90b1-c2d3e4f5a6b7","name":"Webinar lead","type":"funnel","color":"#2f80ed","rule_logic":"and","show_in_journey":false,"rules":[{"field":"entry_page","field_key":null,"operator":"contains","value":"/webinar","timing":"before_conversion","timing_event":null,"is_active":true}],"created_at":"2026-10-20T09:12:00Z","backfill_queued":false}}}}},"404":{"description":"not_found: The tag is not in this workspace."},"422":{"description":"invalid_tag: The name is taken, or a custom_field rule has no field_key."}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}},{"name":"tag","in":"path","required":true,"description":"Tag id.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"1 to 50 characters, unique in the workspace (a duplicate returns 422 invalid_tag)."},"type":{"type":"string","enum":["source","entry","action","lead","lead_type","product","funnel","referrer","status"],"description":"Tag type."},"color":{"type":"string","description":"#RRGGBB. Defaults to #03c879."},"show_in_journey":{"type":"boolean","description":"Show the tag in the lead journey. false is honoured."},"rule_logic":{"type":"string","enum":["and","or"],"description":"Defaults to and."},"rules":{"type":"array","items":{},"description":"Rules that apply the tag automatically."},"apply_to_existing":{"type":"boolean","description":"Queues a backfill over existing data, only if the tag has active rules."}}}}}}},"delete":{"operationId":"tags-delete","summary":"Delete a tag","description":"Deletes a tag.","tags":["Tags"],"security":[{"workspaceToken":["tags"]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"example":{"success":true,"data":{"id":"a1f2e3d4-5c6b-7a89-90b1-c2d3e4f5a6b7","name":"Webinar lead","deleted":true}}}}},"404":{"description":"not_found: The tag is not in this workspace."}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}},{"name":"tag","in":"path","required":true,"description":"Tag id.","schema":{"type":"string","format":"uuid"}}]}},"/v1/public/workspaces/{workspace}/tracking-domains":{"get":{"operationId":"tracking-domains-list","summary":"List tracking domains","description":"Lists the workspace's tracking domains, oldest first.","tags":["Tracking"],"security":[{"workspaceToken":["tracking"]}],"responses":{"200":{"description":"status is initialize, process, fail, success or disabled.","content":{"application/json":{"example":{"success":true,"data":[{"id":"c3d4e5f6-0718-293a-4b5c-6d7e8f901a2b","url":"track.acme.com","root_url":"acme.com","status":"success","status_meaning":"...","free_ssl":true,"cname_destination":"package.leadjourney.io","created_at":"2026-09-01T10:00:00Z"}],"meta":{"current_page":1,"per_page":20,"last_page":1,"total":1,"max_per_page":50}}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}},{"name":"page","in":"query","required":false,"description":"Page number. Defaults to 1, minimum 1.","schema":{"type":"integer"}},{"name":"per_page","in":"query","required":false,"description":"Items per page. Defaults to 20, maximum 50. A larger value is clamped to 50, a value below 1 falls back to 20.","schema":{"type":"integer"}}]},"post":{"operationId":"tracking-domains-create","summary":"Add a tracking domain","description":"Adds a tracking domain and starts its verification. Point a CNAME at package.leadjourney.io.","tags":["Tracking"],"security":[{"workspaceToken":["tracking"]}],"responses":{"201":{"description":"Successful response.","content":{"application/json":{"example":{"success":true,"data":{"id":"c3d4e5f6-0718-293a-4b5c-6d7e8f901a2b","url":"track.acme.com","status":"initialize","cname_destination":"package.leadjourney.io","next_step":"..."}}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"A bare host: no https://, no www., at least one dot, 5 to 253 characters. Must be unique across LeadJourney."},"root_url":{"type":"string","description":"Minimum 5 characters."}},"required":["url"]}}}}}},"/v1/public/workspaces/{workspace}/tracking-domains/{domain}":{"get":{"operationId":"tracking-domains-get","summary":"Get a tracking domain","description":"Returns one tracking domain and its verification status.","tags":["Tracking"],"security":[{"workspaceToken":["tracking"]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"example":{"success":true,"data":{"id":"c3d4e5f6-0718-293a-4b5c-6d7e8f901a2b","url":"track.acme.com","root_url":"acme.com","status":"success","status_meaning":"...","free_ssl":true,"cname_destination":"package.leadjourney.io","created_at":"2026-09-01T10:00:00Z"}}}}},"404":{"description":"not_found: The domain is not in this workspace."}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}},{"name":"domain","in":"path","required":true,"description":"Domain id.","schema":{"type":"string","format":"uuid"}}]},"patch":{"operationId":"tracking-domains-update","summary":"Update a tracking domain","description":"Changes the host or the root URL. Verification runs again for the new host.","tags":["Tracking"],"security":[{"workspaceToken":["tracking"]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"example":{"success":true,"data":{"id":"c3d4e5f6-0718-293a-4b5c-6d7e8f901a2b","url":"go.acme.com","root_url":"acme.com","status":"initialize","note":"..."}}}}},"404":{"description":"not_found: The domain is not in this workspace."},"422":{"description":"invalid_request: Neither url nor root_url was sent."}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}},{"name":"domain","in":"path","required":true,"description":"Domain id.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"Same rules as on create."},"root_url":{"type":"string","description":"Same rules as on create."}}}}}}},"delete":{"operationId":"tracking-domains-delete","summary":"Delete a tracking domain","description":"Deletes a tracking domain. Destructive: every link on that host stops working immediately.","tags":["Tracking"],"security":[{"workspaceToken":["tracking"]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"example":{"success":true,"data":{"id":"c3d4e5f6-0718-293a-4b5c-6d7e8f901a2b","url":"track.acme.com","deleted":true}}}}},"404":{"description":"not_found: The domain is not in this workspace."},"409":{"description":"confirmation_required: confirm: true was not sent. The message says how many short links are on the host."}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}},{"name":"domain","in":"path","required":true,"description":"Domain id.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"description":"Destructive. Requires confirm: true, otherwise 409 confirmation_required. Deleting a tracking domain breaks every link on that host, at once.","content":{"application/json":{"schema":{"type":"object","properties":{"confirm":{"type":"boolean","description":"Must be true. Read from the body or the query string."}},"required":["confirm"]}}}}}},"/v1/public/workspaces/{workspace}/tracking-domains/{domain}/retry":{"post":{"operationId":"tracking-domains-retry","summary":"Retry a domain's verification","description":"Resets a failed domain to initialize and queues its verification again.","tags":["Tracking"],"security":[{"workspaceToken":["tracking"]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"example":{"success":true,"data":{"id":"c3d4e5f6-0718-293a-4b5c-6d7e8f901a2b","url":"track.acme.com","status":"initialize","note":"..."}}}}},"404":{"description":"not_found: The domain is not in this workspace."},"422":{"description":"invalid_state: The domain's status is not fail."}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}},{"name":"domain","in":"path","required":true,"description":"Domain id.","schema":{"type":"string","format":"uuid"}}]}},"/v1/public/workspaces/{workspace}/tracking/onboarding-status":{"get":{"operationId":"tracking-onboarding-status","summary":"Get the onboarding status","description":"The workspace's onboarding state, the live tracking state and what still blocks it.","tags":["Tracking"],"security":[{"workspaceToken":["tracking"]}],"responses":{"200":{"description":"The onboarding object is shown with the keys documented here; it may carry more.","content":{"application/json":{"example":{"success":true,"data":{"onboarding":{"current_step":"tracking_script","completed_steps":["account_created","profile_setup","traffic_channels","ad_platforms","tracking_domain"],"is_completed":false,"checklist":{"account_created":true,"profile_setup":true,"traffic_channels":true,"ad_platforms":true,"tracking_domain":true,"tracking_script":false,"events":false,"contact_forms":false,"crm_webhooks":false},"stack":"...","existing_events":[],"owner_profile":{"first_name":"Maria","last_name":"Schulz","phone":"+4915112345678","email":"maria@example.com"},"company_info":{"name":"Acme GmbH","country":"DE","region":"Berlin","city":"Berlin","street":"Example Street 1","postal_code":"10115"},"timezone_info":{"time_zone":"Europe/Berlin","currency":"EUR","time_format":"24h"}},"live_state":{"tracking_domains":[{"url":"track.acme.com","status":"success"}],"verified_domains":1,"conversion_events":0},"blockers":["..."]}}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}}]}},"/v1/public/workspaces/{workspace}/tracking/verify-script":{"post":{"operationId":"tracking-verify-script","summary":"Check the tracking script","description":"Checks whether the tracking script is installed on a page.","tags":["Tracking"],"security":[{"workspaceToken":["tracking"]}],"responses":{"200":{"description":"Shown with the keys documented here; the check may return more.","content":{"application/json":{"example":{"success":true,"data":{"is_installed":true,"message":"...","checked_url":"https://acme.com/pricing","caveat":"..."}}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"Max 2048. https:// is prepended when no scheme is given, and a trailing / is stripped."}},"required":["url"]}}}}}},"/v1/public/workspaces/{workspace}/tracking/detect-stack":{"post":{"operationId":"tracking-detect-stack","summary":"Detect the website stack","description":"Detects the CMS of a site and the form builders on up to five pages, with instructions for each.","tags":["Tracking"],"security":[{"workspaceToken":["tracking"]}],"responses":{"200":{"description":"A form_builders item carries error when that page could not be checked.","content":{"application/json":{"example":{"success":true,"data":{"url":"https://acme.com","cms":"...","cms_error":null,"note":"...","form_builders":[{"url":"https://acme.com/contact","builder":"...","has_form":true,"has_lj_clickid":false,"instructions":"...","details":"...","knowledge_base_url":"..."}]}}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"Max 2048."},"form_urls":{"type":"array","items":{"type":"string"},"description":"At most 5 items, each max 2048. Defaults to [url]."}},"required":["url"]}}}}}},"/v1/public/workspaces/{workspace}/tracking/crm-webhook-info":{"get":{"operationId":"tracking-crm-webhook-info","summary":"Get the CRM webhook details","description":"The postback URL and secret, the parameters a CRM webhook sends, an example payload, the affiliate networks and the CRM's instructions. The answer contains the workspace's postback secret: treat it like a password.","tags":["Tracking"],"security":[{"workspaceToken":["tracking"]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"example":{"success":true,"data":{"postback_url":"...","postback_secret":"<postback secret>","authentication":{"method":"...","header_example":"...","query_example":"..."},"parameters":{"required_one_of":["..."],"required":["..."],"optional":["..."]},"conversion_types":["..."],"example_payload":{"...":"..."},"affiliate_networks":[{"slug":"...","label":"...","postback_url":"...","configured":false,"sources":[{"name":"...","api_key":"<api key>"}]}],"crm_instructions":"..."}}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}},{"name":"crm","in":"query","required":false,"description":"Max 100. Selects which CRM's instructions are returned.","schema":{"type":"string"}}]}},"/v1/public/workspaces/{workspace}/traffic-channels":{"get":{"operationId":"traffic-channels-list","summary":"List traffic channels","description":"Lists the workspace's traffic channels, built-in and custom, ordered by order. Deleted channels are left out.","tags":["Traffic channels, UTM & short links"],"security":[{"workspaceToken":["traffic_channels"]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"example":{"success":true,"data":[{"id":"9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d","key":"close_crm","label":"Close CRM","description":"Leads from Close's referral links","type":"other","is_active":true,"is_custom":true,"referrer_domains":["close.com"],"order":12}],"meta":{"current_page":1,"per_page":20,"last_page":1,"total":1,"max_per_page":50}}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}},{"name":"page","in":"query","required":false,"description":"Page number. Defaults to 1, minimum 1.","schema":{"type":"integer"}},{"name":"per_page","in":"query","required":false,"description":"Items per page. Defaults to 20, maximum 50. A larger value is clamped to 50, a value below 1 falls back to 20.","schema":{"type":"integer"}}]},"post":{"operationId":"traffic-channels-create","summary":"Create a traffic channel","description":"Creates a custom traffic channel. Its key is derived from the label: snake case, lower case.","tags":["Traffic channels, UTM & short links"],"security":[{"workspaceToken":["traffic_channels"]}],"responses":{"201":{"description":"Successful response.","content":{"application/json":{"example":{"success":true,"data":{"id":"9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d","key":"close_crm","label":"Close CRM","type":"other","is_active":true,"is_custom":true,"referrer_domains":["close.com"],"next_step":"..."}}}}},"422":{"description":"key_conflict: The derived key collides with a built-in key, or a channel with that name exists. referrer_conflict: Another channel already claims one of the domains."}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","description":"Max 255."},"description":{"type":"string","description":"Max 1000."},"traffic_channel_type":{"type":"string","enum":["paid","organic_search","ai_search","organic_social","other"],"description":"The channel's type."},"referrer_domains":{"type":"array","items":{"type":"string"},"description":"At most 20, each max 255 and a valid domain such as close.com."}},"required":["label","traffic_channel_type"]}}}}}},"/v1/public/workspaces/{workspace}/traffic-channels/{channel}":{"patch":{"operationId":"traffic-channels-update","summary":"Update a traffic channel","description":"Changes a channel. On a built-in channel only is_active can change. Renaming re-derives the key, and links published with the old key are no longer classified.","tags":["Traffic channels, UTM & short links"],"security":[{"workspaceToken":["traffic_channels"]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"example":{"success":true,"data":{"id":"9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d","key":"close_crm","label":"Close CRM","type":"other","is_active":false,"is_custom":true,"referrer_domains":["close.com"],"note":null}}}}},"404":{"description":"not_found: The channel is not in this workspace."},"422":{"description":"built_in_channel: Anything other than is_active was sent for a built-in channel. key_conflict: The new key collides with an existing one. referrer_conflict: Another channel already claims one of the domains. invalid_request: Nothing to change."}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}},{"name":"channel","in":"path","required":true,"description":"Channel id.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":false,"description":"Renaming a channel re-derives its key. The answer's note warns that links published with the old key will no longer be classified.","content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","description":"Max 255. Renaming re-derives the key."},"description":{"type":"string","description":"Max 1000."},"traffic_channel_type":{"type":"string","enum":["paid","organic_search","ai_search","organic_social","other"],"description":"The channel's type."},"is_active":{"type":"boolean","description":"The one field a built-in channel accepts."},"referrer_domains":{"type":"array","items":{"type":"string"},"description":"Replaces the whole list; [] clears it. Same limits as on create."}}}}}}},"delete":{"operationId":"traffic-channels-delete","summary":"Delete a traffic channel","description":"Soft deletes a custom channel. Built-in channels cannot be deleted.","tags":["Traffic channels, UTM & short links"],"security":[{"workspaceToken":["traffic_channels"]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"example":{"success":true,"data":{"id":"9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d","key":"close_crm","label":"Close CRM","deleted":true}}}}},"404":{"description":"not_found: The channel is not in this workspace."},"409":{"description":"confirmation_required: confirm: true was not sent."},"422":{"description":"built_in_channel: The channel is built in."}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}},{"name":"channel","in":"path","required":true,"description":"Channel id.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"description":"Destructive. Requires confirm: true, otherwise 409 confirmation_required.","content":{"application/json":{"schema":{"type":"object","properties":{"confirm":{"type":"boolean","description":"Must be true. Read from the body or the query string."}},"required":["confirm"]}}}}}},"/v1/public/workspaces/{workspace}/utm/channels":{"get":{"operationId":"utm-channels","summary":"List link channels","description":"Every channel a tracking link can be built for, by kind, with where its template goes. Not paginated.","tags":["Traffic channels, UTM & short links"],"security":[{"workspaceToken":["traffic_channels"]}],"responses":{"200":{"description":"Lists shortened. paid: meta_ads, linkedin_ads, google_ads, bing_ads, reddit_ads, x_ads, taboola_ads, outbrain_ads, tiktok_ads, chatgpt_ads. organic: linkedin_organic, youtube_organic, facebook_organic, instagram_organic, tiktok_organic, pinterest_organic, snapchat_organic. fixed: gmb. custom: the workspace's own channels.","content":{"application/json":{"example":{"success":true,"data":{"paid":[{"channel":"meta_ads","name":"Meta Ads","kind":"paid","where_to_add":"..."}],"organic":[{"channel":"linkedin_organic","name":"LinkedIn","kind":"organic","default_source":"...","default_medium":"...","suggested_contexts":["..."]}],"email":{"channel":"email","kind":"email","merge_tag_tools":["mailchimp","..."],"note":"..."},"fixed":[{"channel":"gmb","name":"Google Business Profile","kind":"fixed","lj_channel":"gmb","where_to_add":"..."}],"custom":[{"channel":"close_crm","name":"Close CRM","kind":"custom"}]}}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}}]}},"/v1/public/workspaces/{workspace}/utm/build":{"post":{"operationId":"utm-build","summary":"Build a tracking link","description":"Builds the tracking parameters or the full link for a channel. Pure computation, nothing is stored. The answer's shape depends on the channel's kind.","tags":["Traffic channels, UTM & short links"],"security":[{"workspaceToken":["traffic_channels"]}],"responses":{"200":{"description":"By kind. paid: { channel, kind, template, destination_url: null, where_to_add, note }, template being the platform's lj parameters plus utm ones when with_utm is true. organic: { channel, kind, parameters, url, suggested_contexts }. email: { channel, kind, parameters, url, note }, utm_source defaulting to email. fixed and custom: { channel, kind, parameters, url }, fixed adding where_to_add and note; the channel becomes lj_channel.","content":{"application/json":{"example":{"success":true,"data":{"channel":"linkedin_organic","kind":"organic","parameters":{"utm_source":"...","utm_medium":"...","utm_campaign":"october-webinar"},"url":"https://acme.com/webinar?utm_source=...&utm_medium=...&utm_campaign=october-webinar","suggested_contexts":["..."]}}}}},"422":{"description":"unknown_channel: The channel is not one of /utm/channels."}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"channel":{"type":"string","description":"Max 190. A channel from /utm/channels."},"destination_url":{"type":"string","description":"A URL, max 2048. Ignored for paid channels."},"with_utm":{"type":"boolean","description":"Paid channels only. Defaults to true: adds utm parameters to the platform's lj parameters."},"campaign":{"type":"string","description":"Max 190. Becomes utm_campaign, or lj_c_id on fixed and custom channels."},"content":{"type":"string","description":"Max 190. Becomes utm_content, or lj_ad_id on fixed and custom channels."},"term":{"type":"string","description":"Max 190. Becomes utm_term, or lj_as_id on fixed and custom channels."},"medium":{"type":"string","description":"Max 190. Becomes utm_medium, or lj_placement on fixed and custom channels."},"source":{"type":"string","description":"Max 190. Becomes utm_source."},"email_tool":{"type":"string","enum":["activecampaign","aweber","brevo","cleverreach","clickfunnels","convertkit","drip","everwebinar","getresponse","hubspot","intercom","kajabi","kartra","keap","klaviyo","lemlist","mailchimp","maropost","omnisend","ontraport","sendgrid","sendlane","sendy"],"description":"Email channel: sets the email parameter to this tool's merge tag."}},"required":["channel"]}}}}}},"/v1/public/workspaces/{workspace}/short-links":{"post":{"operationId":"short-links-create","summary":"Create a short link","description":"Creates a short link on a verified tracking domain.","tags":["Traffic channels, UTM & short links"],"security":[{"workspaceToken":["traffic_channels"]}],"responses":{"201":{"description":"Successful response.","content":{"application/json":{"example":{"success":true,"data":{"id":"7b6a5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d","short_url":"https://track.acme.com/october-webinar","destination_url":"https://acme.com/webinar?utm_source=linkedin","domain":"track.acme.com","slug":"october-webinar"}}}}},"404":{"description":"not_found: The domain is unknown."},"409":{"description":"slug_taken: The slug is already used on that domain."},"422":{"description":"invalid_slug: Nothing valid is left of the slug after sanitising. domain_not_verified: The domain's status is not success."}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain_id":{"type":"string","format":"uuid","description":"A tracking domain of this workspace whose status is success."},"slug":{"type":"string","description":"Max 64. Lowercased, spaces and underscores become -, other characters are stripped; the result must match ^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$."},"destination_url":{"type":"string","description":"A URL, max 2048."}},"required":["domain_id","slug","destination_url"]}}}}}},"/v1/public/workspaces/{workspace}/api-tokens":{"get":{"operationId":"api-tokens-list","summary":"List API tokens","description":"Lists the workspace's tokens, newest first. is_current marks the token making the request.","tags":["API tokens"],"security":[{"workspaceToken":["tokens"]}],"responses":{"200":{"description":"The hash and the plaintext never appear here.","content":{"application/json":{"example":{"success":true,"data":[{"id":"e5f6a7b8-c9d0-4e1f-8a2b-3c4d5e6f7a8b","name":"Reporting script","last_four":"XXXX","scopes":["reports","leads"],"active":true,"last_used_at":"2026-10-24T17:40:00Z","expires_at":"2027-10-01T23:59:59Z","revoked_at":null,"created_at":"2026-10-01T09:00:00Z","is_current":true}],"meta":{"current_page":1,"per_page":20,"last_page":1,"total":1,"max_per_page":50}}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}},{"name":"page","in":"query","required":false,"description":"Page number. Defaults to 1, minimum 1.","schema":{"type":"integer"}},{"name":"per_page","in":"query","required":false,"description":"Items per page. Defaults to 20, maximum 50. A larger value is clamped to 50, a value below 1 falls back to 20.","schema":{"type":"integer"}}]},"post":{"operationId":"api-tokens-create","summary":"Create an API token","description":"Mints a token for this workspace. The plaintext is in the answer once and never again. A token can only grant scopes the acting token holds.","tags":["API tokens"],"security":[{"workspaceToken":["tokens"]}],"responses":{"201":{"description":"created_by_user_id is copied from the token making the request.","content":{"application/json":{"example":{"success":true,"data":{"token":"ljw_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX","warning":"...","id":"e5f6a7b8-c9d0-4e1f-8a2b-3c4d5e6f7a8b","name":"Reporting script","last_four":"XXXX","scopes":["reports","leads"],"active":true,"last_used_at":"2026-10-24T17:40:00Z","expires_at":"2027-10-01T23:59:59Z","revoked_at":null,"created_at":"2026-10-01T09:00:00Z"}}}}},"403":{"description":"scope_escalation: A requested scope is one the acting token does not hold. scope_unavailable: agency.workspaces on a workspace that is not an agency HQ."},"422":{"description":"token_limit_reached: The workspace already has 5 active tokens."}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"description":"The plaintext token is returned once, in this answer. Store it before you do anything else.","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Max 255."},"scopes":{"type":"array","items":{"type":"string"},"enum":["reports","tags","leads","tracking","traffic_channels","agency.workspaces","tokens"],"description":"At least one valid scope."},"expires_at":{"type":"string","format":"date-time","description":"After now and at most 360 days ahead. Left out, the token never expires."}},"required":["name","scopes"]}}}}}},"/v1/public/workspaces/{workspace}/api-tokens/{token}":{"delete":{"operationId":"api-tokens-delete","summary":"Revoke an API token","description":"Revokes a token (it is kept with revoked_at set). A token may revoke itself; was_current says it did.","tags":["API tokens"],"security":[{"workspaceToken":["tokens"]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"example":{"success":true,"data":{"id":"e5f6a7b8-c9d0-4e1f-8a2b-3c4d5e6f7a8b","name":"Reporting script","last_four":"XXXX","scopes":["reports","leads"],"active":false,"last_used_at":"2026-10-24T17:40:00Z","expires_at":"2027-10-01T23:59:59Z","revoked_at":"2026-10-25T10:00:00Z","created_at":"2026-10-01T09:00:00Z","was_current":false}}}}},"404":{"description":"not_found: The token is not in this workspace."}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}},{"name":"token","in":"path","required":true,"description":"Token id.","schema":{"type":"string","format":"uuid"}}]}},"/v1/public/workspaces/{workspace}/agency/workspaces":{"get":{"operationId":"agency-workspaces-list","summary":"List client workspaces","description":"Lists the agency's client workspaces and its plan quota. Not paginated. The answer contains each workspace's postback secret.","tags":["Agency client workspaces"],"security":[{"workspaceToken":["agency.workspaces"]}],"responses":{"200":{"description":"role, has_full_access, permissions, report_permissions and allowed_traffic_channel_ids describe the agency's access to that workspace.","content":{"application/json":{"example":{"success":true,"data":[{"id":"3a4b5c6d-7e8f-4091-a2b3-c4d5e6f70819","name":"Client: Nordholm","postback_secret":"<postback secret>","role":"agency","has_full_access":true,"permissions":[],"report_permissions":[],"allowed_traffic_channel_ids":[],"onboarding_required":true,"monthly_advertising_spend":null,"tracking_v2_enabled":true,"link_decoration_enabled":false,"cookieless_tracking_enabled":false,"affiliate_features_enabled":false,"call_tracking_enabled":false,"chat_tracking_enabled":false,"audience_sync_enabled":false,"automations_enabled":false,"meta_postback_mode_enabled":false,"postback_timing_enabled":false,"blocked":{"is_blocked":false,"type":null,"reason":null,"blocked_at":null},"trial":{"is_on_trial":false,"trial_expired":false,"trial_ends_at":null,"has_subscription":true}}],"quota":{"used":4,"allowed":10,"is_unlimited":false,"remaining":6,"within_quota":true}}}}},"409":{"description":"not_an_agency: The workspace has no agency owner. not_agency_hq: The workspace is not the agency HQ."}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}}]},"post":{"operationId":"agency-workspaces-create","summary":"Create a client workspace","description":"Creates a real user account and workspace for a client, sends the invitation email and, by default, issues a provisioning token for it.","tags":["Agency client workspaces"],"security":[{"workspaceToken":["agency.workspaces"]}],"responses":{"201":{"description":"api_token is left out when issue_api_token is false.","content":{"application/json":{"example":{"success":true,"data":{"id":"3a4b5c6d-7e8f-4091-a2b3-c4d5e6f70819","name":"Client: Nordholm","...":"the workspace object, as in the list"},"api_token":{"token":"ljw_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX","warning":"...","expires_in_days":360,"id":"e5f6a7b8-c9d0-4e1f-8a2b-3c4d5e6f7a8b","name":"Agency provisioning","last_four":"XXXX","scopes":["reports","tags","leads","tracking","traffic_channels","tokens"],"active":true,"last_used_at":"2026-10-24T17:40:00Z","expires_at":"2027-10-01T23:59:59Z","revoked_at":null,"created_at":"2026-10-01T09:00:00Z"}}}}},"402":{"description":"plan_limit_reached: The plan's workspace quota is used up. Body: { message, error, limit, used, allowed }, with no success key. Until enforcement is switched on for the workspace the quota is recorded but not refused."},"409":{"description":"not_an_agency: The workspace has no agency owner. not_agency_hq: The workspace is not the agency HQ."},"429":{"description":"rate_limited: The 30 minute cooldown is running. Body carries scope: agency_workspace_creation and retry_after, plus a Retry-After header."}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id. Must be the token's own workspace.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"description":"One creation every 30 minutes per agency HQ (the cooldown starts only after a successful creation), and the plan's workspace quota applies. The provisioning token is named Agency provisioning, carries every scope except agency.workspaces (tokens included) and expires in 360 days.","content":{"application/json":{"schema":{"type":"object","properties":{"workspace_name":{"type":"string","description":"Max 255."},"first_name":{"type":"string","description":"Max 255."},"last_name":{"type":"string","description":"Max 255."},"email":{"type":"string","description":"A deliverable address (checked against DNS). The invitation goes here."},"phone":{"type":"string","description":"Max 50."},"issue_api_token":{"type":"boolean","description":"Defaults to true: the answer carries a provisioning token for the new workspace."}},"required":["workspace_name","first_name","last_name","email"]}}}}}},"/v1/profile":{"get":{"operationId":"get-profile","summary":"Get the authenticated user","description":"Returns the user that owns the API token. Used to validate a connection.","tags":["Account"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"example":{"success":true,"data":{"user":{"id":"9b1c0e2a-3f4d-4a6b-8c7e-1d2f3a4b5c6d","email":"owner@acme.com","has_verified_email":true,"current_workspace_id":"2f8a1b3c-4d5e-6f70-8192-a3b4c5d6e7f8"},"has_verified_email":true,"profile":{"first_name":"Jamie","last_name":"Rivera","company_name":"Acme Inc.","phone":"+15551234567"},"user_hash":"a1b2c3d4e5f6"}}}}}}}},"/v1/profile/workspaces":{"get":{"operationId":"list-workspaces","summary":"List accessible workspaces","description":"Lists every workspace the token can act on. The workspace id is used in the path of all workspace-scoped endpoints.","tags":["Account"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"example":{"success":true,"data":{"workspaces":[{"id":"2f8a1b3c-4d5e-6f70-8192-a3b4c5d6e7f8","name":"Acme Marketing","role":"owner","has_full_access":true,"onboarding_required":false,"tracking_v2_enabled":true,"trial":{"is_on_trial":false,"trial_expired":false,"trial_ends_at":null,"has_subscription":true}}]}}}}}}}},"/v1/workspaces/{workspace}/conversions":{"get":{"operationId":"list-conversions","summary":"List conversion types","description":"Returns the conversion types defined in the workspace.","tags":["Conversions & leads"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"example":{"success":true,"data":{"conversions":[{"id":"7c9e6a1b-2d3f-4051-8627-a8b9c0d1e2f3","type":"Purchase","default_key":null,"category":"Sales","mode":1,"send_to_ads":true,"include_revenue":true,"include_personal_details":false,"created_at":"2026-05-01T10:15:00Z","events_count":128,"latest_event_at":"2026-06-08T19:02:11Z"}]}}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id.","schema":{"type":"string","format":"uuid"}}]},"post":{"operationId":"create-conversion","summary":"Create a conversion type","description":"Creates a new conversion type in the workspace.","tags":["Conversions & leads"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"example":{"success":true}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"Conversion type name. Minimum 2 characters, unique per workspace."},"mode":{"type":"integer","enum":[1,2,3,4],"description":"Handling mode: 1 = create, 2 = ignore, 3 = edit, 4 = keep."},"send_to_ads":{"type":"boolean","description":"Forward matching conversions to connected ad platforms."},"description":{"type":"string","description":"Free-text description. Max 255 characters."},"category":{"type":"string","description":"Optional grouping category. Max 100 characters."},"include_revenue":{"type":"boolean","description":"Whether conversions of this type carry revenue."},"include_personal_details":{"type":"boolean","description":"Whether personal details are captured with this conversion."}},"required":["type","mode"]}}}}}},"/v1/workspaces/{workspace}/conversions/track":{"post":{"operationId":"track-conversion","summary":"Track a conversion","description":"Records a conversion event against a lead. The lead is resolved by click_id, then email, then phone, creating a synthetic lead when none matches. Provide a type to record a conversion, or a tag to only apply a webhook tag.","tags":["Conversions & leads"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"example":{"success":true}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":false,"description":"At least one of click_id, email, or phone must identify the lead.","content":{"application/json":{"schema":{"type":"object","properties":{"click_id":{"type":"string","format":"uuid","description":"LeadJourney click id. One of click_id, email, or phone is required."},"email":{"type":"string","description":"Lead email. Max 255 characters."},"phone":{"type":"string","description":"Lead phone. Max 50 characters."},"type":{"type":"string","description":"Conversion type name. Required unless a tag is provided."},"revenue":{"type":"string","description":"Revenue amount. Required when the conversion type carries revenue."},"cash_collected":{"type":"string","description":"Cash collected amount."},"currency":{"type":"string","description":"ISO 4217 currency code (3 letters), e.g. USD."},"first_name":{"type":"string","description":"First name. Max 255 characters."},"last_name":{"type":"string","description":"Last name. Max 255 characters."},"full_name":{"type":"string","description":"Full name. Split into first/last when those are absent. Max 511 characters."},"tag":{"type":"string","description":"Tag name to apply when no conversion type is sent. Max 50 characters."},"zip":{"type":"string","description":"Postal code. Max 20 characters."},"custom_fields":{"type":"object","additionalProperties":true,"description":"Key-value pairs validated against the workspace custom fields."}}}}}}}},"/v1/workspaces/{workspace}/conversions/track-lead":{"post":{"operationId":"track-lead","summary":"Track a lead","description":"Captures a lead's identity without a revenue conversion, using the workspace default lead conversion. Resolution and de-duplication run downstream.","tags":["Conversions & leads"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"example":{"success":true}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":false,"description":"At least one of email, phone, or click_id must be provided.","content":{"application/json":{"schema":{"type":"object","properties":{"click_id":{"type":"string","format":"uuid","description":"LeadJourney click id. One of click_id, email, or phone is required."},"email":{"type":"string","description":"Lead email. Max 255 characters."},"phone":{"type":"string","description":"Lead phone. Max 50 characters."},"first_name":{"type":"string","description":"First name. Max 255 characters."},"last_name":{"type":"string","description":"Last name. Max 255 characters."},"full_name":{"type":"string","description":"Full name. Split into first/last when those are absent. Max 511 characters."},"zip":{"type":"string","description":"Postal code. Max 20 characters."}}}}}}}},"/v1/workspaces/{workspace}/tags":{"get":{"operationId":"list-tags","summary":"List tags","description":"Returns the tags defined in the workspace, with their rules.","tags":["Tags"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"example":{"success":true,"data":{"tags":[{"id":"a1f2e3d4-5c6b-7a89-90b1-c2d3e4f5a6b7","name":"Newsletter","type":"source","color":"#03c879","rules":[],"created_at":"2026-04-12T08:00:00Z","updated_at":"2026-04-12T08:00:00Z"}]}}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id.","schema":{"type":"string","format":"uuid"}}]},"post":{"operationId":"create-tag","summary":"Create a tag","description":"Creates a tag, optionally with auto-apply rules.","tags":["Tags"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"example":{"success":true,"data":{"tag":{"id":"a1f2e3d4-5c6b-7a89-90b1-c2d3e4f5a6b7","name":"VIP","type":"lead","color":"#03c879","rules":[],"created_at":"2026-06-09T12:00:00Z","updated_at":"2026-06-09T12:00:00Z"}}}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Tag name. 1 to 50 characters."},"type":{"type":"string","enum":["source","entry","action","lead","lead_type","product","funnel"],"description":"Tag type."},"color":{"type":"string","description":"Hex color (#RRGGBB). Defaults to #03c879."},"rule_logic":{"type":"string","enum":["and","or"],"description":"How rules combine. Defaults to and."},"rules":{"type":"array","items":{},"description":"Auto-apply rules. Each rule has field (entry_page | entry_full_url | referrer_domain), operator (contains | equals | starts_with | ends_with | not_contains), value, optional timing (anytime | before_conversion), timing_event, and is_active."},"apply_to_existing":{"type":"boolean","description":"Apply the tag to existing leads matching the rules."}},"required":["name","type"]}}}}}},"/v1/workspaces/{workspace}/zapier/leads/{lead}/tags/{tag}":{"post":{"operationId":"apply-tag","summary":"Apply a tag to a lead","description":"Attaches an existing tag to an existing lead.","tags":["Tags"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"example":{"success":true,"data":{"message":"Tag assigned successfully"}}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id.","schema":{"type":"string","format":"uuid"}},{"name":"lead","in":"path","required":true,"description":"Lead id.","schema":{"type":"string","format":"uuid"}},{"name":"tag","in":"path","required":true,"description":"Tag id.","schema":{"type":"string","format":"uuid"}}]}},"/v1/workspaces/{workspace}/custom-fields":{"get":{"operationId":"list-custom-fields","summary":"List custom fields","description":"Returns the custom fields defined in the workspace.","tags":["Custom fields"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"example":{"success":true,"data":{"custom_fields":[{"id":14,"name":"Plan","key":"plan","type":"text","available_in_reports":true,"is_default":false,"is_locked":false,"sort_order":3,"created_at":"2026-03-20T09:30:00Z","updated_at":"2026-03-20T09:30:00Z"}]}}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id.","schema":{"type":"string","format":"uuid"}}]},"post":{"operationId":"create-custom-field","summary":"Create a custom field","description":"Creates a custom field. Up to 50 user-defined fields per workspace.","tags":["Custom fields"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"example":{"success":true,"data":{"custom_field":{"id":21,"name":"Plan","key":"plan","type":"text","available_in_reports":true,"is_default":false,"is_locked":false,"sort_order":4,"created_at":"2026-06-09T12:00:00Z","updated_at":"2026-06-09T12:00:00Z"}}}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Display name. 1 to 80 characters."},"type":{"type":"string","enum":["text","number","currency"],"description":"Field data type."},"key":{"type":"string","description":"Webhook key (lowercase, starts with a letter, max 64, unique). Auto-generated from name when omitted."},"available_in_reports":{"type":"boolean","description":"Show the field in reports. Defaults to true."}},"required":["name","type"]}}}}}},"/v1/workspaces/{workspace}/custom-fields/{customField}":{"post":{"operationId":"update-custom-field","summary":"Update a custom field","description":"Updates a custom field's name, type or report visibility. The key cannot be changed.","tags":["Custom fields"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"example":{"success":true,"data":{"custom_field":{"id":21,"name":"Plan tier","key":"plan","type":"text","available_in_reports":false,"is_default":false,"is_locked":false,"sort_order":4,"created_at":"2026-06-09T12:00:00Z","updated_at":"2026-06-10T08:30:00Z"}}}}}},"403":{"description":"Fields managed by LeadJourney (is_locked: true): {\"message\": \"This custom field is managed by LeadJourney and cannot be edited.\"}"}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id.","schema":{"type":"string","format":"uuid"}},{"name":"customField","in":"path","required":true,"description":"Custom field id.","schema":{"type":"integer"}}],"requestBody":{"required":false,"description":"Every field is optional. The key cannot be changed.","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Display name. 1 to 80 characters."},"type":{"type":"string","enum":["text","number","currency"],"description":"Field data type."},"available_in_reports":{"type":"boolean","description":"Show the field in reports."}}}}}}},"delete":{"operationId":"delete-custom-field","summary":"Delete a custom field","description":"Deletes a custom field from the workspace.","tags":["Custom fields"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The body of a successful delete is not documented here."},"403":{"description":"Fields managed by LeadJourney (is_locked: true): {\"message\": \"This custom field is managed by LeadJourney and cannot be deleted.\"}"},"404":{"description":"The field belongs to another workspace."}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id.","schema":{"type":"string","format":"uuid"}},{"name":"customField","in":"path","required":true,"description":"Custom field id.","schema":{"type":"integer"}}]}},"/v1/workspaces/{workspace}/zapier/leads/find":{"get":{"operationId":"find-lead","summary":"Find a lead","description":"Looks up a single lead by click id, email, or phone. Returns null in data.lead when no match is found.","tags":["Lead lookup"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"example":{"success":true,"data":{"lead":{"id":"5d6e7f80-1a2b-3c4d-5e6f-708192a3b4c5","click_id":"0c1d2e3f-4a5b-6c7d-8e9f-a0b1c2d3e4f5","email":"lead@example.com","phone":null,"first_name":"Sam","last_name":"Lee","created_at":"2026-06-01T14:22:00Z","revenue":199,"conversions_count":2,"first_source":"google","last_source":"email","status":"converted","tags":[{"id":"a1f2e3d4-5c6b-7a89-90b1-c2d3e4f5a6b7","name":"Newsletter","color":"#03c879","type":"source","source":"rule"}],"custom_fields":{"plan":"pro"}}}}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id.","schema":{"type":"string","format":"uuid"}},{"name":"click_id","in":"query","required":false,"description":"LeadJourney click id. One of click_id, email, or phone is required.","schema":{"type":"string"}},{"name":"email","in":"query","required":false,"description":"Lead email.","schema":{"type":"string"}},{"name":"phone","in":"query","required":false,"description":"Lead phone.","schema":{"type":"string"}}]}},"/v1/workspaces/{workspace}/zapier/subscriptions":{"post":{"operationId":"create-subscription","summary":"Create a webhook subscription","description":"Registers a target URL to receive events. The response id is used to unsubscribe.","tags":["Webhooks (REST hooks)"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"example":{"success":true,"data":{"id":"9f8e7d6c-5b4a-3210-fedc-ba9876543210"}}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"event":{"type":"string","enum":["lead.created","conversion.created","click.created"],"description":"Event to subscribe to."},"target_url":{"type":"string","description":"HTTPS URL that receives the event payload. Max 2048 characters."}},"required":["event","target_url"]}}}}}},"/v1/workspaces/{workspace}/zapier/subscriptions/{subscription}":{"delete":{"operationId":"delete-subscription","summary":"Delete a webhook subscription","description":"Removes a webhook subscription by id.","tags":["Webhooks (REST hooks)"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"example":{"success":true}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id.","schema":{"type":"string","format":"uuid"}},{"name":"subscription","in":"path","required":true,"description":"Subscription id returned when it was created.","schema":{"type":"string","format":"uuid"}}]}},"/v1/workspaces/{workspace}/zapier/recent/leads":{"get":{"operationId":"recent-leads","summary":"Recent leads","description":"Returns the most recent leads. Used for trigger sample data and polling.","tags":["Recent items (polling)"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"example":{"success":true,"data":{"leads":[{"id":"5d6e7f80-1a2b-3c4d-5e6f-708192a3b4c5","click_id":"0c1d2e3f-4a5b-6c7d-8e9f-a0b1c2d3e4f5","email":"lead@example.com","phone":null,"first_name":"Sam","last_name":"Lee","created_at":"2026-06-08T14:22:00Z","revenue":199,"conversions_count":2,"first_source":"google","last_source":"email","status":"converted","tags":[]}]}}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id.","schema":{"type":"string","format":"uuid"}}]}},"/v1/workspaces/{workspace}/zapier/recent/conversions":{"get":{"operationId":"recent-conversions","summary":"Recent conversions","description":"Returns the most recent conversion events.","tags":["Recent items (polling)"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"example":{"success":true,"data":{"conversions":[{"id":"11223344-5566-7788-99aa-bbccddeeff00","click_id":"0c1d2e3f-4a5b-6c7d-8e9f-a0b1c2d3e4f5","email":"lead@example.com","phone":null,"conversion_type":"Purchase","revenue":199,"currency":"USD","first_name":"Sam","last_name":"Lee","created_at":"2026-06-08T15:10:00Z"}]}}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id.","schema":{"type":"string","format":"uuid"}}]}},"/v1/workspaces/{workspace}/zapier/recent/clicks":{"get":{"operationId":"recent-clicks","summary":"Recent clicks","description":"Returns the most recent click and pageview events.","tags":["Recent items (polling)"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"example":{"success":true,"data":{"clicks":[{"id":"aa00bb11-cc22-dd33-ee44-ff5566778899","click_id":"0c1d2e3f-4a5b-6c7d-8e9f-a0b1c2d3e4f5","entry_page":"/pricing","entry_full_url":"https://acme.com/pricing?utm_source=email","referer":"https://mail.google.com/","source":"email","campaign":"june-newsletter","created_at":"2026-06-08T13:05:00Z"}]}}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"Workspace id.","schema":{"type":"string","format":"uuid"}}]}}}}