Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

33.4 KB
Raw Blame
{
    "count": 2,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": "0196b144-1f82-0000-0d0d-a01de54d674d",
            "type": "destination",
            "kind": null,
            "name": "Post to Slack on survey response",
            "description": "Posts a message to Slack when a user responds to a survey",
            "created_at": "2025-05-08T18:59:13.924809Z",
            "created_by": {
                "id": 1,
                "uuid": "0196900f-1824-0000-d3e0-f19bb3d70020",
                "distinct_id": "WudLIpIOOPgWUyhrq4VhgLB2R2T8585jfoqEIbO3ZTL",
                "first_name": "Ben",
                "last_name": "",
                "email": "[email protected]",
                "is_email_verified": true,
                "hedgehog_config": null,
                "role_at_organization": "engineering"
            },
            "updated_at": "2025-06-13T10:14:18.599846Z",
            "enabled": true,
            "hog": "let res := fetch('https://slack.com/api/chat.postMessage', {\n  'body': {\n    'channel': inputs.channel,\n    'icon_emoji': inputs.icon_emoji,\n    'username': inputs.username,\n    'blocks': inputs.blocks,\n    'text': inputs.text\n  },\n  'method': 'POST',\n  'headers': {\n    'Authorization': f'Bearer {inputs.slack_workspace.access_token}',\n    'Content-Type': 'application/json'\n  }\n});\n\nif (res.status != 200 or res.body.ok == false) {\n  throw Error(f'Failed to post message to Slack: {res.status}: {res.body}');\n}",
            "bytecode": [
                "_H",
                1,
                32,
                "https://slack.com/api/chat.postMessage",
                32,
                "body",
                32,
                "channel",
                32,
                "channel",
                32,
                "inputs",
                1,
                2,
                32,
                "icon_emoji",
                32,
                "icon_emoji",
                32,
                "inputs",
                1,
                2,
                32,
                "username",
                32,
                "username",
                32,
                "inputs",
                1,
                2,
                32,
                "blocks",
                32,
                "blocks",
                32,
                "inputs",
                1,
                2,
                32,
                "text",
                32,
                "text",
                32,
                "inputs",
                1,
                2,
                42,
                5,
                32,
                "method",
                32,
                "POST",
                32,
                "headers",
                32,
                "Authorization",
                32,
                "Bearer ",
                32,
                "access_token",
                32,
                "slack_workspace",
                32,
                "inputs",
                1,
                3,
                2,
                "concat",
                2,
                32,
                "Content-Type",
                32,
                "application/json",
                42,
                2,
                42,
                3,
                2,
                "fetch",
                2,
                33,
                200,
                36,
                0,
                32,
                "status",
                45,
                12,
                30,
                36,
                0,
                32,
                "body",
                45,
                32,
                "ok",
                45,
                11,
                4,
                2,
                40,
                21,
                32,
                "Failed to post message to Slack: ",
                36,
                0,
                32,
                "status",
                45,
                32,
                ": ",
                36,
                0,
                32,
                "body",
                45,
                2,
                "concat",
                4,
                2,
                "Error",
                1,
                49,
                35
            ],
            "transpiled": null,
            "inputs_schema": [
                {
                    "type": "integration",
                    "key": "slack_workspace",
                    "label": "Slack workspace",
                    "required": true,
                    "secret": false,
                    "hidden": false,
                    "integration": "slack",
                    "requiredScopes": "channels:read groups:read chat:write chat:write.customize"
                },
                {
                    "type": "integration_field",
                    "key": "channel",
                    "label": "Channel to post to",
                    "required": true,
                    "secret": false,
                    "hidden": false,
                    "description": "Select the channel to post to (e.g. #general). The PostHog app must be installed in the workspace. For private channels, the PostHog app must be a member of the channel.",
                    "integration_key": "slack_workspace",
                    "integration_field": "slack_channel"
                },
                {
                    "type": "string",
                    "key": "icon_emoji",
                    "label": "Emoji icon",
                    "required": false,
                    "default": ":hedgehog:",
                    "secret": false,
                    "hidden": false
                },
                {
                    "type": "string",
                    "key": "username",
                    "label": "Bot name",
                    "required": false,
                    "default": "PostHog",
                    "secret": false,
                    "hidden": false
                },
                {
                    "type": "json",
                    "key": "blocks",
                    "label": "Blocks",
                    "required": false,
                    "default": [
                        {
                            "text": {
                                "text": "*{person.name}* triggered event: '{event.event}'",
                                "type": "mrkdwn"
                            },
                            "type": "section"
                        },
                        {
                            "type": "actions",
                            "elements": [
                                {
                                    "url": "{person.url}",
                                    "text": {
                                        "text": "View Person in PostHog",
                                        "type": "plain_text"
                                    },
                                    "type": "button"
                                },
                                {
                                    "url": "{source.url}",
                                    "text": {
                                        "text": "Message source",
                                        "type": "plain_text"
                                    },
                                    "type": "button"
                                }
                            ]
                        }
                    ],
                    "secret": false,
                    "hidden": false,
                    "description": "(see https://api.slack.com/block-kit/building)"
                },
                {
                    "type": "string",
                    "key": "text",
                    "label": "Plain text message",
                    "required": false,
                    "default": "*{person.name}* triggered event: '{event.event}'",
                    "secret": false,
                    "hidden": false,
                    "description": "Optional fallback message if blocks are not provided or supported"
                }
            ],
            "inputs": {
                "text": {
                    "order": 3,
                    "value": "*{person.name}* responded to survey *{event.properties.$survey_name}*",
                    "bytecode": [
                        "_H",
                        1,
                        32,
                        "*",
                        32,
                        "name",
                        32,
                        "person",
                        1,
                        2,
                        32,
                        "* responded to survey *",
                        32,
                        "$survey_name",
                        32,
                        "properties",
                        32,
                        "event",
                        1,
                        3,
                        32,
                        "*",
                        2,
                        "concat",
                        5
                    ]
                },
                "blocks": {
                    "order": 2,
                    "value": [
                        {
                            "text": {
                                "text": "*{person.name}* responded to survey *{event.properties.$survey_name}*",
                                "type": "mrkdwn"
                            },
                            "type": "section"
                        },
                        {
                            "type": "actions",
                            "elements": [
                                {
                                    "url": "{project.url}/surveys/{event.properties.$survey_id}",
                                    "text": {
                                        "text": "View Survey",
                                        "type": "plain_text"
                                    },
                                    "type": "button"
                                },
                                {
                                    "url": "{person.url}",
                                    "text": {
                                        "text": "View Person",
                                        "type": "plain_text"
                                    },
                                    "type": "button"
                                }
                            ]
                        }
                    ],
                    "bytecode": [
                        {
                            "text": {
                                "text": [
                                    "_H",
                                    1,
                                    32,
                                    "*",
                                    32,
                                    "name",
                                    32,
                                    "person",
                                    1,
                                    2,
                                    32,
                                    "* responded to survey *",
                                    32,
                                    "$survey_name",
                                    32,
                                    "properties",
                                    32,
                                    "event",
                                    1,
                                    3,
                                    32,
                                    "*",
                                    2,
                                    "concat",
                                    5
                                ],
                                "type": ["_H", 1, 32, "mrkdwn"]
                            },
                            "type": ["_H", 1, 32, "section"]
                        },
                        {
                            "type": ["_H", 1, 32, "actions"],
                            "elements": [
                                {
                                    "url": [
                                        "_H",
                                        1,
                                        32,
                                        "url",
                                        32,
                                        "project",
                                        1,
                                        2,
                                        32,
                                        "/surveys/",
                                        32,
                                        "$survey_id",
                                        32,
                                        "properties",
                                        32,
                                        "event",
                                        1,
                                        3,
                                        2,
                                        "concat",
                                        3
                                    ],
                                    "text": {
                                        "text": ["_H", 1, 32, "View Survey"],
                                        "type": ["_H", 1, 32, "plain_text"]
                                    },
                                    "type": ["_H", 1, 32, "button"]
                                },
                                {
                                    "url": ["_H", 1, 32, "url", 32, "person", 1, 2],
                                    "text": {
                                        "text": ["_H", 1, 32, "View Person"],
                                        "type": ["_H", 1, 32, "plain_text"]
                                    },
                                    "type": ["_H", 1, 32, "button"]
                                }
                            ]
                        }
                    ]
                },
                "channel": {
                    "order": 1,
                    "value": "C077K2Z7UBZ"
                },
                "username": null,
                "icon_emoji": null,
                "slack_workspace": {
                    "order": 0,
                    "value": 1
                }
            },
            "filters": {
                "events": [
                    {
                        "id": "survey sent",
                        "type": "events",
                        "properties": [
                            {
                                "key": "$survey_id",
                                "type": "event",
                                "value": "0196b13f-8f5a-0000-a38d-851eca239710",
                                "operator": "exact"
                            }
                        ]
                    }
                ],
                "bytecode": [
                    "_H",
                    1,
                    32,
                    "survey sent",
                    32,
                    "event",
                    1,
                    1,
                    11,
                    32,
                    "0196b13f-8f5a-0000-a38d-851eca239710",
                    32,
                    "$survey_id",
                    32,
                    "properties",
                    1,
                    2,
                    11,
                    3,
                    2,
                    4,
                    1
                ]
            },
            "masking": null,
            "mappings": null,
            "icon_url": "/static/services/slack.png",
            "template": {
                "mapping_templates": null,
                "mappings": null,
                "status": "stable",
                "free": true,
                "type": "destination",
                "id": "template-slack",
                "name": "Slack",
                "hog": "let res := fetch('https://slack.com/api/chat.postMessage', {\n  'body': {\n    'channel': inputs.channel,\n    'icon_emoji': inputs.icon_emoji,\n    'username': inputs.username,\n    'blocks': inputs.blocks,\n    'text': inputs.text\n  },\n  'method': 'POST',\n  'headers': {\n    'Authorization': f'Bearer {inputs.slack_workspace.access_token}',\n    'Content-Type': 'application/json'\n  }\n});\n\nif (res.status != 200 or res.body.ok == false) {\n  throw Error(f'Failed to post message to Slack: {res.status}: {res.body}');\n}",
                "inputs_schema": [
                    {
                        "key": "slack_workspace",
                        "type": "integration",
                        "integration": "slack",
                        "label": "Slack workspace",
                        "requiredScopes": "channels:read groups:read chat:write chat:write.customize",
                        "secret": false,
                        "hidden": false,
                        "required": true
                    },
                    {
                        "key": "channel",
                        "type": "integration_field",
                        "integration_key": "slack_workspace",
                        "integration_field": "slack_channel",
                        "label": "Channel to post to",
                        "description": "Select the channel to post to (e.g. #general). The PostHog app must be installed in the workspace. For private channels, the PostHog app must be a member of the channel.",
                        "secret": false,
                        "hidden": false,
                        "required": true
                    },
                    {
                        "key": "icon_emoji",
                        "type": "string",
                        "label": "Emoji icon",
                        "default": ":hedgehog:",
                        "required": false,
                        "secret": false,
                        "hidden": false
                    },
                    {
                        "key": "username",
                        "type": "string",
                        "label": "Bot name",
                        "default": "PostHog",
                        "required": false,
                        "secret": false,
                        "hidden": false
                    },
                    {
                        "key": "blocks",
                        "type": "json",
                        "label": "Blocks",
                        "description": "(see https://api.slack.com/block-kit/building)",
                        "default": [
                            {
                                "text": {
                                    "text": "*{person.name}* triggered event: '{event.event}'",
                                    "type": "mrkdwn"
                                },
                                "type": "section"
                            },
                            {
                                "type": "actions",
                                "elements": [
                                    {
                                        "url": "{person.url}",
                                        "text": {
                                            "text": "View Person in PostHog",
                                            "type": "plain_text"
                                        },
                                        "type": "button"
                                    },
                                    {
                                        "url": "{source.url}",
                                        "text": {
                                            "text": "Message source",
                                            "type": "plain_text"
                                        },
                                        "type": "button"
                                    }
                                ]
                            }
                        ],
                        "secret": false,
                        "required": false,
                        "hidden": false
                    },
                    {
                        "key": "text",
                        "type": "string",
                        "label": "Plain text message",
                        "description": "Optional fallback message if blocks are not provided or supported",
                        "default": "*{person.name}* triggered event: '{event.event}'",
                        "secret": false,
                        "required": false,
                        "hidden": false
                    }
                ],
                "category": ["Customer Success"],
                "description": "Sends a message to a Slack channel",
                "filters": null,
                "masking": null,
                "icon_url": "/static/services/slack.png",
                "kind": null
            },
            "status": {
                "state": 1,
                "rating": 1,
                "tokens": 10000
            },
            "execution_order": null
        },
        {
            "id": "01976394-115e-0000-3322-8ae683cbb433",
            "type": "destination",
            "kind": null,
            "name": "HTTP Webhook",
            "description": "Sends a webhook templated by the incoming event data",
            "created_at": "2025-06-12T09:58:57.636405Z",
            "created_by": {
                "id": 1,
                "uuid": "0196900f-1824-0000-d3e0-f19bb3d70020",
                "distinct_id": "WudLIpIOOPgWUyhrq4VhgLB2R2T8585jfoqEIbO3ZTL",
                "first_name": "Ben",
                "last_name": "",
                "email": "[email protected]",
                "is_email_verified": true,
                "hedgehog_config": null,
                "role_at_organization": "engineering"
            },
            "updated_at": "2025-06-12T12:17:45.639505Z",
            "enabled": true,
            "hog": "let payload := {\n  'headers': inputs.headers,\n  'body': inputs.body,\n  'method': inputs.method\n}\n\nif (inputs.debug) {\n  print('Request', inputs.url, payload)\n}\n\nlet res := fetch(inputs.url, payload);\n\nif (res.status >= 400) {\n  throw Error(f'Webhook failed with status {res.status}: {res.body}');\n}\n\nif (inputs.debug) {\n  print('Response', res.status, res.body);\n}",
            "bytecode": [
                "_H",
                1,
                32,
                "headers",
                32,
                "headers",
                32,
                "inputs",
                1,
                2,
                32,
                "body",
                32,
                "body",
                32,
                "inputs",
                1,
                2,
                32,
                "method",
                32,
                "method",
                32,
                "inputs",
                1,
                2,
                42,
                3,
                32,
                "debug",
                32,
                "inputs",
                1,
                2,
                40,
                14,
                32,
                "Request",
                32,
                "url",
                32,
                "inputs",
                1,
                2,
                36,
                0,
                2,
                "print",
                3,
                35,
                32,
                "url",
                32,
                "inputs",
                1,
                2,
                36,
                0,
                2,
                "fetch",
                2,
                33,
                400,
                36,
                1,
                32,
                "status",
                45,
                14,
                40,
                21,
                32,
                "Webhook failed with status ",
                36,
                1,
                32,
                "status",
                45,
                32,
                ": ",
                36,
                1,
                32,
                "body",
                45,
                2,
                "concat",
                4,
                2,
                "Error",
                1,
                49,
                32,
                "debug",
                32,
                "inputs",
                1,
                2,
                40,
                16,
                32,
                "Response",
                36,
                1,
                32,
                "status",
                45,
                36,
                1,
                32,
                "body",
                45,
                2,
                "print",
                3,
                35,
                35,
                35
            ],
            "transpiled": null,
            "inputs_schema": [
                {
                    "type": "string",
                    "key": "url",
                    "label": "Webhook URL",
                    "required": true,
                    "secret": false,
                    "hidden": false
                },
                {
                    "type": "choice",
                    "key": "method",
                    "label": "Method",
                    "choices": [
                        {
                            "label": "POST",
                            "value": "POST"
                        },
                        {
                            "label": "PUT",
                            "value": "PUT"
                        },
                        {
                            "label": "PATCH",
                            "value": "PATCH"
                        },
                        {
                            "label": "GET",
                            "value": "GET"
                        },
                        {
                            "label": "DELETE",
                            "value": "DELETE"
                        }
                    ],
                    "required": false,
                    "default": "POST",
                    "secret": false,
                    "hidden": false
                },
                {
                    "type": "json",
                    "key": "body",
                    "label": "JSON Body",
                    "required": false,
                    "default": {
                        "event": "{event}",
                        "person": "{person}"
                    },
                    "secret": false,
                    "hidden": false
                },
                {
                    "type": "dictionary",
                    "key": "headers",
                    "label": "Headers",
                    "required": false,
                    "default": {
                        "Content-Type": "application/json"
                    },
                    "secret": false,
                    "hidden": false
                },
                {
                    "type": "boolean",
                    "key": "debug",
                    "label": "Log responses",
                    "required": false,
                    "default": false,
                    "secret": false,
                    "hidden": false,
                    "description": "Logs the response of http calls for debugging."
                }
            ],
            "inputs": {
                "url": {
                    "order": 0,
                    "value": "http://localhost:2080/aa617a81-e63f-40a1-a0e0-1665248b9c61",
                    "bytecode": ["_H", 1, 32, "http://localhost:2080/aa617a81-e63f-40a1-a0e0-1665248b9c61"],
                    "templating": "hog"
                },
                "body": {
                    "order": 2,
                    "value": {
                        "event": "{event}",
                        "person": "{person}"
                    },
                    "bytecode": {
                        "event": ["_H", 1, 32, "event", 1, 1],
                        "person": ["_H", 1, 32, "person", 1, 1]
                    },
                    "templating": "hog"
                },
                "debug": {
                    "order": 4,
                    "value": false,
                    "templating": "hog"
                },
                "method": {
                    "order": 1,
                    "value": "POST",
                    "templating": "hog"
                },
                "headers": {
                    "order": 3,
                    "value": {
                        "wef": "fref",
                        "wefw": "err",
                        "Content-Type": "application/json"
                    },
                    "bytecode": {
                        "wef": ["_H", 1, 32, "fref"],
                        "wefw": ["_H", 1, 32, "err"],
                        "Content-Type": ["_H", 1, 32, "application/json"]
                    },
                    "templating": "hog"
                }
            },
            "filters": {
                "actions": [
                    {
                        "id": "1",
                        "name": "",
                        "type": "actions"
                    }
                ],
                "bytecode": [
                    "_H",
                    1,
                    32,
                    "$pageview",
                    32,
                    "event",
                    1,
                    1,
                    11,
                    32,
                    "%efwfewf%",
                    32,
                    "$current_url",
                    32,
                    "properties",
                    1,
                    2,
                    17,
                    3,
                    2,
                    3,
                    1,
                    4,
                    1
                ]
            },
            "masking": null,
            "mappings": null,
            "icon_url": "/static/posthog-icon.svg",
            "template": {
                "mapping_templates": null,
                "mappings": null,
                "status": "stable",
                "free": false,
                "type": "destination",
                "id": "template-webhook",
                "name": "HTTP Webhook",
                "hog": "let payload := {\n  'headers': inputs.headers,\n  'body': inputs.body,\n  'method': inputs.method\n}\n\nif (inputs.debug) {\n  print('Request', inputs.url, payload)\n}\n\nlet res := fetch(inputs.url, payload);\n\nif (res.status >= 400) {\n  throw Error(f'Webhook failed with status {res.status}: {res.body}');\n}\n\nif (inputs.debug) {\n  print('Response', res.status, res.body);\n}",
                "inputs_schema": [
                    {
                        "key": "url",
                        "type": "string",
                        "label": "Webhook URL",
                        "secret": false,
                        "required": true
                    },
                    {
                        "key": "method",
                        "type": "choice",
                        "label": "Method",
                        "secret": false,
                        "choices": [
                            {
                                "label": "POST",
                                "value": "POST"
                            },
                            {
                                "label": "PUT",
                                "value": "PUT"
                            },
                            {
                                "label": "PATCH",
                                "value": "PATCH"
                            },
                            {
                                "label": "GET",
                                "value": "GET"
                            },
                            {
                                "label": "DELETE",
                                "value": "DELETE"
                            }
                        ],
                        "default": "POST",
                        "required": false
                    },
                    {
                        "key": "body",
                        "type": "json",
                        "label": "JSON Body",
                        "default": {
                            "event": "{event}",
                            "person": "{person}"
                        },
                        "secret": false,
                        "required": false
                    },
                    {
                        "key": "headers",
                        "type": "dictionary",
                        "label": "Headers",
                        "secret": false,
                        "required": false,
                        "default": {
                            "Content-Type": "application/json"
                        }
                    },
                    {
                        "key": "debug",
                        "type": "boolean",
                        "label": "Log responses",
                        "description": "Logs the response of http calls for debugging.",
                        "secret": false,
                        "required": false,
                        "default": false
                    }
                ],
                "category": ["Custom"],
                "description": "Sends a webhook templated by the incoming event data",
                "filters": null,
                "masking": null,
                "icon_url": "/static/posthog-icon.svg",
                "kind": null
            },
            "status": {
                "state": 1,
                "rating": 1,
                "tokens": 10000
            },
            "execution_order": null
        }
    ]
}