Lesson 12 of 12

API, webhooks & automation

Everything is also doable over REST — no UI needed. An async job with a webhook:

curl -X POST http://127.0.0.1:8653/api/jobs \
  -H "X-TT-Token: $TT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"model":{"custom":"HuggingFaceTB/SmolLM2-135M-Instruct"},
       "dataset_id":"<dataset-id>",
       "lora":{"r":16,"alpha":32},
       "params":{"lr":2e-4,"epochs":3,"bs":2,"gacc":1},
       "webhook":"https://example.com/hook"}'
  • POST /api/jobs creates an async job and returns its poll URL; GET /api/jobs/<id> gives live status.
  • On completion the server POSTs to your webhook signed with X-TT-Signature: sha256=HMAC(body) — verify integrity at the destination with the same secret.
  • Custom webhook headers are sanitised and private/internal targets (SSRF) are blocked — unless you opt in with TT_WEBHOOK_ALLOW_PRIVATE=1 for purely local automation.
  • The queue modal shows each job's webhook column: delivered ✓ or failed ✗.
queue with webhook column
Tip: the full API map is in INSTALL.md shipped next to this file.
Course index · Lesson 12 of 12
TheTensorTune workbench