---
title: Webhooks
description: "We send HTTP `POST` webhooks when job events occur. Each webhook request is signed using `HMAC-SHA256`. ### Events | **Event Name** | **Description** | | --- | --- | | `job.created` | Triggered when a job is created | | `inference.completed` | Triggered…"
url: "https://slapshot.ai/docs/webhooks/"
updated: "2026-04-15"
category: Autopilot API
---

# Webhooks

We send HTTP `POST` webhooks when job events occur. Each webhook request
is signed using `HMAC-SHA256`.

### Events

| **Event Name** | **Description** |
| --- | --- |
| `job.created` | Triggered when a job is created |
| `inference.completed` | Triggered when an inference is completed |
| `job.completed` | Triggered when a job is completed |

### Request Details

Method : `POST`

Content-Type : `application/json`

Headers:

- X-Signature : `sha256=`

### Payload Format

```json
{
    "event": "job.created | inference.completed | job.completed",
    "data": {
        "job_id": "string"
    }
}
```

### Signature Verification (Python)

> **IMPORTANT: Always use the RAW request body.**
>
>
>
> ```python
> import hmac
> import hashlib
> expected_signature = hmac.new(WEBHOOK_SECRET.encode(), request.body, hashlib.sha256).hexdigest()
> received_signature = request.headers["X-Signature"].replace("sha256=", "")
> if not hmac.compare_digest(expected_signature, received_signature):
>     raise Exception("Invalid webhook signature")
> ```
>
>
>
> ### Django Callback Example

```python
import json
import hmac
import hashlib
from django.http import JsonResponse, HttpResponseForbidden
from django.views.decorators.csrf import csrf_exempt
WEBHOOK_SECRET = "your_shared_secret_here"
@csrf_exempt
def webhook_callback(request):
    raw_body = request.body
    signature = request.headers.get("X-Signature", "").replace("sha256=", "")
    expected = hmac.new(WEBHOOK_SECRET.encode(), raw_body, hashlib.sha256).hexdigest()
    if not hmac.compare_digest(expected, signature):
        return HttpResponseForbidden("Invalid signature")
    payload = json.loads(raw_body.decode())
    event = payload.get("event")
    if event == "job.created":
        job_id = payload.get("data", {}).get("job_id")
        print("Job created:", job_id)
    elif event == "job.completed":
        job_id = payload.get("data", {}).get("job_id")
        print("Job completed:", job_id)
    return JsonResponse({"status": "ok"})
```
