Update Webhook
Updates an existing webhook.
HTTP Request
- URL:
/webhook/update/{id} - Method:
PUT - Headers:
accessToken: Required. Your API access token.Content-Type:application/json
- Required scope:
READ_WRITE_WEBHOOK
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | String | Required. The ID of the webhook to update. |
Request Body
The request body is a JSON object with the following fields:
| Field | Type | Required | Description |
|---|---|---|---|
name | String | Yes | Name of the webhook. |
url | String | Yes | URL that receives the webhook requests. |
events | Array | Yes | Event codes. Replaces the current list. See Events. |
description | String | No | Description of the webhook. |
active | Boolean | No | Whether the webhook is active. |
cURL Example
curl --location --request PUT '<BASE_URL>/webhook/update/66e2b7c1a4f3d2e1c0b9a876' \
--header 'accessToken: <ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"name": "ERP order sync",
"url": "https://erp.example.com/hooks/axim/v2",
"events": ["order.create", "order.update", "invoice.create"],
"active": true
}'
Response
- 200 OK: The request was processed. Check
successto see whether the webhook was updated. - 400 Bad Request: The access token is missing or invalid, the token does not have the required scope, or a required field is missing.
Sample JSON Response
{
"success": true,
"message": "WebHook updated Successfully",
"data": {
"_id": "66e2b7c1a4f3d2e1c0b9a876",
"name": "ERP order sync",
"url": "https://erp.example.com/hooks/axim/v2",
"description": "Sends new and updated orders to the ERP.",
"events": ["order.create", "order.update", "invoice.create"],
"active": true,
"createdAt": "2024-09-12T09:14:41.220Z",
"updatedAt": "2024-10-02T15:27:08.664Z",
"id": "66e2b7c1a4f3d2e1c0b9a876"
}
}
Response Details
| Field | Type | Description |
|---|---|---|
success | Boolean | Whether the webhook was updated. |
message | String | Result message. |
data | Object | The updated webhook. See Webhook Data. |
Notes
- If no webhook matches the ID,
successisfalseandmessageisWebHook not found.