{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"redocly_category":"Products","product_name":"AI Agent Foundry","type":"markdown"},"seo":{"title":"Using a Webhook Integration","description":"Treasure Data Product Documentation · Collect and Unify · Segment and Activate · Experiment and Analyze · Decisioning Automate with AI Scale and Trust.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"using-a-webhook-integration","__idx":0},"children":["Using a Webhook Integration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To call an Agent in AI Agent Foundry, you need to call the Webhook API endpoint from your system."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"set-up-a-webhook-integration","__idx":1},"children":["Set up a Webhook Integration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Set up a Webhook Integration following ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/ai-agent-foundry/integration/creating-an-integration#webhook"},"children":["Creating a Webhook Integration"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To use a Webhook Integration, you must get an Authentication Token and URL."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Navigate to the Webhook panel in the Integration tab."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/webhook-step1.7e03d27d29c808378af6ad151e5f1568ac33c560d200faf2b1050f42efce0c35.91c26685.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":2},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Click \"eye\" icon to see the Authentication Token and copy the text starting with \"Basic\"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/webhook-step2.0dd069bf00adfc64f9caad3ad6fb8c01b489c5fb3a08b5575ea9d8b0a6cb328a.91c26685.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":3},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Click \"copy clipboard\" icon in the \"Text Generation URL\" to copy the URL."]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Text Generation URL is issued for each user prompt set up in the Webhook integration"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"call-webhook-url","__idx":2},"children":["Call Webhook URL"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The client application must call the URL by POST with the parameters you defined in the User prompt. You can get the result object if you specify the “application/json” content type. Following code is an example code to call by CURL."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","data-title":"sample.sh","header":{"title":"sample.sh","controls":{"copy":{}}},"source":"curl -X POST {Text Generation URL} \\\n-H \"Authorization: {Authentication Token}\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\"text\": \"Please calc the percentage of the total number of users who purchased with in recent 2 weeks\"}'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This example assumes the User Prompt contains \"text\" as a parameter in the \"User side prompt text\" field."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/webhook-step3.fa558e5fe814cce00eb4f0c9b952ee682670d74a31b40e92d146acf3f4459fbc.91c26685.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"continue-a-chat","__idx":3},"children":["Continue a chat"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The client Application can continue an existing chat using the chat id that is returned at the chat initiation. You can find it in the response header as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["x-chat-id"]},"."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","data-title":"sample.sh","header":{"title":"sample.sh","controls":{"copy":{}}},"source":"curl -X POST POST {Text Generation URL} \\\n-H \"Authorization: {Authentication Token}\" \\\n-H \"Content-Type: application/json\" \\\n-H \"X-CONTINUE-CHAT-ID: {x-chat-id}\" \\\n-d '{\"text\": \"Please calc the ratio of customers....\"}'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Client application can continue a chat multiple times."]}]},"headings":[{"value":"Using a Webhook Integration","id":"using-a-webhook-integration","depth":1},{"value":"Set up a Webhook Integration","id":"set-up-a-webhook-integration","depth":2},{"value":"Call Webhook URL","id":"call-webhook-url","depth":2},{"value":"Continue a chat","id":"continue-a-chat","depth":2}],"frontmatter":{"seo":{"title":"Using a Webhook Integration"}},"lastModified":"2026-01-20T09:51:31.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/products/customer-data-platform/ai-agent-foundry/integration/using-a-webhook-integration","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}