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

# Update a webhook event schema

`PATCH /v1/webhooks/{webhook_id}/event_schemas/{id}`

Updates the GraphQL selection set for a webhook event schema. The namespace is immutable. Changes apply to future event snapshots only.

## Path parameters

- `webhook_id` string, required
- `id` string, required

## Headers

- `Authorization` string, required

## Request body

- object
  - `schema` string, required — GraphQL selection set rooted at the event object for the namespace. Updating this value affects future event snapshots only. Existing event snapshots continue to deliver the payload captured when the event was created.

## Response `200`

webhook event schema updated

- 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

- `404` — webhook event schema not found
- `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)
