Update webhook
/webhook/{id}
Path Parameters
The ID of the webhook to update.
Request Body
The list of event types that the webhook is subscribed to. If not specified, then the webhook will be subscribed to all event types.
sync_job_run:createdsync_job_run:updatedsync_job_run:startedsync_job_run:completedsync_job_run:failedsync_job_run:recordintegrated_account:createdintegrated_account:updatedintegrated_account:activeintegrated_account:reactivatedintegrated_account:authentication_errorintegrated_account:post_install_errorintegrated_account:validation_errorintegrated_account:post_connect_form_submittedrecord:createdrecord:updatedrecord:deletedsync_job_cron_trigger:failedbatch_job:dry_run_completedbatch_job:completedbatch_job:dry_run_failedbatch_job:failed+ 10 more
Whether the webhook is active or not.
trueThe URL where the webhook payload will be sent.
https://example.com/webhookResponse Body
The date and time when the webhook was created.
2021-08-10T10:00:00.000ZThe ID of the environment that this webhook belongs to.
05daecaf-4365-42e8-8370-8127de5dd717The list of event types that the webhook is subscribed to.
["integrated_account:created", "integrated_account:updated"]sync_job_run:createdsync_job_run:updatedsync_job_run:startedsync_job_run:completedsync_job_run:failedsync_job_run:recordintegrated_account:createdintegrated_account:updatedintegrated_account:activeintegrated_account:reactivatedintegrated_account:authentication_errorintegrated_account:post_install_errorintegrated_account:validation_errorintegrated_account:post_connect_form_submittedrecord:createdrecord:updatedrecord:deletedsync_job_cron_trigger:failedbatch_job:dry_run_completedbatch_job:completedbatch_job:dry_run_failedbatch_job:failed+ 10 more
The ID of the webhook.
4a4de828-f4db-4c9e-adfd-434e0864c3c7Whether the webhook is active or not. Inactive webhooks will not receive any data.
trueThe URL where the webhook should send the data.
https://example.com/webhookThe date and time when the webhook was last updated.
2021-08-10T10:00:00.000Zcurl -X PATCH 'https://api.truto.one/webhook/{id}' \
-H 'Authorization: Bearer <your_api_token>' \
-H 'Content-Type: application/json' \
-d '{
"target_url": "https://example.com/webhook",
"is_active": true,
"event_types": []
}'const body = {
"target_url": "https://example.com/webhook",
"is_active": true,
"event_types": []
};
const response = await fetch('https://api.truto.one/webhook/{id}', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer <your_api_token>',
'Content-Type': 'application/json',
},
body: JSON.stringify(body),
});
const data = await response.json();
console.log(data);import requests
url = "https://api.truto.one/webhook/{id}"
headers = {
"Authorization": "Bearer <your_api_token>",
"Content-Type": "application/json",
}
params = {
}
payload = {
"target_url": "https://example.com/webhook",
"is_active": True,
"event_types": []
}
response = requests.patch(url, headers=headers, params=params, json=payload)
print(response.json())import Truto from '@truto/truto-ts-sdk';
const truto = new Truto({
token: '<your_api_token>',
});
const body = {
"target_url": "https://example.com/webhook",
"is_active": true,
"event_types": []
};
const result = await truto.webhook.update('<id>', body);
console.log(result);import asyncio
from truto_python_sdk import TrutoApi
truto_api = TrutoApi(token="<your_api_token>")
async def main():
body = {
"target_url": "https://example.com/webhook",
"is_active": True,
"event_types": []
}
result = await truto_api.webhooks.update("<id>", body)
print(result)
asyncio.run(main())