---
title: "Update an existing webhook"
method: PUT
path: "/webhooks/{webhookId}"
tags: ["Webhook"]
---

# Update an existing webhook

`PUT /webhooks/{webhookId}`

Overwrites the URL, events, and store IDs.
Requires the `user.webhooks.update` permission.

## Path parameters

- `webhookId` string, uuid, required

## Request body

- WebhookForm — Represents a form for configuring webhooks. This form includes a URL for the webhook, a list of event types, and a list of store IDs the webhook should apply to.
  - `url` string, uri, required — The URL associated with this webhook. Required and must be a valid URL.
  - `eventTypes` string[], required — The event types this webhook should subscribe to. Must contain at least one entry.
  - `storeIds` string[], required — The list of store IDs to which this webhook will be linked.

## Response `200`

The object was successfully updated.

- WebhookResponse — Represents a default generic response for API endpoints.
  - `success` boolean, required — Indicates whether the operation or response was successful.
  - `message` string, nullable — A descriptive message providing additional context or information about the response.
  - `code` string, nullable — The error code (if there was an error) to use when referencing the error
  - `data` Webhook — Merchant-facing webhook, V2 system not the old one. Supports multiple store IDs in StoreIds.
    - `id` string, uuid, required — The unique identifier of the entity
    - `dateCreated` string, date-time, required — The date the entity was created in the database
    - `url` string, required — The URL that the webhook will send data to. This is required and must not exceed 3000 characters in length.
    - `events` string[], required — The events that the webhook is subscribed to.
    - `storeIds` string[], required — The list of store IDs this webhook applies to. Storing as an array of Guid. You can keep a bridging table if needed, but here we store them directly in the Webhook entity.
    - `executionLogs` WebhookExecutionLog[], required — Execution logs associated with this webhook.
      - `id` string, uuid, required — The unique identifier of the entity
      - `dateCreated` string, date-time, required — The date the entity was created in the database
      - `url` string, required — The URL associated with the webhook execution log.
      - `signature` string, required — The signature of the webhook execution, used for validation and security purposes.
      - `requestBody` string, required — The body of the request sent in a webhook execution.
      - `responseCode` integer, nullable — The HTTP response code resulting from executing the webhook.
      - `responseBody` string, nullable — The response body returned by a webhook execution log.
      - `webhookId` string, uuid, nullable — The unique identifier of the webhook associated with this log.
      - `userId` string, nullable — The ID of the user who owns the webhook. Nullable for backwards compatibility with existing logs that predate this field.
      - `retryCount` integer, required — The number of times this webhook has been dispatched (initial + retries via Hangfire requeue). Starts at 1 for the first attempt and increments on each resend.
      - `userAgent` string, nullable — The user agent header sent to the merchant's endpoint.
      - `orderId` string, uuid, nullable — The unique identifier for the order associated with the webhook execution log.
    - `userId` string, required — The user who owns this webhook.

## Other responses

- `400` — The provided form information is not valid, check that the provided data is valid. You can use the 'invalidFields' field to get the list of invalid fields or just use the 'message' field.
- `401` — You are not authorized, check your API key and try again.
- `403` — You are not authorized to access this endpoint, you may be missing an API key scope or be requesting a privileged endpoint.
- `404` — One of the objects referenced by the ID given in the URL or form was not found, check the ID and try again.

---

[API](https://skmtc.net/komerza/apis/komerza-api.md) · [All operations](https://skmtc.net/komerza/apis/komerza-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/komerza/komerza-api/revisions/060e78bc7f80/schema)
