Web hooks are outbound HTTP requests that fire when jobs complete or alerts trigger. Use them to integrate xyOps with external systems like Slack, Discord, PagerDuty, or custom APIs.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/pixlcore/xyops/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Web hooks provide:- Fully customizable requests - Configure URL, method, headers, and body
- Templating support - Use expressions to inject job/alert data dynamically
- Action-driven - Trigger on job start, completion, specific outcomes, or alert state changes
- Observable - View request/response details and performance metrics for each execution
When hooks fire
Attach web hook actions to events, workflows, or alerts. Hooks can fire on:Job conditions
start- Before job launches on remote servercomplete- Any job completion (success or failure)success- Successful completion (exit code 0)error- Failed completion (non-zero exit code)warning- Completion with warning codecritical- Completion with critical codeabort- Job was aborted by user or systemtag:TAGID- Job completed with a specific tag
Alert conditions
alert_new- Alert was triggeredalert_cleared- Alert condition cleared
Special conditions
- Job suspended for human intervention
- Job exceeded resource limits (CPU, memory, time, output)
Actions are deduplicated by type and target. If the same hook is referenced by an event, category, and universal actions, it only fires once.
Creating web hooks
Define the web hook
Navigate to Settings → Web Hooks and click Add Web Hook.
Display name for the web hook
Target URL (http:// or https://). Supports templating.
HTTP method: GET, POST, PUT, PATCH, DELETE, HEAD
Custom headers as name/value pairs. Values support templating.
Request body for non-GET/HEAD requests. Supports templating.
Configure options
Seconds to wait for response (default: 30)
Automatic retries on transport errors (default: 0)
Follow HTTP redirects (default: true)
Skip TLS certificate validation (default: false)
Daily execution cap for rate limiting (0 = unlimited)
Attach to actions
Add a “Web Hook” action to your events, workflows, or alerts. Select the hook and configure the condition.
Templating
Web hookurl, headers, and body support templating with {{ ... }} expressions. Expressions are evaluated using the xyOps Expression Format.
Available context
For job hooks:event- Event object withid,title,categoryjob- Job object withid,code,description,elapsed,cpu,memserver- Server object withhostname,ip,groupsnice_server- Formatted server namenice_hostname- Formatted hostname (stripped)text- Pre-formatted notification textlinks- URLs for job details, event page, server pagesecrets- Assigned secrets (if any)
def- Alert definition withid,title,expressionalert- Alert invocation withmessage,value,startedserver- Server objectnice_server- Formatted server nametext- Pre-formatted notification textlinks- URLs for alert details, server page
Templating examples
- Slack
- Discord
- PagerDuty
- Generic JSON
Using secrets
Store sensitive tokens as secrets and inject them via templating:Security best practices
- Avoid secrets in URLs - Query params may be logged by destination servers
- Use HTTPS - Always use
https://URLs for sensitive data - Prefer headers or body - Put tokens in
Authorizationheaders or request body - Enable TLS verification - Don’t bypass certificate checks unless absolutely necessary
Default text templates
xyOps generates a{{text}} variable for each hook execution using configurable templates. Customize these in config.json under hook_text_templates:
From ~/workspace/source/sample_conf/config.json:84-93:
text, content, or message field.
Execution observability
Every web hook execution records detailed diagnostics:- Status - HTTP status code or error message
- Timing - Total elapsed time and performance breakdown
- Request - Final URL, headers, and body with templates resolved
- Response - Status, headers, and body from the endpoint
Performance breakdown
From~/workspace/source/lib/action.js, hooks track:
dns- DNS lookup timeconnect- TCP/TLS connection timesend- Request transmission timewait- Time to first byte (TTFB)receive- Response download timecompress- Request compression timedecompress- Response decompression time
Troubleshooting
Hook doesn't fire
Hook doesn't fire
Check action condition: Ensure the condition matches the job outcome (e.g.,
error for failures).Verify hook is enabled: Disabled hooks won’t execute.Check daily limit: If max_per_day is set, you may have hit the cap.Review action logs: Job Activity tab shows which actions were triggered.Request fails with timeout
Request fails with timeout
Increase timeout: Default is 30 seconds. Adjust in hook configuration.Check network connectivity: Ensure xyOps can reach the target URL.Enable retries: Set
retries to 1-3 for transient failures.Template variables are empty
Template variables are empty
Check context: Ensure you’re using job variables in job hooks, not alert variables.Verify secret assignment: Secrets must be assigned to the hook in the secret editor.Test with literal values: Replace templates with static strings to isolate the issue.
SSL/TLS errors
SSL/TLS errors
Check certificate validity: Ensure the destination has a valid SSL certificate.Use ssl_cert_bypass: Only for testing—bypass TLS verification temporarily.Update CA certificates: Ensure your OS has up-to-date root certificates.
See also
- Actions - Action system overview
- Expressions - Expression syntax and helpers
- Secrets - Secure credential management
- System Hooks - Global hooks for all activity