Skip to main content

Daita Webhook

List and view webhook URLs for your deployed agents and workflows. Webhooks allow external services to trigger your agents and workflows via HTTP POST requests.

Syntax

daita webhook list [OPTIONS]

Options

OptionTypeDefaultDescription
--api-key-onlyflagfalseShow only webhooks created with current API key
--verbose, -vflagfalseShow detailed information including field mappings

Requirements

  • DAITA_API_KEY environment variable must be set
  • Webhooks must be configured in daita-project.yaml and deployed

Examples

List All Webhooks

# List all webhook URLs for your organization
daita webhook list

# List with verbose output showing field mappings
daita webhook list --verbose

Filter by API Key

# Show only webhooks created with current API key
daita webhook list --api-key-only

Output Format

With Webhooks Configured

$ daita webhook list

🔗 Webhook URLs (Organization: My Organization)

Agent Webhooks:
data_processor:
github_trigger → https://api.daita.cloud/webhook/org_123/agent/data_processor/github_trigger
slack_notification → https://api.daita.cloud/webhook/org_123/agent/data_processor/slack_notification

Workflow Webhooks:
data_pipeline:
webhook_start → https://api.daita.cloud/webhook/org_123/workflow/data_pipeline/webhook_start

💡 Usage:
• Copy webhook URLs to your external services (GitHub, Slack, etc.)
• Send HTTP POST requests with JSON payloads
• Field mapping will transform payloads automatically

🔧 Example:
curl -X POST '<webhook-url>' \
-H 'Content-Type: application/json' \
-d '{"your": "payload"}'

With Verbose Flag

$ daita webhook list --verbose

📡 Fetching webhooks from https://api.daita.cloud/api/v1/webhooks/list

🔗 Webhook URLs (Organization: My Organization)

Agent Webhooks:
data_processor:
github_trigger → https://api.daita.cloud/webhook/org_123/agent/data_processor/github_trigger
Field mapping: {'action': 'action', 'repository': 'repo_name'}

Workflow Webhooks:
data_pipeline:
webhook_start → https://api.daita.cloud/webhook/org_123/workflow/data_pipeline/webhook_start
Field mapping: {'data': 'input_data'}

💡 Usage:
• Copy webhook URLs to your external services (GitHub, Slack, etc.)
• Send HTTP POST requests with JSON payloads
• Field mapping will transform payloads automatically

🔧 Example:
curl -X POST '<webhook-url>' \
-H 'Content-Type: application/json' \
-d '{"your": "payload"}'

No Webhooks Found

$ daita webhook list

❌ No webhook URLs found

💡 To create webhooks:
1. Add webhook configurations to your daita-project.yaml
2. Deploy with 'daita push production'

Configuring Webhooks

Webhooks are configured in your daita-project.yaml file:

Agent Webhook Configuration

agents:
- name: data_processor
display_name: Data Processing Agent
webhooks:
- slug: github_trigger
field_mapping:
action: action
repository: repo_name
- slug: slack_notification
field_mapping:
text: message
user: sender

Workflow Webhook Configuration

workflows:
- name: data_pipeline
display_name: Data Processing Pipeline
webhooks:
- slug: webhook_start
field_mapping:
data: input_data
source: event_source

Field Mapping

Field mapping transforms incoming webhook payloads to match your agent/workflow input format:

field_mapping:
incoming_field: agent_parameter
nested.field: another_parameter

Example:

If your agent expects {"message": "hello"} but GitHub sends {"text": "hello"}:

webhooks:
- slug: github_hook
field_mapping:
text: message # Maps GitHub's "text" to agent's "message"

Using Webhooks

Basic HTTP POST Request

# Send a simple webhook request
curl -X POST 'https://api.daita.cloud/webhook/org_123/agent/my_agent/webhook_slug' \
-H 'Content-Type: application/json' \
-d '{"message": "Hello from webhook"}'

GitHub Webhook Integration

  1. Copy the webhook URL from daita webhook list
  2. Go to your GitHub repository → Settings → Webhooks
  3. Add webhook:
    • Payload URL: Your webhook URL
    • Content type: application/json
    • Events: Choose events (push, pull request, etc.)

Slack Webhook Integration

  1. Create a Slack outgoing webhook
  2. Set the URL to your Daita webhook URL
  3. Configure trigger words or channels
  4. Use field mapping to transform Slack's payload

Custom Service Integration

# Python example
import requests

webhook_url = "https://api.daita.cloud/webhook/org_123/agent/my_agent/process"
payload = {
"data": "some input",
"priority": "high"
}

response = requests.post(webhook_url, json=payload)
print(response.json())

Common Errors

No API Key

$ daita webhook list

❌ No DAITA_API_KEY found.
Get your API key at https://dashboard.daita-tech.io
Then: export DAITA_API_KEY='your-key-here'

Solution: Set your API key:

export DAITA_API_KEY='your-api-key-here'

Authentication Failed

$ daita webhook list

❌ Authentication failed - check your DAITA_API_KEY
Get a new API key at https://dashboard.daita-tech.io

Solution: Verify your API key is valid or generate a new one.

Connection Failed

$ daita webhook list

❌ Cannot connect to Daita API
Check your internet connection and try again

Solution: Check your internet connection and firewall settings.

Webhook Security

Best Practices

  1. Keep URLs Private: Webhook URLs should be treated as secrets
  2. Use HTTPS: All webhook URLs use HTTPS by default
  3. Validate Payloads: Implement validation in your agent/workflow code
  4. Rate Limiting: Be aware of rate limits on webhook endpoints
  5. Monitor Usage: Check webhook invocations in deployment logs

Organization-Level Security

  • Webhooks are scoped to your organization
  • Each deployment creates new webhook URLs
  • API key authentication required to list webhooks
  • Use --api-key-only to see only webhooks you created

Workflow

Initial Setup

# 1. Configure webhooks in daita-project.yaml
vim daita-project.yaml

# 2. Deploy to create webhook URLs
daita push production

# 3. List webhook URLs
daita webhook list

# 4. Copy URLs to external services

Updating Webhooks

# 1. Update webhook configuration in daita-project.yaml
vim daita-project.yaml

# 2. Redeploy to apply changes
daita push production

# 3. Verify new webhook URLs
daita webhook list

Testing Webhooks

# 1. Get webhook URL
daita webhook list

# 2. Test with curl
curl -X POST 'your-webhook-url' \
-H 'Content-Type: application/json' \
-d '{"test": "data"}'

# 3. Check logs to verify execution
daita logs production