Update a Webhook

PUT /api/v2/webhooks/{id}.json

Update a webhook to change its destination URL, add a description, modify the events you listen to or to enable/disable it.

Scope

Requires the default scope only.

Parameters

Your request must provide the following URL parameters:

id required
The ID of your Webhook object


Request body

Your request body must contain an object including:

data required
Containing updates to your Webhook object.


Example JSON request

To update a Webhook you must PUT JSON to this resource within a data object. You do not need to supply all properties and may choose to only supply properties that require modifying.

{
    "data": {
        "events": [
            "product/*",
            "category/*",
        ]
    }
}


Success responses

If the Webhook was updated successfully you should receive a response with a 200 status code:

success
A boolean where a value of true means the Webhook was created successfully.
status
The HTTP status code e.g. 200 means the Webhook was updated successfully.
data
Contains the Webhook object you updated.


Error responses

If the Webhook could not be updated you will encounter a response with either a 400, 404 or 422status code:

success
A boolean where a value of false means the Webhook could not be updated.
status
  • 400 may indicate that the ID was not provided.
  • 404 means Webhook could not be found by the ID provided.
  • 422 means the Webhook could not be updated due to errors in the object data.
context
  • parameters means the error is with the required id URL parameter.
  • data indicates an error within the Webhook data.
errors

Contains an array of error objects, each will have the following properties:

  • name - The property name that encountered an error.
  • message - A human readable error message.
  • ref - An error reference string (e.g. error.invalid if one or more of the event strings did not validate).