{"openapi":"3.1.0","info":{"title":"PostHog Audiences and Actions (BYOK) API","version":"0.1.0","description":"PostHog Audiences and Actions (BYOK) lets an AI assistant read your own PostHog Audiences and Actions data through the PostHog Audiences and Actions API with a key you supply (personal API key (with cohort:read, action:read and annotation:read scopes)). Read-only: 7 tools (list_cohorts, get_cohort, get_cohort_usage, list_actions, get_action, list_annotations, get_annotation). The BYOK key travels...\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://byok-posthog-cohorts-actions.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"agent@connectorbay.com","url":"https://connectorbay.com/byok-posthog-cohorts-actions/docs"},"termsOfService":"https://connectorbay.com/byok-posthog-cohorts-actions/terms"},"servers":[{"url":"https://byok-posthog-cohorts-actions.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/byok-posthog-cohorts-actions/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_cohorts":{"post":{"operationId":"list_cohorts","summary":"List the cohorts (saved groups of users) of a project with name, size, static flag and last calculation time; members ar","description":"List the cohorts (saved groups of users) of a project with name, size, static flag and last calculation time; members are not returned. Use for \"Which cohorts exist 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"},"search":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Only cohorts whose name matches this text.","title":"Search"},"hide_behavioral_cohorts":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":false,"description":"True to leave out cohorts defined by behavior.","title":"Hide Behavioral Cohorts"},"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_cohortsArguments","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_cohort":{"post":{"operationId":"get_cohort","summary":"Get one cohort with its name, description, size, calculation state and filter definition; members are not returned. Use ","description":"Get one cohort with its name, description, size, calculation state and filter definition; members are not returned. Use for \"Show the definition of PostHog cohort 5\".","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"},"cohort_id":{"description":"Cohort id (an integer) from list_cohorts.","maximum":2147483647,"minimum":1,"title":"Cohort Id","type":"integer"}},"required":["region","project_id","cohort_id"],"title":"get_cohortArguments","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_cohort_usage":{"post":{"operationId":"get_cohort_usage","summary":"Show where a cohort is used: the feature flags, insights, other cohorts and workflows that depend on it. Use for \"What d","description":"Show where a cohort is used: the feature flags, insights, other cohorts and workflows that depend on it. Use for \"What depends on PostHog cohort 5\".","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"},"cohort_id":{"description":"Cohort id (an integer) from list_cohorts.","maximum":2147483647,"minimum":1,"title":"Cohort Id","type":"integer"}},"required":["region","project_id","cohort_id"],"title":"get_cohort_usageArguments","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_actions":{"post":{"operationId":"list_actions","summary":"List the actions (named groups of events and clicks) of a project with name, tags, Slack posting flag and last calculati","description":"List the actions (named groups of events and clicks) of a project with name, tags, Slack posting flag and last calculation time. Use for \"Which actions are defined 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"},"search":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Only actions whose name matches this text.","title":"Search"},"tags":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Only actions with this tag.","title":"Tags"},"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_actionsArguments","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_action":{"post":{"operationId":"get_action","summary":"Get one action with its name, tags and the steps (event, selector, text, URL matching) that define it. Use for \"What doe","description":"Get one action with its name, tags and the steps (event, selector, text, URL matching) that define it. Use for \"What does PostHog action 3 match\".","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"},"action_id":{"description":"Action id (an integer) from list_actions.","maximum":2147483647,"minimum":1,"title":"Action Id","type":"integer"}},"required":["region","project_id","action_id"],"title":"get_actionArguments","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_annotations":{"post":{"operationId":"list_annotations","summary":"List the annotations (notes marking dates such as a release) of a project with text, date, scope and linked dashboard or","description":"List the annotations (notes marking dates such as a release) of a project with text, date, scope and linked dashboard or insight; authors are left out. Use for \"What annotations are on my PostHog charts\".","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"},"search":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Only annotations whose text matches this.","title":"Search"},"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_annotationsArguments","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_annotation":{"post":{"operationId":"get_annotation","summary":"Get one annotation with its text, date marker, scope and linked dashboard or insight. Use for \"Show PostHog annotation 9","description":"Get one annotation with its text, date marker, scope and linked dashboard or insight. Use for \"Show PostHog annotation 9\".","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"},"annotation_id":{"description":"Annotation id (an integer) from list_annotations.","maximum":2147483647,"minimum":1,"title":"Annotation Id","type":"integer"}},"required":["region","project_id","annotation_id"],"title":"get_annotationArguments","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}}}}