Creating Hooks
Hooks are the core unit in sendword. Each hook maps an incoming HTTP request to an action.
Basic hook
[[hooks]]
name = "Deploy App"
slug = "deploy"
enabled = true
description = "Deploys the application on push to main"
[hooks.executor]
type = "shell"
command = "bash /scripts/deploy.sh"
Once configured, this hook is available at POST /hook/deploy.
Slug rules
The slug field must be:
- Alphanumeric characters and hyphens only
- Unique across all hooks
- Used in the webhook URL path
Enabling and disabling
Set enabled = false to disable a hook without removing its configuration. Disabled hooks return 404 to callers.
Per-hook settings
Each hook can override global defaults:
[[hooks]]
name = "Slow Task"
slug = "slow-task"
timeout = "5m"
cwd = "/opt/tasks"
[hooks.executor]
type = "shell"
command = "python long_running.py"
[hooks.env]
TASK_MODE = "batch"
API_KEY = "${{EXTERNAL_API_KEY}}"
[hooks.retries]
count = 3
backoff = "exponential"
initial_delay = "5s"
max_delay = "2m"
Environment variables
The [hooks.env] table sets environment variables for the execution. Values can reference system environment variables with ${{VAR_NAME}} syntax.
Sendword also inherits PATH, HOME, USER, and LANG from the host system.