GetOTP Documentation

Webhook

The Webhook API provides a way to get your custom Webhook.

Request for Webhook API

To get a single Webhook, make a GET request to our Webhook endpoint.

https://api.otp.dev/v1/webhooks/{webhook_id}

With the following Basic HTTP verification method:

DescriptionRequiredData TypeExample
Your API KeyYesStringmtbi2w4hlendfpxa1igthcu5p6mzxf7k

Note

With the following parameter:

NameDescriptionRequiredData TypeExample
webhook_idThe unique identifier of the webhookYesString3fa85f64-5717-4562-b3fc-2c963f66afa6

Examples

Below is an example request using cURL:

curl --request GET \
    --url https://api.otp.dev/v1/webhooks/3fa85f64-5717-4562-b3fc-2c963f66afa6 \
    --header 'X-OTP-Key: {YOUR_API_KEY}' \
    --header 'accept: application/json'

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:

NameDescriptionData TypeExample
data.idThe unique identifier of the webhookString (UUID)3fa85f64-5717-4562-b3fc-2c963f66afa6
data.account_idThe unique identifier of the accountString (UUID)3fa85f64-5717-4562-b3fc-2c963f66afa6
data.urlThe URL of the webhookString (URL)https://example.com
data.secretThe secret of the webhookString1234567890
data.eventThe event of the webhookStringDELIVERY
data.nameHuman-friendly webhook nameStringMy Webhook
data.channelMessaging channelStringSMS
data.create_dateCreation date of the webhook in UTC, formatted as yyyy-mm-dd hh:mm:ssString (datetime)2025-09-24 07:09:20
data.update_dateUpdated date of the webhook in UTC, formatted as yyyy-mm-dd hh:mm:ssString (datetime)2025-09-24 07:09:20
data.links.selfURL of the webhookString (URL)string
data.links.accountURL of the accountString (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": "GET",
        "status": 404,
        "message": "Webhook not found",
        "code": "1201"
    }]
}

Please refer to this table for details:

Error CodeDescriptionHTTP Code
1201Webhook not found404