{"openapi":"3.1.0","info":{"title":"LeadJourney API","version":"1.0.0","description":"REST API powering the LeadJourney Zapier integration. Authenticate with a personal API token sent as a Bearer credential. Create a token in LeadJourney under Settings, then API & Integrations. Successful responses are wrapped as { success: true, data: { ... } }."},"servers":[{"url":"https://api.leadjourney.io/api","description":"Production"}],"security":[{"bearerAuth":[]}],"tags":[{"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 and create 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":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Personal API token from LeadJourney Settings, then API & Integrations."}}},"paths":{"/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"],"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"],"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"],"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"],"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"],"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,"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"],"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,"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"],"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"],"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"],"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"],"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"],"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}/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"],"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)"],"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)"],"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)"],"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)"],"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)"],"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"}}]}}}}