{"openapi":"3.1.0","info":{"title":"PostHog Surveys (BYOK) API","version":"0.1.0","description":"PostHog Surveys (BYOK) lets an AI assistant read your own PostHog Surveys data through the PostHog Surveys API with a key you supply (personal API key (with the survey:read scope)). Read-only: 5 tools (list_surveys, get_survey, get_survey_stats, list_survey_question_labels, list_survey_activity). The BYOK key travels with each request, is used for that one call only and is never stored, logged or...\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://byok-posthog-surveys.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"agent@connectorbay.com","url":"https://connectorbay.com/byok-posthog-surveys/docs"},"termsOfService":"https://connectorbay.com/byok-posthog-surveys/terms"},"servers":[{"url":"https://byok-posthog-surveys.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/byok-posthog-surveys/docs"},"security":[{"upstreamKey":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Optional. A Pro API key raises rate limits; no credentials are required."},"upstreamKey":{"type":"apiKey","in":"header","name":"X-Upstream-Key","description":"Your own key for the service this connector wraps (bring your own key). Used for that one call only; never stored, logged or cached."}},"schemas":{"Error":{"type":"object","properties":{"ok":{"const":false},"error":{"type":"object"}}}}},"paths":{"/v1/tools/list_surveys":{"post":{"operationId":"list_surveys","summary":"List the surveys of a project with name, type, schedule, start and end dates, archive state and response limit. Filter b","description":"List the surveys of a project with name, type, schedule, start and end dates, archive state and response limit. Filter by status, type or text. Use for \"Which surveys are running in my PostHog project\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"region":{"description":"PostHog Cloud region of your account: us (us.posthog.com) or eu (eu.posthog.com).","enum":["us","eu"],"title":"Region","type":"string"},"project_id":{"description":"PostHog project id (a number, see the PostHog connector list_projects).","maxLength":200,"title":"Project Id","type":"string"},"status":{"anyOf":[{"enum":["complete","draft","running"],"type":"string"},{"type":"null"}],"default":null,"description":"Only surveys in this state.","title":"Status"},"type":{"anyOf":[{"enum":["api","external_survey","popover","widget"],"type":"string"},{"type":"null"}],"default":null,"description":"Only surveys of this type.","title":"Type"},"archived":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"description":"True to list only archived surveys.","title":"Archived"},"search":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Only surveys whose name matches this text.","title":"Search"},"linked_flag_id":{"anyOf":[{"maximum":2147483647,"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"description":"Only surveys linked to the feature flag with this numeric id.","title":"Linked Flag Id"},"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":20,"description":"How many results to return per page (1 to 100).","title":"Limit"},"offset":{"anyOf":[{"maximum":100000,"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"How many results to skip, for paging.","title":"Offset"}},"required":["region","project_id"],"title":"list_surveysArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_survey":{"post":{"operationId":"get_survey","summary":"Get one survey with its settings and its full list of questions, display conditions and appearance. Use for \"Show the qu","description":"Get one survey with its settings and its full list of questions, display conditions and appearance. Use for \"Show the questions of PostHog survey 497f6eca\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"region":{"description":"PostHog Cloud region of your account: us (us.posthog.com) or eu (eu.posthog.com).","enum":["us","eu"],"title":"Region","type":"string"},"project_id":{"description":"PostHog project id (a number, see the PostHog connector list_projects).","maxLength":200,"title":"Project Id","type":"string"},"survey_id":{"description":"Survey id (a UUID) from list_surveys.","maxLength":60,"title":"Survey Id","type":"string"}},"required":["region","project_id","survey_id"],"title":"get_surveyArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_survey_stats":{"post":{"operationId":"get_survey_stats","summary":"Get response statistics of one survey (events shown, dismissed and sent, unique respondents) and the derived rates, opti","description":"Get response statistics of one survey (events shown, dismissed and sent, unique respondents) and the derived rates, optionally within a date range. Use for \"How many responses did PostHog survey 497f6eca get\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"region":{"description":"PostHog Cloud region of your account: us (us.posthog.com) or eu (eu.posthog.com).","enum":["us","eu"],"title":"Region","type":"string"},"project_id":{"description":"PostHog project id (a number, see the PostHog connector list_projects).","maxLength":200,"title":"Project Id","type":"string"},"survey_id":{"description":"Survey id (a UUID) from list_surveys.","maxLength":60,"title":"Survey Id","type":"string"},"date_from":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"Only count events after this ISO 8601 time, for example 2026-09-01T00:00:00Z.","title":"Date From"},"date_to":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"Only count events before this ISO 8601 time.","title":"Date To"},"exclude_archived":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":false,"description":"True to leave archived responses out of the counts.","title":"Exclude Archived"}},"required":["region","project_id","survey_id"],"title":"get_survey_statsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_survey_question_labels":{"post":{"operationId":"list_survey_question_labels","summary":"List the question texts of all surveys of a project with their question id, position and survey, to read survey response","description":"List the question texts of all surveys of a project with their question id, position and survey, to read survey response property keys as words. Use for \"What do the PostHog survey question ids stand for\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"region":{"description":"PostHog Cloud region of your account: us (us.posthog.com) or eu (eu.posthog.com).","enum":["us","eu"],"title":"Region","type":"string"},"project_id":{"description":"PostHog project id (a number, see the PostHog connector list_projects).","maxLength":200,"title":"Project Id","type":"string"}},"required":["region","project_id"],"title":"list_survey_question_labelsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_survey_activity":{"post":{"operationId":"list_survey_activity","summary":"List the change history of one survey: what happened, when, and the survey name; people are left out. Use for \"What chan","description":"List the change history of one survey: what happened, when, and the survey name; people are left out. Use for \"What changes were made to PostHog survey 497f6eca\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"region":{"description":"PostHog Cloud region of your account: us (us.posthog.com) or eu (eu.posthog.com).","enum":["us","eu"],"title":"Region","type":"string"},"project_id":{"description":"PostHog project id (a number, see the PostHog connector list_projects).","maxLength":200,"title":"Project Id","type":"string"},"survey_id":{"description":"Survey id (a UUID) from list_surveys.","maxLength":60,"title":"Survey Id","type":"string"},"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":10,"description":"How many entries to return per page (1 to 100).","title":"Limit"},"page":{"anyOf":[{"maximum":10000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"}},"required":["region","project_id","survey_id"],"title":"list_survey_activityArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}}}}