---
title: "Create a webhook"
method: POST
path: "/events/webhooks"
tags: ["Webhooks"]
---

# Create a webhook

`POST /events/webhooks`

## Request

- Base URL: `https://api.sandbase.ai`
- URL: `https://api.sandbase.ai/events/webhooks`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

Registers a webhook for asynchronous model generation events. The response is the only time signatureSecret is returned.

## Request body

- WebhookCreateRequest
  - `name` string, required
  - `url` string, uri, required: HTTP(S) endpoint. Use HTTPS in production.
  - `resourceType` 'model', required
  - `events` string[]: Empty or omitted means all current and future events in the resource type.
  - `enabled` boolean
  - `signatureSecret` string: Optional. Omit to let SandBase generate a high-entropy secret.

## Response `200`

Webhook created

- WebhookCreated
  - `id` string, required
  - `name` string, required
  - `url` string, uri, required
  - `resourceType` string, required: model for new registrations. Retired types (session, sandbox, template) can still appear on old registrations.
  - `events` string[], required: Empty means all events in the resource type.
  - `enabled` boolean, required
  - `createdAt` string, date-time, required
  - `signatureSecret` string, required: HMAC signing secret. Returned only in this response.

## Other responses

- `400`: Invalid body, URL, resourceType, or events
- `401`: Missing, invalid, or revoked API key
- `500`: Webhook creation failed

---

[API](https://skmtc.dev/sandbase/apis/sandbase-api.md) · [All operations](https://skmtc.dev/sandbase/apis/sandbase-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sandbase/apis/sandbase-api/revisions/d40df2467ba2?raw)
