Skip to main content

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​

ParameterTypeDescription
idStringRequired. The ID of the webhook to update.

Request Body​

The request body is a JSON object with the following fields:

FieldTypeRequiredDescription
nameStringYesName of the webhook.
urlStringYesURL that receives the webhook requests.
eventsArrayYesEvent codes. Replaces the current list. See Events.
descriptionStringNoDescription of the webhook.
activeBooleanNoWhether 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 success to 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​

FieldTypeDescription
successBooleanWhether the webhook was updated.
messageStringResult message.
dataObjectThe updated webhook. See Webhook Data.

Notes​

  • If no webhook matches the ID, success is false and message is WebHook not found.