{"openapi":"3.1.0","info":{"title":"FunnelCockpit API","version":"1.0.0","description":"Public FunnelCockpit API documentation.","x-logo":{"url":"https://static.funnelcockpit.com/assets/images/fc-logo/logo-light-mode.png","altText":"FunnelCockpit"}},"servers":[{"url":"https://api.funnelcockpit.com","description":"Production"}],"tags":[{"name":"Account"},{"name":"Funnels"},{"name":"Funnel Pages"},{"name":"Members Area"},{"name":"Email"},{"name":"CRM"},{"name":"Forms"},{"name":"Surveys"},{"name":"Webinars"}],"paths":{"/me":{"get":{"operationId":"getCurrentUser","summary":"Verify the current API user","tags":["Account"],"security":[{"privateApiKey":[]}],"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrentUser"},"example":{"name":"Jane Doe","email":"jane@example.com"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/funnels":{"get":{"operationId":"listFunnels","summary":"List funnels","tags":["Funnels"],"security":[{"privateApiKey":[]}],"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Funnel"}},"example":[{"_id":"funnel_123","name":"Main sales funnel","domain":"www.example.com","createdAt":"2026-05-18T09:00:00.000Z"}]}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/funnels/{funnelId}/redirects":{"post":{"operationId":"createFunnelRedirect","summary":"Create a funnel redirect","tags":["Funnels"],"security":[{"privateApiKey":[]}],"parameters":[{"name":"funnelId","in":"path","required":true,"description":"Funnel ID.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"properties":{"sourcePath":{"type":"string"},"targetUrl":{"type":"string"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"example":{"_id":"redirect_123","sourcePath":"/old-path","targetUrl":"https://www.example.com/new-path"}},"example":{"_id":"redirect_123","sourcePath":"/old-path","targetUrl":"https://www.example.com/new-path"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/funnel-pages":{"get":{"operationId":"listFunnelPages","summary":"List funnel pages","tags":["Funnel Pages"],"security":[{"privateApiKey":[]}],"parameters":[{"name":"funnelId","in":"query","required":false,"schema":{"type":"string"},"description":"Optional funnel ID filter."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FunnelPage"}},"example":[{"_id":"page_123","funnelId":"funnel_123","name":"Checkout","path":"/checkout"}]}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/funnel/{funnelId}/page/{id}":{"post":{"operationId":"updateFunnelPage","summary":"Update a funnel page","tags":["Funnel Pages"],"security":[{"privateApiKey":[]}],"parameters":[{"name":"funnelId","in":"path","required":true,"description":"Funnel ID.","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Funnel page ID.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"example":{"_id":"page_123","funnelId":"funnel_123","name":"Checkout","path":"/checkout"}},"example":{"_id":"page_123","funnelId":"funnel_123","name":"Checkout","path":"/checkout"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/members-area/{membersAreaId}/members":{"get":{"operationId":"listMembersAreaMembers","summary":"List members area members","tags":["Members Area"],"security":[{"privateApiKey":[]}],"parameters":[{"name":"membersAreaId","in":"path","required":true,"description":"Members area ID.","schema":{"type":"string"}},{"name":"email","in":"query","required":false,"schema":{"type":"string","format":"email"},"description":"Optional email filter."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1},"description":"Maximum number of records to return."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":0},"description":"Zero-based page number."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MembersAreaMember"}},"example":[{"id":"member_123","email":"member@example.com","firstName":"Jane","lastName":"Doe"}]}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/webinar/{id}/chat-message":{"get":{"operationId":"listWebinarChatMessages","summary":"List webinar chat messages","tags":["Webinars"],"security":[{"privateApiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Webinar ID.","schema":{"type":"string"}},{"name":"webinarViewerId","in":"query","required":false,"schema":{"type":"string"}},{"name":"fromDate","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"toDate","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1},"description":"Maximum number of records to return."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":0},"description":"Zero-based page number."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebinarChatMessages"},"example":{"messages":[{"webinarViewerId":"viewer_123","email":"viewer@example.com","firstName":"Jane","lastName":"Doe","text":"Thanks for the session.","createdAt":"2026-05-18T09:15:00.000Z"}],"pagination":{"page":0,"limit":25,"totalMessages":1,"totalPages":1}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/webinar/{id}/statistics":{"get":{"operationId":"getWebinarStatistics","summary":"Get webinar statistics","tags":["Webinars"],"security":[{"privateApiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Webinar ID.","schema":{"type":"string"}},{"name":"startDate","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"endDate","in":"query","required":false,"schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebinarStatistics"},"example":{"name":"Product demo","duration":3600,"viewers":120,"viewersViewed":96,"participationRate":80,"criticalPoint":"00:42:00","timeline":[{"time":0,"viewers":120},{"time":1800,"viewers":108}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/email/contacts":{"get":{"operationId":"listEmailContacts","summary":"List email contacts","description":"Returns email contacts for the current API user.","tags":["Email"],"security":[{"privateApiKey":[]}],"parameters":[{"name":"tagId","in":"query","required":false,"schema":{"type":"string"}},{"name":"email","in":"query","required":false,"schema":{"type":"string","format":"email"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1},"description":"Maximum number of records to return."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":0},"description":"Zero-based page number."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EmailContact"}},"example":[{"_id":"contact_123","email":"contact@example.com","firstName":"Jane","lastName":"Doe","tagIds":["tag_123"],"crmIds":["crm_123"],"createdAt":"2026-05-18T09:00:00.000Z"}]}}},"401":{"description":"Private API key is missing."},"403":{"description":"Private API key is invalid or the plan is inactive."},"405":{"description":"Method not allowed."},"500":{"description":"Server error."}}}},"/email/fields":{"get":{"operationId":"listEmailFields","summary":"List email contact fields","tags":["Email"],"security":[{"privateApiKey":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1},"description":"Maximum number of records to return."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":0},"description":"Zero-based page number."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EmailContactField"}},"example":[{"_id":"field_123","name":"Birthday","type":"date"}]}}},"401":{"description":"Private API key is missing."},"403":{"description":"Private API key is invalid or the plan is inactive."},"405":{"description":"Method not allowed."},"500":{"description":"Server error."}}}},"/email/tags":{"get":{"operationId":"listEmailTags","summary":"List email tags","tags":["Email"],"security":[{"privateApiKey":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1},"description":"Maximum number of records to return."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":0},"description":"Zero-based page number."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EmailTag"}},"example":[{"_id":"tag_123","name":"Newsletter","createdAt":"2026-05-18T09:00:00.000Z"}]}}},"401":{"description":"Private API key is missing."},"403":{"description":"Private API key is invalid or the plan is inactive."},"405":{"description":"Method not allowed."},"500":{"description":"Server error."}}}},"/add-email-subscriber":{"post":{"operationId":"createOrUpdateEmailContact","summary":"Create or update an email contact","description":"Creates or updates an email contact and supports legacy opt-in form submissions.","tags":["Email"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEmailContactRequest"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/CreateEmailContactRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/CompatSuccess"},{"$ref":"#/components/schemas/CompatErrorResponse"}]},"example":{"success":true}}}},"400":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompatErrorResponse"},"example":{"error":"Invalid request."}}}}}}},"/email/subscribe":{"post":{"operationId":"subscribeEmailContact","summary":"Subscribe an email contact","description":"Subscribes an email address to a FunnelCockpit email tag. This endpoint is also used by public opt-in flows.","tags":["Email"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscribeEmailRequest"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/SubscribeEmailRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/CompatSuccess"},{"$ref":"#/components/schemas/CompatErrorResponse"}]},"example":{"success":true}}}},"400":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompatErrorResponse"},"example":{"error":"Invalid request."}}}}}}},"/email/tag":{"post":{"operationId":"assignEmailTag","summary":"Assign an email tag to a contact","tags":["Email"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["contactId","tagId"],"properties":{"contactId":{"type":"string"},"tagId":{"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["contactId","tagId"],"properties":{"contactId":{"type":"string"},"tagId":{"type":"string"}}}}}},"responses":{"200":{"description":"Tag assignment accepted."},"400":{"description":"Invalid request."},"404":{"description":"Tag not found."}}}},"/crms":{"get":{"operationId":"listCrms","summary":"List CRMs","tags":["CRM"],"security":[{"privateApiKey":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1},"description":"Maximum number of records to return."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":0},"description":"Zero-based page number."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Crm"}},"example":[{"_id":"crm_123","name":"Sales pipeline","createdAt":"2026-05-18T09:00:00.000Z"}]}}},"401":{"description":"Private API key is missing."},"403":{"description":"Private API key is invalid or the plan is inactive."},"405":{"description":"Method not allowed."},"500":{"description":"Server error."}}}},"/crm/{crmId}/contacts":{"get":{"operationId":"listCrmContacts","summary":"List CRM contacts","description":"Returns CRM contacts for a CRM.","tags":["CRM"],"security":[{"privateApiKey":[]}],"parameters":[{"name":"crmId","in":"path","required":true,"description":"CRM ID.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1},"description":"Maximum number of records to return."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":0},"description":"Zero-based page number."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EmailContact"}},"example":[{"_id":"contact_123","email":"contact@example.com","firstName":"Jane","lastName":"Doe","tagIds":["tag_123"],"crmIds":["crm_123"],"createdAt":"2026-05-18T09:00:00.000Z"}]}}},"401":{"description":"Private API key is missing."},"403":{"description":"Private API key is invalid or the plan is inactive."},"405":{"description":"Method not allowed."},"500":{"description":"Server error."}}}},"/crm/{crmId}/contact":{"post":{"operationId":"createOrUpdateCrmContact","summary":"Create or update a CRM contact","description":"Creates or updates a CRM contact.","tags":["CRM"],"parameters":[{"name":"crmId","in":"path","required":true,"description":"CRM ID.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCrmContactRequest"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/CreateCrmContactRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","required":["success","contactId"],"properties":{"success":{"type":"boolean","example":true},"contactId":{"type":"string"}}},"example":{"success":true,"contactId":"contact_123"}}}},"400":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompatErrorResponse"},"example":{"error":"Invalid request."}}}},"405":{"description":"Method not allowed."}}}},"/crm/{crmId}/tags":{"get":{"operationId":"listCrmTags","summary":"List CRM tags","tags":["CRM"],"security":[{"privateApiKey":[]}],"parameters":[{"name":"crmId","in":"path","required":true,"description":"CRM ID.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1},"description":"Maximum number of records to return."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":0},"description":"Zero-based page number."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CrmTag"}},"example":[{"tagId":"tag_123","name":"Qualified lead"}]}}},"401":{"description":"Private API key is missing."},"403":{"description":"Private API key is invalid or the plan is inactive."},"405":{"description":"Method not allowed."},"500":{"description":"Server error."}}}},"/crm/{crmId}/tag/{tagId}":{"get":{"operationId":"getCrmTag","summary":"Get a CRM tag","tags":["CRM"],"security":[{"privateApiKey":[]}],"parameters":[{"name":"crmId","in":"path","required":true,"description":"CRM ID.","schema":{"type":"string"}},{"name":"tagId","in":"path","required":true,"description":"CRM tag ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmTag"},"example":{"tagId":"tag_123","name":"Qualified lead"}}}},"401":{"description":"Private API key is missing."},"403":{"description":"Private API key is invalid or the plan is inactive."},"404":{"description":"CRM tag not found."},"500":{"description":"Server error."}}}},"/forms":{"get":{"operationId":"listForms","summary":"List forms","tags":["Forms"],"security":[{"privateApiKey":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1},"description":"Maximum number of records to return."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":0},"description":"Zero-based page number."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Form"}},"example":[{"_id":"form_123","name":"Lead form","createdAt":"2026-05-18T09:00:00.000Z"}]}}},"401":{"description":"Private API key is missing."},"403":{"description":"Private API key is invalid or the plan is inactive."},"405":{"description":"Method not allowed."},"500":{"description":"Server error."}}}},"/form/{formId}/submissions":{"get":{"operationId":"listFormSubmissions","summary":"List form submissions","description":"Returns form submissions for a form.","tags":["Forms"],"security":[{"privateApiKey":[]}],"parameters":[{"name":"formId","in":"path","required":true,"description":"Form ID.","schema":{"type":"string"}},{"name":"pageSize","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":25}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1},"description":"Maximum number of records to return."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":0},"description":"Zero-based page number."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FormSubmission"}},"example":[{"_id":"submission_123","formId":"form_123","formName":"Lead form","createdAt":"2026-05-18T09:05:00.000Z"}]}}},"401":{"description":"Private API key is missing."},"403":{"description":"Private API key is invalid or the plan is inactive."},"405":{"description":"Method not allowed."},"500":{"description":"Server error."}}}},"/form/{formId}/webhook":{"post":{"operationId":"registerFormWebhook","summary":"Register a form webhook","description":"Registers an automation webhook URL for an instant trigger.","tags":["Forms"],"security":[{"privateApiKey":[]}],"parameters":[{"name":"formId","in":"path","required":true,"description":"Form ID.","schema":{"type":"string"}},{"name":"webhookUrl","in":"query","required":true,"schema":{"type":"string","format":"uri"},"description":"Webhook URL to register or remove."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompatSuccess"},"example":{"success":true}}}},"400":{"description":"Invalid webhook request."},"401":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompatErrorResponse"},"example":{"error":"Invalid request."}}}},"404":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompatErrorResponse"},"example":{"error":"Invalid request."}}}},"500":{"description":"Server error."}}},"delete":{"operationId":"deleteFormWebhook","summary":"Delete a form webhook","description":"Removes an automation webhook URL for an instant trigger.","tags":["Forms"],"security":[{"privateApiKey":[]}],"parameters":[{"name":"formId","in":"path","required":true,"description":"Form ID.","schema":{"type":"string"}},{"name":"webhookUrl","in":"query","required":true,"schema":{"type":"string","format":"uri"},"description":"Webhook URL to register or remove."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompatSuccess"},"example":{"success":true}}}},"400":{"description":"Invalid webhook request."},"401":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompatErrorResponse"},"example":{"error":"Invalid request."}}}},"404":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompatErrorResponse"},"example":{"error":"Invalid request."}}}},"500":{"description":"Server error."}}}},"/surveys":{"get":{"operationId":"listSurveys","summary":"List surveys","tags":["Surveys"],"security":[{"privateApiKey":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1},"description":"Maximum number of records to return."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":0},"description":"Zero-based page number."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Survey"}},"example":[{"_id":"survey_123","name":"Customer feedback","createdAt":"2026-05-18T09:00:00.000Z"}]}}},"401":{"description":"Private API key is missing."},"403":{"description":"Private API key is invalid or the plan is inactive."},"405":{"description":"Method not allowed."},"500":{"description":"Server error."}}}},"/survey/{surveyId}/results":{"get":{"operationId":"listSurveyResults","summary":"List survey results","description":"Returns survey results for a survey.","tags":["Surveys"],"security":[{"privateApiKey":[]}],"parameters":[{"name":"surveyId","in":"path","required":true,"description":"Survey ID.","schema":{"type":"string"}},{"name":"pageSize","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1},"description":"Maximum number of records to return."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":0},"description":"Zero-based page number."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SurveyResult"}},"example":[{"_id":"result_123","surveyId":"survey_123","answers":["Very satisfied","Email"],"createdAt":"2026-05-18T09:10:00.000Z"}]}}},"401":{"description":"Private API key is missing."},"403":{"description":"Private API key is invalid or the plan is inactive."},"405":{"description":"Method not allowed."},"500":{"description":"Server error."}}}},"/survey/{surveyId}/webhook":{"post":{"operationId":"registerSurveyWebhook","summary":"Register a survey webhook","description":"Registers an automation webhook URL for an instant trigger.","tags":["Surveys"],"security":[{"privateApiKey":[]}],"parameters":[{"name":"surveyId","in":"path","required":true,"description":"Survey ID.","schema":{"type":"string"}},{"name":"webhookUrl","in":"query","required":true,"schema":{"type":"string","format":"uri"},"description":"Webhook URL to register or remove."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompatSuccess"},"example":{"success":true}}}},"400":{"description":"Invalid webhook request."},"401":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompatErrorResponse"},"example":{"error":"Invalid request."}}}},"404":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompatErrorResponse"},"example":{"error":"Invalid request."}}}},"500":{"description":"Server error."}}},"delete":{"operationId":"deleteSurveyWebhook","summary":"Delete a survey webhook","description":"Removes an automation webhook URL for an instant trigger.","tags":["Surveys"],"security":[{"privateApiKey":[]}],"parameters":[{"name":"surveyId","in":"path","required":true,"description":"Survey ID.","schema":{"type":"string"}},{"name":"webhookUrl","in":"query","required":true,"schema":{"type":"string","format":"uri"},"description":"Webhook URL to register or remove."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompatSuccess"},"example":{"success":true}}}},"400":{"description":"Invalid webhook request."},"401":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompatErrorResponse"},"example":{"error":"Invalid request."}}}},"404":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompatErrorResponse"},"example":{"error":"Invalid request."}}}},"500":{"description":"Server error."}}}},"/webinars":{"get":{"operationId":"listWebinars","summary":"List webinars","description":"Returns webinars for a valid private API key. For legacy compatibility, missing or invalid API keys return HTTP 200 with an empty body.","tags":["Webinars"],"security":[{"privateApiKey":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1},"description":"Maximum number of records to return."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":0},"description":"Zero-based page number."}],"responses":{"200":{"description":"Returns a webinar list. Missing or invalid API keys return an empty 200 response.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Webinar"}},"example":[{"_id":"webinar_123","name":"Product demo","createdAt":"2026-05-18T09:00:00.000Z"}]}}},"500":{"description":"Server error."}}}},"/webinar/{webinarId}/viewers":{"get":{"operationId":"listWebinarViewers","summary":"List webinar viewers","description":"Returns webinar viewers for a webinar.","tags":["Webinars"],"security":[{"privateApiKey":[]}],"parameters":[{"name":"webinarId","in":"path","required":true,"description":"Webinar ID.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1},"description":"Maximum number of records to return."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":0},"description":"Zero-based page number."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WebinarViewer"}},"example":[{"_id":"viewer_123","webinarId":"webinar_123","email":"viewer@example.com","firstName":"Jane","lastName":"Doe","webinarStartDate":"2026-05-19T15:00:00.000Z","createdAt":"2026-05-18T09:00:00.000Z"}]}}},"401":{"description":"Private API key is missing."},"403":{"description":"Private API key is invalid or the plan is inactive."},"405":{"description":"Method not allowed."},"500":{"description":"Server error."}}}},"/webinar/{webinarId}/dates":{"get":{"operationId":"listWebinarDates","summary":"List upcoming webinar dates","description":"Returns upcoming webinar dates.","tags":["Webinars"],"security":[{"privateApiKey":[]}],"parameters":[{"name":"webinarId","in":"path","required":true,"description":"Webinar ID.","schema":{"type":"string"}},{"name":"count","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":3}},{"name":"nextFullHourOneOnly","in":"query","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"type":"string","format":"date-time"}},{"type":"array","items":{"$ref":"#/components/schemas/WebinarDate"}}]},"example":["2026-05-18T09:00:00.000Z"]}}},"401":{"description":"Private API key is missing."},"403":{"description":"Private API key is invalid or the plan is inactive."},"404":{"description":"Webinar not found."},"405":{"description":"Method not allowed."},"500":{"description":"Server error."}}}},"/webinar/add-viewer":{"post":{"operationId":"createWebinarViewer","summary":"Create a webinar viewer","description":"Creates a webinar viewer.","tags":["Webinars"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebinarViewerRequest"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/CreateWebinarViewerRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/CompatSuccess"},{"$ref":"#/components/schemas/CompatErrorResponse"}]},"example":{"success":true}}}},"400":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompatErrorResponse"},"example":{"error":"Invalid request."}}}}}}}},"components":{"securitySchemes":{"privateApiKey":{"type":"apiKey","in":"header","name":"Authorization","description":"Send the private API key directly in the Authorization header. Do not prefix it with Bearer."}},"headers":{"Authorization":{"description":"Private API key copied from FunnelCockpit settings.","schema":{"type":"string","example":"fc_private_api_key"}}},"responses":{"BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ErrorResponse"},{"$ref":"#/components/schemas/CompatErrorResponse"}]},"example":{"message":"Bad request.","error":{"message":"The request could not be processed."}}}}},"Unauthorized":{"description":"Missing, invalid, or inactive private API key.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ErrorResponse"},{"$ref":"#/components/schemas/CompatErrorResponse"}]},"example":{"message":"Bad request.","error":{"message":"The request could not be processed."}}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ErrorResponse"},{"$ref":"#/components/schemas/CompatErrorResponse"}]},"example":{"message":"Bad request.","error":{"message":"The request could not be processed."}}}}},"ServerError":{"description":"Server error.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ErrorResponse"},{"$ref":"#/components/schemas/CompatErrorResponse"}]},"example":{"message":"Bad request.","error":{"message":"The request could not be processed."}}}}}},"schemas":{"ErrorResponse":{"type":"object","required":["message","error"],"properties":{"message":{"type":"string"},"error":{"type":"object","additionalProperties":true}},"additionalProperties":true,"example":{"message":"Bad request.","error":{"message":"The request could not be processed."}}},"CompatErrorResponse":{"type":"object","properties":{"error":{"type":"string"}},"additionalProperties":true,"example":{"error":"Invalid request."}},"CompatSuccess":{"type":"object","properties":{"success":{"type":"boolean","example":true}},"additionalProperties":true,"example":{"success":true}},"CurrentUser":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","format":"email"}},"example":{"name":"Jane Doe","email":"jane@example.com"}},"Funnel":{"type":"object","additionalProperties":true,"example":{"_id":"funnel_123","name":"Main sales funnel","domain":"www.example.com","createdAt":"2026-05-18T09:00:00.000Z"}},"FunnelPage":{"type":"object","additionalProperties":true,"example":{"_id":"page_123","funnelId":"funnel_123","name":"Checkout","path":"/checkout"}},"MembersAreaMember":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string","format":"email"},"firstName":{"type":"string"},"lastName":{"type":"string"}},"example":{"id":"member_123","email":"member@example.com","firstName":"Jane","lastName":"Doe"}},"WebinarChatMessages":{"type":"object","properties":{"messages":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"webinarViewerId":{"type":"string"},"email":{"type":"string","format":"email"},"firstName":{"type":"string"},"lastName":{"type":"string"},"phone":{"type":"string"},"text":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}}}},"pagination":{"type":"object","properties":{"page":{"type":"integer"},"limit":{"type":"integer"},"totalMessages":{"type":"integer"},"totalPages":{"type":"integer"}}}},"example":{"messages":[{"webinarViewerId":"viewer_123","email":"viewer@example.com","firstName":"Jane","lastName":"Doe","text":"Thanks for the session.","createdAt":"2026-05-18T09:15:00.000Z"}],"pagination":{"page":0,"limit":25,"totalMessages":1,"totalPages":1}}},"WebinarStatistics":{"type":"object","additionalProperties":true,"properties":{"name":{"type":"string"},"duration":{"type":"number"},"viewers":{"type":"number"},"viewersViewed":{"type":"number"},"participationRate":{"type":"number"},"criticalPoint":{"type":"string"},"timeline":{"type":"array","items":{"type":"object","properties":{"time":{"type":"number"},"viewers":{"type":"number"}}}}},"example":{"name":"Product demo","duration":3600,"viewers":120,"viewersViewed":96,"participationRate":80,"criticalPoint":"00:42:00","timeline":[{"time":0,"viewers":120},{"time":1800,"viewers":108}]}},"EmailContact":{"type":"object","additionalProperties":true,"properties":{"_id":{"type":"string"},"email":{"type":"string","format":"email"},"firstName":{"type":"string"},"lastName":{"type":"string"},"company":{"type":"string"},"phone":{"type":"string"},"city":{"type":"string"},"zip":{"type":"string"},"country":{"type":"string"},"tagIds":{"type":"array","items":{"type":"string"}},"crmIds":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"}},"example":{"_id":"contact_123","email":"contact@example.com","firstName":"Jane","lastName":"Doe","tagIds":["tag_123"],"crmIds":["crm_123"],"createdAt":"2026-05-18T09:00:00.000Z"}},"EmailTag":{"type":"object","additionalProperties":true,"properties":{"_id":{"type":"string"},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"example":{"_id":"tag_123","name":"Newsletter","createdAt":"2026-05-18T09:00:00.000Z"}},"EmailContactField":{"type":"object","additionalProperties":true,"properties":{"_id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"}},"example":{"_id":"field_123","name":"Birthday","type":"date"}},"CreateEmailContactRequest":{"type":"object","required":["provider","email"],"properties":{"provider":{"type":"string","enum":["funnelcockpit","klicktipp","infusionsoft"],"example":"funnelcockpit"},"email":{"type":"string","format":"email"},"firstName":{"type":"string"},"lastName":{"type":"string"},"tagId":{"type":"string"},"apikey":{"type":"string"},"funnelId":{"type":"string"},"infusionsoftTagId":{"type":"string"},"company":{"type":"string"},"phone":{"type":"string"},"zip":{"type":"string"},"city":{"type":"string"},"country":{"type":"string"},"utmCampaign":{"type":"string"},"utmMedium":{"type":"string"},"utmSource":{"type":"string"},"utmTerm":{"type":"string"},"utmContent":{"type":"string"},"thanksPageUrl":{"type":"string","format":"uri"},"confirmPageUrl":{"type":"string","format":"uri"}}},"SubscribeEmailRequest":{"type":"object","required":["email","tagId"],"additionalProperties":true,"properties":{"email":{"type":"string","format":"email"},"firstName":{"type":"string"},"lastName":{"type":"string"},"tagId":{"type":"string"},"company":{"type":"string"},"phone":{"type":"string"},"zip":{"type":"string"},"city":{"type":"string"},"country":{"type":"string"},"utmCampaign":{"type":"string"},"utmMedium":{"type":"string"},"utmSource":{"type":"string"},"utmTerm":{"type":"string"},"utmContent":{"type":"string"},"thanksPageUrl":{"type":"string"},"confirmPageUrl":{"type":"string"},"digistore24AffiliateId":{"type":"string"},"recaptchaResponse":{"type":"string"}}},"Crm":{"type":"object","additionalProperties":true,"example":{"_id":"crm_123","name":"Sales pipeline","createdAt":"2026-05-18T09:00:00.000Z"}},"CrmTag":{"type":"object","additionalProperties":true,"properties":{"tagId":{"type":"string"},"name":{"type":"string"}},"example":{"tagId":"tag_123","name":"Qualified lead"}},"CreateCrmContactRequest":{"type":"object","required":["email"],"additionalProperties":true,"properties":{"email":{"type":"string","format":"email"},"firstName":{"type":"string"},"lastName":{"type":"string"},"avatarUrl":{"type":"string","format":"uri"},"phone":{"type":"string"},"city":{"type":"string"},"country":{"type":"string"},"zip":{"type":"string"},"company":{"type":"string"},"website":{"type":"string"},"notes":{"type":"string"},"utmSource":{"type":"string"},"utmMedium":{"type":"string"},"utmCampaign":{"type":"string"},"utmTerm":{"type":"string"},"utmContent":{"type":"string"}}},"Form":{"type":"object","additionalProperties":true,"example":{"_id":"form_123","name":"Lead form","createdAt":"2026-05-18T09:00:00.000Z"}},"FormSubmission":{"type":"object","additionalProperties":true,"properties":{"_id":{"type":"string"},"formId":{"type":"string"},"formName":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"example":{"_id":"submission_123","formId":"form_123","formName":"Lead form","createdAt":"2026-05-18T09:05:00.000Z"}},"Survey":{"type":"object","additionalProperties":true,"example":{"_id":"survey_123","name":"Customer feedback","createdAt":"2026-05-18T09:00:00.000Z"}},"SurveyResult":{"type":"object","additionalProperties":true,"properties":{"_id":{"type":"string"},"surveyId":{"type":"string"},"answers":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"}},"example":{"_id":"result_123","surveyId":"survey_123","answers":["Very satisfied","Email"],"createdAt":"2026-05-18T09:10:00.000Z"}},"Webinar":{"type":"object","additionalProperties":true,"example":{"_id":"webinar_123","name":"Product demo","createdAt":"2026-05-18T09:00:00.000Z"}},"WebinarViewer":{"type":"object","additionalProperties":true,"properties":{"_id":{"type":"string"},"webinarId":{"type":"string"},"email":{"type":"string","format":"email"},"firstName":{"type":"string"},"lastName":{"type":"string"},"webinarStartDate":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"}},"example":{"_id":"viewer_123","webinarId":"webinar_123","email":"viewer@example.com","firstName":"Jane","lastName":"Doe","webinarStartDate":"2026-05-19T15:00:00.000Z","createdAt":"2026-05-18T09:00:00.000Z"}},"WebinarDate":{"type":"object","properties":{"date":{"type":"string","format":"date-time"},"index":{"type":"integer"}},"example":{"date":"2026-05-19T15:00:00.000Z","index":0}},"CreateWebinarViewerRequest":{"type":"object","required":["webinarId","email","webinarStartDate"],"additionalProperties":true,"properties":{"webinarId":{"type":"string"},"email":{"type":"string","format":"email"},"firstName":{"type":"string"},"lastName":{"type":"string"},"webinarStartDate":{"type":"string","format":"date-time"},"emailContactId":{"type":"string"}}}}}}