The webhook event is a generic event which provisions a unique URL for your agent. You must add the webhook event to invoke your agent from the dashboard
@on("webhook")def agent(input): pass
The following is an example payload which is passed in as an argument to your agent’s entrypoint:
{ "text": "Hello world!"}
def agent(input): text = input.get("text")
Fields
string
The message to the agent.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Blocks Documentation","colors":{"primary":"#18181B","light":"#71717A","dark":"#18181B"},"logo":{"light":"https://mintcdn.com/blocks/HTNc0ckodUIDrojv/assets/blocks-black.png?fit=max\u0026auto=format\u0026n=HTNc0ckodUIDrojv\u0026q=85\u0026s=336ed9a43749343de480a1b0af782111","dark":"https://mintcdn.com/blocks/HTNc0ckodUIDrojv/assets/blocks-white.png?fit=max\u0026auto=format\u0026n=HTNc0ckodUIDrojv\u0026q=85\u0026s=267b988e38d84f95fa427ee58c6b9329"},"favicon":"https://mintcdn.com/blocks/CNNCmbDE9JAuK9LZ/assets/blocks-icon.png?fit=max\u0026auto=format\u0026n=CNNCmbDE9JAuK9LZ\u0026q=85\u0026s=96e69c3bcff105d077635b83986eb818","navbar":{"primary":{"type":"button","label":"Dashboard","href":"https://blocks.team"}},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"blocks","hasAudioNarration":false,"actualSubdomain":"blocks","customDomains":["docs.blocks.team"],"gitSource":{"type":"github","owner":"blocksorg","repo":"client-monorepo","deployBranch":"main","contentDirectory":"apps/docs","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6af0056eb8b336632a6d3781","clientVersion":"0.0.4131","searchFilterCounts":[{"language":"default","tag":"Using Blocks","count":40},{"language":"default","tag":"SDK","count":35},{"language":"default","tag":"Agents","count":11},{"language":"default","tag":"Events","count":11},{"language":"default","tag":"Platform Integrations","count":11},{"language":"default","tag":"Features","count":10},{"language":"default","tag":"REST API","count":8},{"language":"default","tag":"Use Cases","count":6},{"language":"default","tag":"Agent Sessions","count":5},{"language":"default","tag":"CLI","count":4}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"events/webhook","slug":"/events/webhook","pageMetadata":{"title":"webhook","description":null,"href":"/events/webhook"},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,CodeGroup,Heading,ResponseField}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`webhook`}),` event is a generic event which provisions a unique URL for your agent. You must add the `,_jsx(_components.code,{children:`webhook`}),` event to invoke your agent from the `,_jsx(_components.a,{href:`https://blocks.team/app/home`,children:`dashboard`})]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`@on(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"webhook\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`def`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` agent(input):`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` pass`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`The following is an example payload which is passed in as an argument to your agent’s entrypoint:`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`json`,numberOfLines:`3`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"text\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Hello world!\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`agent.py`,numberOfLines:`2`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`def`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` agent(input):`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` text = input.get(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"text\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})})]}),`\n`,_jsx(Heading,{level:`2`,id:`fields`,children:`Fields`}),`\n`,_jsx(ResponseField,{name:`text`,type:`string`,id:`param-text`,children:_jsx(_components.p,{children:`The message to the agent.`})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"webhook","description":null,"href":"/events/webhook"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Fields","slug":"fields","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/blocks/cf7afd78d5c61da4/reb2b.js"],"subdomain":"blocks","siteName":"Blocks Documentation","title":"webhook - Blocks Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-09T22:57:09.656Z","originalFileLocation":"events/webhook.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"application-name\" content=\"Blocks Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/blocks/CzYW4MX8WiJzfatV/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/blocks/CzYW4MX8WiJzfatV/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/blocks/CzYW4MX8WiJzfatV/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/blocks/CzYW4MX8WiJzfatV/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/blocks/CzYW4MX8WiJzfatV/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/blocks/CzYW4MX8WiJzfatV/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/blocks/CzYW4MX8WiJzfatV/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/blocks/CzYW4MX8WiJzfatV/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/blocks/CzYW4MX8WiJzfatV/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"webhook - Blocks Documentation\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Blocks Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.blocks.team/events/webhook\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://blocks.mintlify.site/_mintlify/api/og/v2?division=Events\u0026amp;title=webhook\u0026amp;theme=d61a3594f984340f6c29f947\u0026amp;signature=b72adb870312d3adf9948d8bcbc588ac798a791c8da3978ae5610cb9b488a415\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"webhook - Blocks Documentation\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://blocks.mintlify.site/_mintlify/api/og/v2?division=Events\u0026amp;title=webhook\u0026amp;theme=d61a3594f984340f6c29f947\u0026amp;signature=b72adb870312d3adf9948d8bcbc588ac798a791c8da3978ae5610cb9b488a415\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/blocks/CzYW4MX8WiJzfatV/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Blocks Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#18181B\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.blocks.team/events/webhook\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/events/webhook.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.blocks.team/#organization\",\"name\":\"Blocks Documentation\",\"url\":\"https://docs.blocks.team\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/blocks/HTNc0ckodUIDrojv/assets/blocks-black.png?fit=max\u0026auto=format\u0026n=HTNc0ckodUIDrojv\u0026q=85\u0026s=336ed9a43749343de480a1b0af782111\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.blocks.team#website\",\"name\":\"Blocks Documentation\",\"url\":\"https://docs.blocks.team\",\"publisher\":{\"@id\":\"https://docs.blocks.team/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.blocks.team/events/webhook#webpage\",\"url\":\"https://docs.blocks.team/events/webhook\",\"name\":\"webhook\",\"dateModified\":\"2026-10-09T22:57:09.656Z\",\"isPartOf\":{\"@id\":\"https://docs.blocks.team#website\"},\"breadcrumb\":{\"@id\":\"https://docs.blocks.team/events/webhook#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.blocks.team/events/webhook#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Events\",\"item\":\"https://docs.blocks.team/events/github-issue-comment\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"webhook\",\"item\":\"https://docs.blocks.team/events/webhook\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.blocks.team/events/webhook#article\",\"headline\":\"webhook\",\"name\":\"webhook\",\"url\":\"https://docs.blocks.team/events/webhook\",\"mainEntityOfPage\":{\"@id\":\"https://docs.blocks.team/events/webhook#webpage\"},\"dateModified\":\"2026-10-09T22:57:09.656Z\",\"publisher\":{\"@id\":\"https://docs.blocks.team/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.blocks.team#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Blocks Documentation\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Blocks Documentation\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/events/webhook.md","siteName":"Blocks Documentation","nav":{"global":null,"tabs":[{"tab":"Using Blocks","pages":[{"title":"Using Blocks","href":"/using-blocks/welcome"}]},{"tab":"SDK","pages":[{"group":"Getting Started","pages":[{"title":"Installation","href":"/sdk/installation"},{"title":"API Keys","href":"/sdk/api-keys"},{"title":"CLI","href":"/sdk/cli"}]},{"group":"Agents","pages":[{"title":"Decorators","href":"/agents/decorators"},{"title":"Events","href":"/agents/events"},{"title":"Environment Variables","href":"/agents/environment-variables"},{"title":"Config Model","href":"/agents/config-model"}]},{"group":"CLI","pages":[{"title":"configure","href":"/cli/configure"},{"title":"create","href":"/cli/create"},{"title":"init","href":"/cli/init"},{"title":"push","href":"/cli/push"}]},{"group":"Events","pages":[{"title":"github.issue_comment","href":"/events/github-issue-comment"},{"title":"github.issues","href":"/events/github-issues"},{"title":"github.pull_request","href":"/events/github-pull-request"},{"title":"github.pull_request_comment","href":"/events/github-pull-request-comment"},{"title":"github.pull_request_review_comment","href":"/events/github-pull-request-review-comment"},{"title":"linear.issues","href":"/events/linear-issues"},{"title":"linear.issue_comment","href":"/events/linear-issue-comment"},{"title":"schedule.daily","href":"/events/schedule-daily"},{"title":"schedule.weekly","href":"/events/schedule-weekly"},{"title":"slack.mention","description":null,"href":"/events/slack-mention"},{"title":"webhook","href":"/events/webhook"}]},{"group":"Decorators","pages":[{"title":"@task","description":null,"href":"/decorators/task"},{"title":"@agent","href":"/decorators/agent"},{"title":"@on","href":"/decorators/on"}]},{"group":"SDK","pages":[{"title":"bash","href":"/sdk/bash"},{"title":"experimental_bash","href":"/sdk/experimental-bash"},{"title":"config","href":"/sdk/config"},{"title":"git","href":"/sdk/git"},{"title":"repo","href":"/sdk/repo"}]}]},{"tab":"REST API","pages":[{"title":"REST API","href":"/rest-api/quick-start"}]},{"tab":"Release Notes","pages":[{"title":"Release Notes","href":"/release-notes"}]}]},"basePath":"","title":"webhook - Blocks Documentation","buildId":"dpl_5joLUXmnJgwqjrHAS4dxZrQTdxgh","deploymentId":"dpl_5joLUXmnJgwqjrHAS4dxZrQTdxgh","dynamics":[],"chunks":[]}