Skip to main content
◈hastdocs
English

AIP

Webhook HTTP integration

Invoke an Agent from your server, continue conversations, read replies, and stop execution.

This page calls the full Hook URL from an Agent's details page using its saved configuration. For API key authentication, create a single-Agent conversation key using the AIP API quickstart. The two methods use different URLs and credentials.

Prepare the invocation URL

Ensure the Agent is enabled and test the same task in debugging first. These examples perform real execution.

Send the first message

curl --fail-with-body "$AIP_HOOK_URL" \
  -H 'Content-Type: application/json' \
  --data '{
    "action": "created",
    "payload": {
      "session_id": "requirements-demo-001",
      "request_id": "message-001",
      "prompt": "Organize this requirement: support staff can enter an order number to check its status.",
      "context": {"source": "requirements-form"}
    }
  }'

Reuse session_id within a conversation. Use a new request_id for each new message; for a retry, retain the original identifier and request content. These identifiers are examples; generate distinct identifiers for separate conversations and messages in your application.

After acceptance, read execution events. Successful submission does not mean the task is complete.

Receive streamed replies

curl -N --fail-with-body "$AIP_HOOK_URL" \
  -H 'Content-Type: application/json' \
  --data '{
    "action": "sse",
    "payload": {
      "session_id": "requirements-demo-001",
      "after_event_id": 0
    }
  }'

Use the session identifier from the response. Save the last received event sequence, resume from it after disconnection, and deduplicate by sequence.

Continue the conversation

curl --fail-with-body "$AIP_HOOK_URL" \
  -H 'Content-Type: application/json' \
  --data '{
    "action": "prompted",
    "payload": {
      "session_id": "requirements-demo-001",
      "request_id": "message-002",
      "signal": "continue",
      "prompt": "Sort the open questions by priority."
    }
  }'

Stop generation

curl --fail-with-body "$AIP_HOOK_URL" \
  -H 'Content-Type: application/json' \
  --data '{
    "action": "prompted",
    "payload": {
      "session_id": "requirements-demo-001",
      "signal": "stop"
    }
  }'

Closing SSE only stops event reception. To stop execution, send the stop request above and continue observing the outcome.

Request fields

FieldUsed inMeaning
actionAll requestscreated, prompted, or sse
payload.session_idAll requestsIdentifies one conversation
payload.request_idNew messagesRetry identification; new value per new message
payload.promptFirst and continued messagesInput text
payload.contextFirst-message exampleBusiness context object
payload.signalpromptedcontinue or stop
payload.after_event_idsseRead after the specified event position

Your service owns its message entry point, user validation, and session mapping. Assign distinct session identifiers to different customers.

Meet HastLearn about Hast AIP, Hast Agent, Hast GTM, and delivery with the FDE team.About AIPConfigure Agents and connect business systems using the FDE delivery workbench.Create your first AgentConfigure, save, and debug an Agent without external services.Configure and manage AgentsSet responsibilities, models, and capabilities, and maintain the active configuration.Manage SkillsWrite, import, and select the skill files used by Agents.Add a knowledge baseOrganize URL, file, and Drive sources; manage knowledge-base membership, indexing, and compiled material.Manage business secretsStore credentials and bind them to Agents without exposing real values in examples.Connect business toolsLet Agents call HTTP services with explicit inputs and authentication.Configure long-term memoryChoose what memory an Agent can read and where new memory is written.Debug an AgentTest saved configurations, conversation continuity, and tool results.Import, export, and copyReuse configurations and recheck resources and credentials after migration.Webhook HTTP integrationInvoke an Agent from your server, continue conversations, read replies, and stop execution.MCP integrationConnect external Agent clients to AIP tools with a Public API Key.Connect SlackBring your Agent into Slack to ask questions, work with files, and collaborate with your team in channels or direct messages.Connect WhatsAppLet customers ask questions, share files, and get replies from your Agent in WhatsApp.Connect WeChat Customer ServiceConnect your Agent to WeChat Customer Service to answer customers in WeChat.API quickstartCreate an AIP key, call a saved Agent, read replies, and access authorized business resources.Conversation events and SSEPoll single-Agent conversation events or stream ordinary task events with a Profile API key.API referenceExplore AIP public API authentication, Agent conversations, and business resource endpoints.About Task AgentPlan, execute, and deliver complete tasks with tools, files, and lasting context.Complete your first taskSubmit a request, check progress, and inspect the final output.Execute tasks and manage conversationsAdd instructions, stop execution, and manage conversation history.Upload, view, and download filesProvide inputs and keep the files created by your tasks.Connect apps and configure capabilitiesAuthorize external apps and maintain context across tasks.Create scheduled tasksSet recurrence and timezone, then inspect each run's result.Task Agent troubleshootingCheck access, connections, task state, and files.About GTMUse a shared website project for research, visibility analysis, and marketing drafts.Create your first GTM projectEnter a website, wait for initialization, and inspect the first results.Manage projects and website contextSwitch projects, refresh site information, and manage project settings.Company analysis and project documentsReview product, competitor, and marketing context before content tasks.SEO and website performanceRead PageSpeed reports for mobile and desktop.AI brand mentionsInspect buyer questions and whether model answers mention your brand.Connect Google AnalyticsAuthorize an account, choose a GA property, and inspect traffic reports.Generate and publish X draftsCreate posts, review previews, and finish publishing on X.Generate article draftsSet style, language, and audience, then review and copy Markdown.Use Growth AgentRead project context or start supported background operations in conversation.Run status and troubleshootingCheck queueing, dependencies, and results without treating unfinished work as missing data.Plans and usageCheck access, consumption, and billing for the current Profile.