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

# Create webhook

`POST /v1/webhooks`

## Request

- Base URL: `https://api.hempdata.io`
- URL: `https://api.hempdata.io/v1/webhooks`
- Auth: HTTP bearer

Subscribe to regulation change events via webhook. Requires an HTTPS endpoint URL.

## Request body

- WebhookCreateRequest
  - `endpoint_url` string, uri, required: HTTPS URL to receive webhook payloads
  - `filters` object
    - `jurisdictions` string[]: State codes to filter events (empty = all states)
    - `substances` string[]: Substances to filter events
    - `events` string[]: Event types to subscribe to

## Response `201`

Webhook created

- ApiResponseWebhook
  - `success` boolean, required
  - `data` WebhookSubscription, required
    - `id` string, uuid, required
    - `endpoint_url` string, uri, required
    - `filters` object
      - `jurisdictions` string[]
      - `substances` string[]
      - `events` string[]
    - `signing_secret` string, required: HMAC secret for verifying webhook payloads
    - `status` 'active' | 'paused' | 'failed', required
    - `created_at` string, date-time, required
  - `meta` object
  - `errors` ApiError[], nullable
    - `code` string, required: Machine-readable error code
    - `message` string, required: Human-readable error message
    - `field` string, nullable: Field that caused the error, if applicable

## Other responses

- `400`: Invalid request (e.g. non-HTTPS URL)

---

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