Update API Webhook
Used to update API tool webhook configuration. This allows you to modify webhook settings including the endpoint URL, enabled status, events, headers, authentication secrets, and retry behavior.
API Endpoint
| Property | Value |
|---|---|
| Request Method | POST |
| Request URL | https://api.seliseblocks.com/tools/api-webhook/{tool_id} |
Request
Request Example
curl -X POST 'https://api.seliseblocks.com/tools/api-webhook/{tool_id}' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"Enabled": true,
"URL": "https://your-webhook-endpoint.com/webhook",
"Events": ["tool.executed"],
"Headers": {
"Authorization": "Bearer your-token",
"X-Custom-Header": "custom-value"
},
"Secret": "your-secret-key",
"RetryAttempts": 3,
"TimeoutSeconds": 10
}'
Path Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| tool_id | string | Yes | The unique identifier of the API tool. |
Request Headers
| Field | Type | Required | Description |
|---|---|---|---|
| accept | string | Yes | Accepted response format. Use application/json |
| Content-Type | application/json | Yes | Data type, must be application/json. |
Request Body
Request Body Schema
{
"Enabled": false,
"URL": "string",
"Events": [
"tool.executed"
],
"Headers": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
},
"Secret": "string",
"RetryAttempts": 3,
"TimeoutSeconds": 10
}
Request Body Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| Enabled | boolean | No | Whether the webhook is enabled or disabled. |
| URL | string | No | The webhook endpoint URL where events will be sent. |
| Events | array | No | List of events that trigger the webhook (e.g., "tool.executed"). |
| Headers | object | No | Custom HTTP headers to include in webhook requests. |
| Secret | string | No | Secret key for webhook authentication/verification. |
| RetryAttempts | integer | No | Number of retry attempts for failed webhook calls (default: 3). |
| TimeoutSeconds | integer | No | Timeout duration in seconds for webhook requests (default: 10). |
note
Webhook Configuration Notes
- Events: Currently supports "tool.executed" event type
- Headers: Use custom headers for authentication or additional metadata
- Secret: Used to sign webhook payloads for verification on your endpoint
- RetryAttempts: Webhook will automatically retry on failure up to the specified number of times
- TimeoutSeconds: Requests exceeding this duration will be cancelled
tip
After updating a webhook configuration, the system will:
- Validate the webhook URL if provided
- Apply the new settings immediately
- Use the updated configuration for all subsequent events
- Retry failed webhook deliveries according to the new retry settings
Response
Success Response (200 OK)
Returns an object containing the update status.
{
"is_success": true,
"item_id": "tool_12345",
"detail": "Webhook configuration updated successfully",
"error": {}
}
Response Fields
| Field | Type | Description |
|---|---|---|
| is_success | boolean | Indicates whether the update was successful. |
| item_id | string | The identifier of the updated webhook configuration. |
| detail | string | Success or failure message with additional context. |
| error | object | Error details if the operation failed (empty if successful). |
Error Response (422 Unprocessable Entity)
Returns validation error details when the request body is invalid.
{
"detail": [
{
"loc": [
"body",
"URL"
],
"msg": "invalid URL format",
"type": "value_error.url"
}
]
}
Error Response Fields
| Field | Type | Description |
|---|---|---|
| detail | array | Array of validation error objects. |
| loc | array | Location of the error in the request (e.g., body field). |
| msg | string | Human-readable error message. |
| type | string | Error type identifier. |
Error Codes
| Status Code | Description | Response Type |
|---|---|---|
| 200 | Successful Response | Success |
| 400 | Bad Request - Invalid webhook configuration | Bad Request |
| 404 | Not Found - API tool does not exist | Not Found |
| 422 | Validation Error - Invalid request parameters | Unprocessable Entity |