Skip to content

Update a webhook subscription. Rotate the secret or re-enable a disabled subscription.

PATCH
/v1/webhooks/{id}
curl --request PATCH \
--url https://api.staging.elasticstage.com/store/v1/webhooks/example \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "url": "https://example.com", "events": [ "product.available" ], "secret": "example", "status": "active" }'
id
required
string
Media typeapplication/json
object
url
string format: uri
<= 2048 characters
events
Array<string>
>= 1 items
Allowed values: product.available product.unavailable product.inventory_changed product.out_of_stock product.in_stock order.created order.processing order.shipped order.tracking_updated order.delivered order.cancelled order.payment_failed
secret
string
>= 1 characters <= 256 characters
status
string
Allowed values: active disabled

Default Response

Media typeapplication/json
object
id
required
string
events
required
Array<string>
Allowed values: product.available product.unavailable product.inventory_changed product.out_of_stock product.in_stock order.created order.processing order.shipped order.tracking_updated order.delivered order.cancelled order.payment_failed
url
required
string format: uri
status
required
string
Allowed values: active disabled
consecutive_failures
required
integer
<= 9007199254740991
last_delivery_at
required
Any of:
string format: date-time
last_failure_at
required
Any of:
string format: date-time
disabled_at
required
Any of:
string format: date-time
Example
{
"id": "whk_2d7e9b",
"events": [
"order.created",
"order.tracking_updated"
],
"url": "https://hooks.example.com/elasticstage",
"status": "active",
"consecutive_failures": 0,
"last_delivery_at": null,
"last_failure_at": null,
"disabled_at": null
}

Default Response

Media typeapplication/json
object
statusCode
required
number
code
required
string
Allowed values: VALIDATION_ERROR UNAUTHORIZED FORBIDDEN NOT_FOUND CONFLICT UNPROCESSABLE_ENTITY RATE_LIMITED SERVICE_UNAVAILABLE INTERNAL_ERROR
error
required
string
message
required
string
details
Array
Example
{
"statusCode": 400,
"code": "VALIDATION_ERROR",
"error": "Bad Request",
"message": "Request validation failed.",
"details": [
{
"field": "items",
"reason": "must contain at least 1 item"
}
]
}

Default Response

Media typeapplication/json
object
statusCode
required
number
code
required
string
Allowed values: VALIDATION_ERROR UNAUTHORIZED FORBIDDEN NOT_FOUND CONFLICT UNPROCESSABLE_ENTITY RATE_LIMITED SERVICE_UNAVAILABLE INTERNAL_ERROR
error
required
string
message
required
string
details
Array
Example
{
"statusCode": 401,
"code": "UNAUTHORIZED",
"error": "Unauthorized",
"message": "Authentication required."
}

Default Response

Media typeapplication/json
object
statusCode
required
number
code
required
string
Allowed values: VALIDATION_ERROR UNAUTHORIZED FORBIDDEN NOT_FOUND CONFLICT UNPROCESSABLE_ENTITY RATE_LIMITED SERVICE_UNAVAILABLE INTERNAL_ERROR
error
required
string
message
required
string
details
Array
Example
{
"statusCode": 403,
"code": "FORBIDDEN",
"error": "Forbidden",
"message": "Insufficient permissions."
}

Default Response

Media typeapplication/json
object
statusCode
required
number
code
required
string
Allowed values: VALIDATION_ERROR UNAUTHORIZED FORBIDDEN NOT_FOUND CONFLICT UNPROCESSABLE_ENTITY RATE_LIMITED SERVICE_UNAVAILABLE INTERNAL_ERROR
error
required
string
message
required
string
details
Array
Example
{
"statusCode": 404,
"code": "NOT_FOUND",
"error": "Not Found",
"message": "The requested resource was not found."
}

Default Response

Media typeapplication/json
object
statusCode
required
number
code
required
string
Allowed values: VALIDATION_ERROR UNAUTHORIZED FORBIDDEN NOT_FOUND CONFLICT UNPROCESSABLE_ENTITY RATE_LIMITED SERVICE_UNAVAILABLE INTERNAL_ERROR
error
required
string
message
required
string
details
Array
Example
{
"statusCode": 429,
"code": "RATE_LIMITED",
"error": "Too Many Requests",
"message": "Rate limit exceeded."
}

Default Response

Media typeapplication/json
object
statusCode
required
number
code
required
string
Allowed values: VALIDATION_ERROR UNAUTHORIZED FORBIDDEN NOT_FOUND CONFLICT UNPROCESSABLE_ENTITY RATE_LIMITED SERVICE_UNAVAILABLE INTERNAL_ERROR
error
required
string
message
required
string
details
Array
Example
{
"statusCode": 500,
"code": "INTERNAL_ERROR",
"error": "Internal Server Error",
"message": "An unexpected error occurred."
}

Default Response

Media typeapplication/json
object
statusCode
required
number
code
required
string
Allowed values: VALIDATION_ERROR UNAUTHORIZED FORBIDDEN NOT_FOUND CONFLICT UNPROCESSABLE_ENTITY RATE_LIMITED SERVICE_UNAVAILABLE INTERNAL_ERROR
error
required
string
message
required
string
details
Array
Example
{
"statusCode": 503,
"code": "SERVICE_UNAVAILABLE",
"error": "Service Unavailable",
"message": "The service is temporarily unavailable."
}