---
title: "Create a webhook event schema"
method: POST
path: "/v1/webhooks/{webhook_id}/event_schemas"
tags: ["webhooks"]
---

# Create a webhook event schema

`POST /v1/webhooks/{webhook_id}/event_schemas`

Creates a custom GraphQL schema for one webhook event namespace. For supported business events, the schema is a root-level Business selection set such as "{ id name runs { id agent } }".

## Path parameters

- `webhook_id` string, required

## Headers

- `Authorization` string, required

## Request body

- object
  - `namespace` string, required — Event namespace for the schema override. Currently supported business event namespaces are business.created and business.updated.
  - `schema` string, required — GraphQL selection set rooted at the event object for the namespace. For business.updated, write fields directly against the Business object, for example "{ id name runs { id agent } }". Use snake_case field names; do not wrap the query in "object { ... }".

## Response `201`

webhook event schema created

- TypeWebhookEventSchema
  - `object` 'webhook_event_schema', required
  - `id` string, uuid, required — Unique identifier for this webhook event schema.
  - `namespace` string, required — Event namespace for the schema override. Currently supported business event namespaces are business.created and business.updated.
  - `schema` string, required — GraphQL selection set rooted at the event object for the namespace. For business.updated, write fields directly against the Business object, for example "{ id name runs { id agent } }". The selected object replaces only `data.object` in delivered webhook payloads.
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `422` — invalid request

---

[API](https://skmtc.net/middesk/apis/middesk-api.md) · [All operations](https://skmtc.net/middesk/apis/middesk-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/middesk/middesk-api/versions/9882e52b445b/schema)
