GetOTP Documentation
Update Webhook
The Webhooks API provides a way to update your Webhooks.
Request for Update Webhook API
To update a Webhook, make a PUT request to our Webhook endpoint.
https://api.otp.dev/v1/webhooks/{webhook_id}With the following Basic HTTP verification method:
| Description | Required | Data Type | Example |
|---|---|---|---|
| Your API Key | Yes | String | mtbi2w4hlendfpxa1igthcu5p6mzxf7k |
Note
- Grab your API key from this page
With the following parameter:
| Name | Description | Required | Data Type | Example |
|---|---|---|---|---|
| webhook_id | The unique identifier of the webhook | Yes | String | 3fa85f64-5717-4562-b3fc-2c963f66afa6 |
| url | The URL of the webhook | Yes | String | https://example.com |
| secret | The secret of the webhook | Yes | String | 1234567890 |
| name | The name of the webhook | Yes | String | My Webhook |
Examples
Below is an example request using cURL:
curl --request PUT \
--url https://api.otp.dev/v1/webhooks/3fa85f64-5717-4562-b3fc-2c963f66afa6 \
--header 'X-OTP-Key: {YOUR_API_KEY}' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"data": {
"url": "https://example.com",
"secret": "1234567890",
"name": "My Webhook"
}
}
'The response would be a JSON structure, returned with HTTP 200 Codestatus code:
{
"data": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"account_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"url": "https://example.com",
"secret": "1234567890",
"event": "DELIVERY",
"name": "My Webhook",
"channel": "SMS",
"create_date": "2025-10-13 05:47:42",
"update_date": "2025-10-13 05:47:42",
"links": {
"self": "string",
"account": "string"
}
}
}Response data details:
| Name | Description | Data Type | Example |
|---|---|---|---|
| data.id | The unique identifier of the webhook | String (UUID) | 3fa85f64-5717-4562-b3fc-2c963f66afa6 |
| data.account_id | The unique identifier of the account | String (UUID) | 3fa85f64-5717-4562-b3fc-2c963f66afa6 |
| data.url | The URL of the webhook | String (URL) | https://example.com |
| data.secret | The secret of the webhook | String | 1234567890 |
| data.event | The event of the webhook | String | DELIVERY |
| data.name | Human-friendly webhook name | String | My Webhook |
| data.channel | Messaging channel | String | SMS |
| data.create_date | Creation date of the webhook in UTC, formatted as yyyy-mm-dd hh:mm:ss | String (datetime) | 2025-09-24 07:09:20 |
| data.update_date | Updated date of the webhook in UTC, formatted as yyyy-mm-dd hh:mm:ss | String (datetime) | 2025-09-24 07:09:20 |
| data.links.self | URL of the webhook | String (URL) | string |
| data.links.account | URL of the account | String (URL) | string |
If there is an error with the API call, you will receive a JSON response with 400+ status code, error code and message.
{
"errors": [{
"timestamp": "2025-08-18 00:00:00",
"path": "/v1/webhooks/3fa85f64-5717-4562-b3fc-2c963f66afa6",
"method": "PUT",
"status": 404,
"message": "Webhook not found",
"code": "1201"
}]
}Please refer to this table for details:
| Error Code | Description | HTTP Code |
|---|---|---|
| 1201 | Webhook not found | 404 |
| 1208 | 'data.url' is too long | 400 |
| 1209 | Illegal given domain name: Contains non-LDH ASCII characters | 400 |