Update a Webhook
Endpointβ
PUT https://api.verifik.co/v2/webhooks/{id}
Method for updating an existing webhook. To make the service work, the _id parameter is required, which is generated when a webhook is created correctly.
headersβ
| Name | Value |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer <token> |
path parametersβ
idβ
Type: string
Required: Yes
The unique identifier of the webhook to update.
body parametersβ
nameβ
Type: string
Required: No
The new name you want this webhook to have.
urlβ
Type: string
Required: No
You can update the url to where you want to receive the POST calls.
descriptionβ
Type: string
Required: No
The new description you want this webhook to have.
linkβ
Type: array
Required: No
Array of projectFlows that you want to link this webhook to.
unlinkβ
Type: array
Required: No
Array of projectFlows that you want to unlink from this webhook.
Request Exampleβ
- Node.js
- Python
- PHP
- Go
import axios from 'axios';
const options = {
method: 'PUT',
url: 'https://api.verifik.co/v2/webhooks/66de320d6a5c6ef0e02d4223',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer <your_token>'
},
data: {
url: 'https://sandbox.verifik.co/v2/webhooks/logs',
name: 'Updated webhook name',
description: 'Updated description'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
import http.client
import json
conn = http.client.HTTPSConnection("api.verifik.co")
payload = json.dumps({
"url": "https://sandbox.verifik.co/v2/webhooks/logs",
"name": "Updated webhook name",
"description": "Updated description"
})
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer <your_token>'
}
conn.request("PUT", "/v2/webhooks/66de320d6a5c6ef0e02d4223", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('PUT', 'https://api.verifik.co/v2/webhooks/66de320d6a5c6ef0e02d4223', [
'headers' => [
'Content-Type': 'application/json',
'Authorization' => 'Bearer <your_token>',
],
'json' => [
'url' => 'https://sandbox.verifik.co/v2/webhooks/logs',
'name' => 'Updated webhook name',
'description' => 'Updated description'
]
]);
echo $response->getBody();
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
url := "https://api.verifik.co/v2/webhooks/66de320d6a5c6ef0e02d4223"
payload := map[string]interface{}{
"url": "https://sandbox.verifik.co/v2/webhooks/logs",
"name": "Updated webhook name",
"description": "Updated description",
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("PUT", url, bytes.NewBuffer(jsonData))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer <your_token>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
Response Exampleβ
- 200 OK
- Error
{
"data": {
"_id": "66de320d6a5c6ef0e02d4223",
"client": "613375a1eab2fe08527f81e2",
"projectFlow": [],
"isActive": true,
"name": "Updated webhook name",
"url": "https://sandbox.verifik.co/v2/webhooks/logs",
"notification": {
"success": false,
"fail": true,
"_id": "66de320d6a5c6ef0e02d4222"
},
"updatedAt": "2024-09-08T23:23:57.678Z",
"createdAt": "2024-09-08T23:23:57.678Z",
"__v": 0
}
}
{
"code": "NotFound",
"message": "Record not found."
}
- Flexible Updates: Update any webhook field independently
- Project Flow Management: Link or unlink project flows from webhooks
- Partial Updates: Only send the fields you want to change
- Multiple Programming Languages: Support for JavaScript, Python, PHP, and Swift
- Error Handling: Proper 404 responses for non-existent webhooks