webhook-management
Manage agentapi-proxy webhooks for automated session creation. Use when you need to: (1) Create GitHub or custom webhooks, (2) Update webhook configurations, (3) List existing webhooks, (4) Delete webhooks, (5) Regenerate webhook secrets, (6) Configure webhook triggers and conditions. Supports GitHub webhooks and custom webhooks with Go template-based filtering.
What this skill does
# Webhook Management
This skill provides guidance for managing agentapi-proxy webhooks that automatically create sessions in response to external events.
## ⚠️ Important: Always Use This Skill for Webhook Operations
**When performing any webhook-related operations (creating, updating, listing, deleting, or modifying webhook configurations), always invoke this skill first rather than directly using curl or API calls.**
This ensures:
- Proper authentication and API endpoint configuration
- Correct payload structure and validation
- Access to up-to-date examples and best practices
- Consistent error handling and guidance
## Overview
Webhooks enable automatic session creation when events occur in external systems (GitHub, Slack, Datadog, custom services). Each webhook has:
- **Triggers**: Rules that determine when to create a session
- **Conditions**: Filters based on event properties
- **Session Config**: Environment variables, tags, and initial messages for created sessions
## Core Workflows
### Creating a Webhook
#### GitHub Webhook
First, create a JSON file with your webhook configuration:
```bash
cat > webhook-github.json <<'EOF'
{
"name": "Pull Request Reviewer",
"type": "github",
"github": {
"allowed_events": ["pull_request"],
"allowed_repositories": ["owner/repo"]
},
"triggers": [
{
"name": "PR opened",
"enabled": true,
"conditions": {
"github": {
"events": ["pull_request"],
"actions": ["opened"],
"draft": false
}
},
"session_config": {
"initial_message_template": "Review PR #{{.pull_request.number}}: {{.pull_request.title}}",
"tags": {
"repository": "{{.repository.full_name}}",
"pr": "{{.pull_request.number}}"
},
"reuse_session": false,
"mount_payload": false
}
}
],
"max_sessions": 10,
"signature_type": "hmac",
"signature_header": "X-Hub-Signature-256",
"signature_prefix": "sha256="
}
EOF
agentapi-proxy client webhook create -f webhook-github.json
```
#### Custom Webhook (Slack, Datadog, Sentry, etc.)
```bash
cat > webhook-custom.json <<'EOF'
{
"name": "Slack Incident Alerts",
"type": "custom",
"triggers": [
{
"name": "Critical incident",
"conditions": {
"go_template": "{{ and (eq .event.type \"incident\") (eq .event.severity \"critical\") }}"
},
"session_config": {
"initial_message_template": "Incident: {{.event.title}}",
"tags": {
"source": "slack",
"severity": "{{.event.severity}}"
}
}
}
],
"max_sessions": 5,
"signature_type": "hmac",
"signature_header": "X-Signature"
}
EOF
agentapi-proxy client webhook create -f webhook-custom.json
```
**For Static Token Verification (e.g., Sentry):**
```bash
cat > webhook-sentry.json <<'EOF'
{
"name": "Sentry Error Alerts",
"type": "custom",
"secret": "your-static-secret-token",
"signature_type": "static",
"signature_header": "X-Sentry-Token",
"triggers": [
{
"name": "Error event",
"conditions": {
"go_template": "{{ eq .event.level \"error\" }}"
},
"session_config": {
"initial_message_template": "Sentry error: {{.event.title}}"
}
}
]
}
EOF
agentapi-proxy client webhook create -f webhook-sentry.json
```
**Response:**
```json
{
"id": "webhook-123",
"webhook_url": "https://api.example.com/hooks/github/webhook-123",
"secret": "generated-secret-key"
}
```
### Listing Webhooks
```bash
agentapi-proxy client webhook list
```
### Getting a Specific Webhook
```bash
agentapi-proxy client webhook get WEBHOOK_ID
```
### Updating a Webhook
```bash
# Update specific fields using apply (patch)
echo '{"max_sessions":15}' | agentapi-proxy client webhook apply WEBHOOK_ID
# Or update multiple fields
cat > update.json <<'EOF'
{
"name": "Updated Webhook Name",
"status": "active"
}
EOF
cat update.json | agentapi-proxy client webhook apply WEBHOOK_ID
```
### Deleting a Webhook
```bash
agentapi-proxy client webhook delete WEBHOOK_ID
```
### Regenerating Webhook Secret
```bash
agentapi-proxy client webhook regenerate-secret WEBHOOK_ID
```
### Testing a Webhook
**Note:** The `test` or `trigger` command is not yet implemented in the CLI client. Use the API directly if you need to test a webhook:
```bash
# Dry run (test without creating a session)
curl -X POST https://api.example.com/webhooks/WEBHOOK_ID/trigger \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"payload": {
"event": "test_event",
"severity": "critical"
},
"dry_run": true
}'
# Actual trigger (create a session)
curl -X POST https://api.example.com/webhooks/WEBHOOK_ID/trigger \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"payload": {
"event": "test_event",
"severity": "critical"
},
"dry_run": false
}'
```
## Advanced Configuration
### Signature Verification
Webhooks support two types of signature verification:
**1. HMAC Signature (default)**
```json
{
"signature_type": "hmac",
"signature_header": "X-Hub-Signature-256",
"signature_prefix": "sha256="
}
```
The webhook validates HMAC signatures automatically. The `signature_prefix` is auto-detected but can be explicitly set:
- GitHub: `sha256=`
- Slack: `v0=`
- Custom: any prefix or empty string
**2. Static Token**
```json
{
"signature_type": "static",
"signature_header": "X-Custom-Token",
"secret": "your-static-token"
}
```
The webhook compares the header value directly against the secret.
### Concurrency Control
Limit the number of concurrent sessions created by a webhook:
```json
{
"max_sessions": 10
}
```
Default: 10, Maximum: 100. When the limit is reached, new webhook events are queued.
### Session Reuse
Reuse existing sessions instead of creating new ones:
```json
{
"session_config": {
"reuse_session": true,
"reuse_message_template": "New event: {{.event.title}}"
}
}
```
When `reuse_session` is enabled:
- If an active session exists matching the same tags, send a new message to it
- If no session exists, create a new one with `initial_message_template`
- Use `reuse_message_template` for messages sent to existing sessions
### Mount Webhook Payload
Mount the webhook payload as a file in the container:
```json
{
"session_config": {
"mount_payload": true
}
}
```
The payload will be available at `/webhook-payload.json` in the session container.
## Reference Documentation
For detailed information, see:
- [WEBHOOK_REFERENCE.md](references/WEBHOOK_REFERENCE.md) - Complete webhook API and configuration
- [WEBHOOK_TRIGGERS.md](references/WEBHOOK_TRIGGERS.md) - Trigger conditions and filtering
- [WEBHOOK_EXAMPLES.md](references/WEBHOOK_EXAMPLES.md) - Integration examples for various services
- [TEMPLATE_VARIABLES.md](references/TEMPLATE_VARIABLES.md) - Go template variables reference for all contexts
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.