{"id":18925,"date":"2026-11-19T00:16:58","date_gmt":"2026-11-18T18:46:58","guid":{"rendered":"https:\/\/www.fast2sms.com\/help\/webhook-secret-header\/"},"modified":"2026-11-19T00:56:17","modified_gmt":"2026-11-18T19:26:17","slug":"webhook-secret-header","status":"publish","type":"post","link":"https:\/\/www.fast2sms.com\/help\/webhook-secret-header\/","title":{"rendered":"How to secure your Fast2SMS webhook (secret header and webhook_secret_key)"},"content":{"rendered":"<p>Your webhook URL is a public address, so anyone who learns it could send fake delivery reports to it. This guide shows how to secure a Fast2SMS webhook so your server accepts only real requests: add a secret header, check it in your code, and use a few simple checks on the data. It is for developers who receive SMS, OTP, WhatsApp, RCS or voice reports by webhook.<\/p>\n<aside class=\"f2s-cta\" aria-label=\"Get started with Fast2SMS\"><div class=\"f2s-cta__copy\"><strong class=\"f2s-cta__title\">Receive delivery reports safely<\/strong><p>Add a webhook in Fast2SMS and protect it with your own secret header in two minutes.<\/p><\/div><div class=\"f2s-cta__actions\"><a class=\"f2s-cta__btn f2s-cta__btn--primary\" href=\"https:\/\/www.fast2sms.com\/\"><span>Sign up free<\/span> <span class=\"f2sh-btn__arrow\" aria-hidden=\"true\">&rarr;<\/span><\/a><a class=\"f2s-cta__btn f2s-cta__btn--ghost\" href=\"https:\/\/www.fast2sms.com\/meet\/\" target=\"_blank\" rel=\"noopener\">Book a free meeting<\/a><\/div><\/aside>\n<h2>The short answer<\/h2>\n<ul>\n<li>Add a header with a long random secret to your webhook in the <strong>Headers<\/strong> tab, for example <code>X-Webhook-Token<\/code>.<\/li>\n<li>In your endpoint, compare that header with the secret stored on your server and reject the request with HTTP 401 when it does not match.<\/li>\n<li>Use an <code>https:\/\/<\/code> URL so the secret and the data are encrypted on the way.<\/li>\n<li>Only act on reports whose <code>request_id<\/code> you actually received from the send API.<\/li>\n<\/ul>\n<h2>Before you start<\/h2>\n<ul>\n<li>A webhook already created under <strong>Webhook<\/strong> for your channel. See the setup guide linked at the end if you have not made one yet.<\/li>\n<li>Access to the code of the endpoint that receives the webhook.<\/li>\n<li>A random secret of at least 32 characters. A password manager or <code>openssl rand -hex 32<\/code> can create one.<\/li>\n<\/ul>\n<h2>Add a secret header to your webhook<\/h2>\n<ol class=\"f2s-steps\">\n<li>\n<h3>Open the webhook<\/h3>\n<p>Go to <strong>Webhook<\/strong>, open the channel (SMS, WhatsApp, OTP, RCS or Voice), click the three dots on your webhook and choose <strong>Edit Webhook<\/strong>.<\/p>\n<figure class=\"f2s-shot\"><img src=\"https:\/\/www.fast2sms.com\/help\/wp-content\/uploads\/2026\/11\/webhook-row-menu-hd-2-scaled.webp\" width=\"1440\" height=\"900\" loading=\"lazy\" decoding=\"async\" alt=\"Row menu on an SMS webhook with Edit Webhook, Test Webhook and Delete Webhook\"><figcaption>Edit the webhook from its row menu.<\/figcaption><\/figure>\n<\/li>\n<li>\n<h3>Add the header<\/h3>\n<p>On the right, open the <strong>Headers<\/strong> tab and click <strong>+ Add Header<\/strong>. Type the header name in the first box and your secret in the second box. Use a name your server can read easily, such as <code>X-Webhook-Token<\/code>.<\/p>\n<figure class=\"f2s-shot\"><img src=\"https:\/\/www.fast2sms.com\/help\/wp-content\/uploads\/2026\/11\/webhook-edit-modal-standard-headers-hd-scaled.webp\" width=\"1440\" height=\"900\" loading=\"lazy\" decoding=\"async\" alt=\"EDIT WEBHOOK (SMS) with the Headers tab open showing one custom header with a key and a value, and an Add Header button\"><figcaption>Each header has a name and a value. Your secret goes in the value.<\/figcaption><\/figure>\n<\/li>\n<li>\n<h3>Save and test<\/h3>\n<p>Click <strong>SAVE CHANGES<\/strong>. Then use <strong>Test Webhook<\/strong> from the row menu. The test request carries the same headers, so you can confirm that your server reads the secret and answers 200.<\/p>\n<\/li>\n<li>\n<h3>Check the request in Webhook Logs<\/h3>\n<p>Open <strong>Webhook Logs<\/strong>, click the three dots on the newest row and choose <strong>View Details<\/strong>. The <strong>Request Data<\/strong> tab shows the headers we sent, and <strong>Response Data<\/strong> shows your server&#8217;s answer.<\/p>\n<figure class=\"f2s-shot\"><img src=\"https:\/\/www.fast2sms.com\/help\/wp-content\/uploads\/2026\/11\/webhook-log-detail-response-hd-2-scaled.webp\" width=\"1440\" height=\"900\" loading=\"lazy\" decoding=\"async\" alt=\"Webhook Execution Details showing a POST with HTTP 200 success, the response time, the channel and event, and the response body from the server\"><figcaption>A request your server accepted.<\/figcaption><\/figure>\n<\/li>\n<\/ol>\n<h2>Check the secret in your code<\/h2>\n<p>Compare the header with a constant-time function so the check does not leak hints about the secret through timing. Keep the secret in an environment variable, not in your code.<\/p>\n<h3>PHP<\/h3>\n<pre><code class=\"language-php\">&lt;?php\n$expected = getenv('F2S_WEBHOOK_TOKEN');\n$received = $_SERVER['HTTP_X_WEBHOOK_TOKEN'] ?? '';\n\nif ($expected === false || hash_equals($expected, $received) === false) {\n    http_response_code(401);\n    exit('Unauthorized');\n}\n\n$data = json_decode(file_get_contents('php:\/\/input'), true);\n\/\/ save $data, then reply\nhttp_response_code(200);\necho 'OK';<\/code><\/pre>\n<h3>Node.js (Express)<\/h3>\n<pre><code class=\"language-javascript\">const crypto = require('crypto');\nconst express = require('express');\nconst app = express();\napp.use(express.json());\n\napp.post('\/fast2sms\/webhook', (req, res) =&gt; {\n  const expected = Buffer.from(process.env.F2S_WEBHOOK_TOKEN || '');\n  const received = Buffer.from(req.get('X-Webhook-Token') || '');\n  const ok = expected.length &gt; 0 &amp;&amp;\n    expected.length === received.length &amp;&amp;\n    crypto.timingSafeEqual(expected, received);\n  if (ok === false) return res.status(401).send('Unauthorized');\n\n  \/\/ save req.body, then reply\n  res.status(200).send('OK');\n});\n\napp.listen(3000);<\/code><\/pre>\n<h3>Python (Flask)<\/h3>\n<pre><code class=\"language-python\">import hmac, os\nfrom flask import Flask, request\n\napp = Flask(__name__)\n\n@app.post(\"\/fast2sms\/webhook\")\ndef webhook():\n    expected = os.environ.get(\"F2S_WEBHOOK_TOKEN\", \"\")\n    received = request.headers.get(\"X-Webhook-Token\", \"\")\n    if not expected or not hmac.compare_digest(expected, received):\n        return \"Unauthorized\", 401\n    data = request.get_json(silent=True) or {}\n    # save data, then reply\n    return \"OK\", 200<\/code><\/pre>\n<div class=\"f2s-note f2s-note--warn\">Return 401 only for a wrong secret. Fast2SMS does not retry 4xx answers, so a real report that you reject by mistake will not come back on its own. You can still resend it once from Webhook Logs within 7 days.<\/div>\n<aside class=\"f2s-cta\" aria-label=\"Get started with Fast2SMS\"><div class=\"f2s-cta__copy\"><strong class=\"f2s-cta__title\">Build on the Fast2SMS API<\/strong><p>Send SMS, Smart OTP and WhatsApp from your app and get secure delivery reports by webhook.<\/p><\/div><div class=\"f2s-cta__actions\"><a class=\"f2s-cta__btn f2s-cta__btn--primary\" href=\"https:\/\/www.fast2sms.com\/\"><span>Sign up free<\/span> <span class=\"f2sh-btn__arrow\" aria-hidden=\"true\">&rarr;<\/span><\/a><a class=\"f2s-cta__btn f2s-cta__btn--ghost\" href=\"https:\/\/www.fast2sms.com\/meet\/\" target=\"_blank\" rel=\"noopener\">Book a free meeting<\/a><\/div><\/aside>\n<h2>The webhook_secret_key header<\/h2>\n<p>Some accounts have the older signature setting switched on. Then every webhook request also carries a header named <code>webhook_secret_key<\/code> that holds a 40-character secret.<\/p>\n<ul>\n<li>It is the plain secret, not an HMAC signature of the body. Check it the same way as your own header: compare it with the value you saved.<\/li>\n<li>The new Webhook pages do not have a switch for this setting. If you want it, contact support. For most setups, your own header from the Headers tab does the same job and you control the value.<\/li>\n<li>If you see <code>webhook_secret_key<\/code> in <strong>Request Data<\/strong> in Webhook Logs, the setting is on for your account.<\/li>\n<\/ul>\n<h2>More checks that help<\/h2>\n<div class=\"f2s-facts\">\n<table>\n<thead>\n<tr>\n<th>Check<\/th>\n<th>How<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Use HTTPS<\/td>\n<td>Save an <code>https:\/\/<\/code> URL with a valid certificate. Over plain http, the secret header can be read on the way.<\/td>\n<\/tr>\n<tr>\n<td>Match request IDs<\/td>\n<td>Every send API reply has a <code>request_id<\/code> (S for SMS, O for <a href=\"\/help\/smart-otp-setup-guide-fast2sms\/\">Smart OTP<\/a>, W for WhatsApp, R for RCS, V for voice). Store it when you send, and ignore reports for IDs you never created.<\/td>\n<\/tr>\n<tr>\n<td>Use udf fields<\/td>\n<td>Pass your own order or user ID in <code>udf1<\/code> when sending. A report whose <code>udf1<\/code> does not match the stored record is suspicious.<\/td>\n<\/tr>\n<tr>\n<td>Allow the method you use<\/td>\n<td>If the webhook uses POST, reject GET and PUT on that path.<\/td>\n<\/tr>\n<tr>\n<td>Make updates repeat-safe<\/td>\n<td>The same report can arrive twice after a retry or resend. Update by request_id and mobile instead of inserting a new row.<\/td>\n<\/tr>\n<tr>\n<td>Keep the secret out of the URL<\/td>\n<td>A token in the query string ends up in server and proxy logs. A header is safer.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h2>Change the secret<\/h2>\n<ol>\n<li>Make your server accept both the old and the new secret for a short time.<\/li>\n<li>Edit the webhook, change the header value to the new secret and click <strong>SAVE CHANGES<\/strong>.<\/li>\n<li>Send a <strong>Test Webhook<\/strong> and check it succeeds.<\/li>\n<li>Remove the old secret from your server.<\/li>\n<\/ol>\n<p>Headers you add are shown in Webhook Logs to anyone who can open your Fast2SMS account, so change the secret if someone who had access leaves your team.<\/p>\n<h2>Common problems and fixes<\/h2>\n<h3>Every request now fails with 401<\/h3>\n<p>Your server cannot find the header. Some frameworks change header names: PHP reads <code>X-Webhook-Token<\/code> as <code>HTTP_X_WEBHOOK_TOKEN<\/code>. Check the exact name and value in Request Data in Webhook Logs.<\/p>\n<h3>The test passes but real reports fail<\/h3>\n<p>Check that you saved the webhook after adding the header. The test uses the saved settings, and so do real reports.<\/p>\n<h3>My firewall blocks the requests<\/h3>\n<p>Bot protection on your site can block automated requests. Create a rule that lets requests to your webhook path through and rely on the secret header for security.<\/p>\n<section class=\"f2s-faq\">\n<h2>Frequently asked questions<\/h2>\n<h3>Does Fast2SMS sign webhooks with HMAC?<\/h3>\n<p>No. The <code>webhook_secret_key<\/code> header, when it is on, carries the plain secret. Use your own secret header or that header and compare it with your saved value.<\/p>\n<h3>Can I add more than one header?<\/h3>\n<p>Yes. Click <strong>+ Add Header<\/strong> again for each header, for example a secret and a source tag.<\/p>\n<h3>Can I add a Bearer token in the Authorization header?<\/h3>\n<p>Yes. Add a header named <code>Authorization<\/code> with the value <code>Bearer<\/code> followed by your token, and check it on your server.<\/p>\n<h3>Is HTTP allowed for webhook URLs?<\/h3>\n<p>Public http and https URLs are both allowed, but use https so your secret is not sent in clear text.<\/p>\n<h3>Can I restrict my endpoint to Fast2SMS IP addresses?<\/h3>\n<p>Do not depend on source IPs. Check the secret header instead, which works wherever the request comes from.<\/p>\n<h3>Do the headers also apply to webhooks created by API?<\/h3>\n<p>Yes. The webhook management API accepts headers as <code>header_key[]<\/code> and <code>header_value[]<\/code> pairs.<\/p>\n<\/section>\n<aside class=\"f2s-cta\" aria-label=\"Get started with Fast2SMS\"><div class=\"f2s-cta__copy\"><strong class=\"f2s-cta__title\">Start sending with Fast2SMS<\/strong><p>Create your account, send by API and get every delivery report on your own secure URL.<\/p><\/div><div class=\"f2s-cta__actions\"><a class=\"f2s-cta__btn f2s-cta__btn--primary\" href=\"https:\/\/www.fast2sms.com\/\"><span>Sign up free<\/span> <span class=\"f2sh-btn__arrow\" aria-hidden=\"true\">&rarr;<\/span><\/a><a class=\"f2s-cta__btn f2s-cta__btn--ghost\" href=\"https:\/\/www.fast2sms.com\/meet\/\" target=\"_blank\" rel=\"noopener\">Book a free meeting<\/a><\/div><\/aside>\n<h2>Related guides<\/h2>\n<ul>\n<li><a href=\"\/help\/fast2sms-webhooks-setup-delivery-reports\/\">Webhooks in Fast2SMS: get delivery reports on your own URL<\/a><\/li>\n<li><a href=\"\/help\/webhook-payload-fields\/\">Webhook payload fields and sample JSON<\/a><\/li>\n<li><a href=\"\/help\/webhook-not-firing\/\">Fast2SMS webhook not working: checks, retries and resend<\/a><\/li>\n<li><a href=\"\/help\/api-security-ip-whitelist\/\">How to whitelist IP addresses for the Fast2SMS API<\/a><\/li>\n<li><a href=\"https:\/\/docs.fast2sms.com\">Fast2SMS API documentation<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Your webhook URL is a public address, so anyone who learns it could send fake delivery reports to it. This guide shows how to secure a Fast2SMS webhook so your server accepts only real requests: add a secret header, check it in your code, and use a few simple checks on the data. It is [&hellip;]<\/p>\n","protected":false},"featured_media":18918,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,31],"tags":[],"class_list":["post-18925","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-api","category-webhooks"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Secure Your Webhook: Secret Header Check | Fast2SMS<\/title>\n<meta name=\"description\" content=\"Protect your Fast2SMS webhook URL: add a secret header, check it in PHP, Node.js or Python, learn about webhook_secret_key and add HTTPS checks.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.fast2sms.com\/help\/webhook-secret-header\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Secure Your Webhook: Secret Header Check | Fast2SMS\" \/>\n<meta property=\"og:description\" content=\"Protect your Fast2SMS webhook URL: add a secret header, check it in PHP, Node.js or Python, learn about webhook_secret_key and add HTTPS checks.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.fast2sms.com\/help\/webhook-secret-header\/\" \/>\n<meta property=\"og:site_name\" content=\"Fast2SMS\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Fast2SMS\/\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-18T18:46:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-11-18T19:26:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.fast2sms.com\/help\/wp-content\/uploads\/2026\/11\/webhook-row-menu-hd-2-scaled.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"1600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@fast2sms\" \/>\n<meta name=\"twitter:site\" content=\"@fast2sms\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/webhook-secret-header\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/webhook-secret-header\\\/\"},\"author\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/#organization\"},\"headline\":\"How to secure your Fast2SMS webhook (secret header and webhook_secret_key)\",\"datePublished\":\"2026-11-18T18:46:58+00:00\",\"dateModified\":\"2026-11-18T19:26:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/webhook-secret-header\\\/\"},\"wordCount\":1175,\"publisher\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/webhook-secret-header\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/webhook-row-menu-hd-2-scaled.webp\",\"articleSection\":[\"API\",\"Webhooks\"],\"inLanguage\":\"en-IN\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/webhook-secret-header\\\/\",\"url\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/webhook-secret-header\\\/\",\"name\":\"Secure Your Webhook: Secret Header Check | Fast2SMS\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/webhook-secret-header\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/webhook-secret-header\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/webhook-row-menu-hd-2-scaled.webp\",\"datePublished\":\"2026-11-18T18:46:58+00:00\",\"dateModified\":\"2026-11-18T19:26:17+00:00\",\"description\":\"Protect your Fast2SMS webhook URL: add a secret header, check it in PHP, Node.js or Python, learn about webhook_secret_key and add HTTPS checks.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/webhook-secret-header\\\/#breadcrumb\"},\"inLanguage\":\"en-IN\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/webhook-secret-header\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-IN\",\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/webhook-secret-header\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/webhook-row-menu-hd-2-scaled.webp\",\"contentUrl\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/webhook-row-menu-hd-2-scaled.webp\",\"width\":2560,\"height\":1600,\"caption\":\"Row menu on an SMS webhook with Edit Webhook, Test Webhook and Delete Webhook\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/webhook-secret-header\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"API\",\"item\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/api\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to secure your Fast2SMS webhook (secret header and webhook_secret_key)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/#website\",\"url\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/\",\"name\":\"Fast2SMS\",\"description\":\"Help\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/#organization\"},\"inLanguage\":\"en-IN\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/#organization\",\"name\":\"Fast2SMS\",\"url\":\"https:\\\/\\\/www.fast2sms.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/#logo\",\"url\":\"https:\\\/\\\/www.fast2sms.com\\\/Fast2SMS.png\",\"contentUrl\":\"https:\\\/\\\/www.fast2sms.com\\\/Fast2SMS.png\",\"caption\":\"Fast2SMS\"},\"image\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/#logo\"},\"email\":\"support@fast2sms.com\",\"telephone\":\"+91-6262778822\",\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/Fast2SMS\",\"https:\\\/\\\/www.instagram.com\\\/fast2sms\",\"https:\\\/\\\/x.com\\\/fast2sms\",\"https:\\\/\\\/www.youtube.com\\\/Fast2SMSofficial\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/fast2sms\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Secure Your Webhook: Secret Header Check | Fast2SMS","description":"Protect your Fast2SMS webhook URL: add a secret header, check it in PHP, Node.js or Python, learn about webhook_secret_key and add HTTPS checks.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.fast2sms.com\/help\/webhook-secret-header\/","og_locale":"en_US","og_type":"article","og_title":"Secure Your Webhook: Secret Header Check | Fast2SMS","og_description":"Protect your Fast2SMS webhook URL: add a secret header, check it in PHP, Node.js or Python, learn about webhook_secret_key and add HTTPS checks.","og_url":"https:\/\/www.fast2sms.com\/help\/webhook-secret-header\/","og_site_name":"Fast2SMS","article_publisher":"https:\/\/www.facebook.com\/Fast2SMS\/","article_published_time":"2026-11-18T18:46:58+00:00","article_modified_time":"2026-11-18T19:26:17+00:00","og_image":[{"width":2560,"height":1600,"url":"https:\/\/www.fast2sms.com\/help\/wp-content\/uploads\/2026\/11\/webhook-row-menu-hd-2-scaled.webp","type":"image\/webp"}],"twitter_card":"summary_large_image","twitter_creator":"@fast2sms","twitter_site":"@fast2sms","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.fast2sms.com\/help\/webhook-secret-header\/#article","isPartOf":{"@id":"https:\/\/www.fast2sms.com\/help\/webhook-secret-header\/"},"author":{"@id":"https:\/\/www.fast2sms.com\/#organization"},"headline":"How to secure your Fast2SMS webhook (secret header and webhook_secret_key)","datePublished":"2026-11-18T18:46:58+00:00","dateModified":"2026-11-18T19:26:17+00:00","mainEntityOfPage":{"@id":"https:\/\/www.fast2sms.com\/help\/webhook-secret-header\/"},"wordCount":1175,"publisher":{"@id":"https:\/\/www.fast2sms.com\/#organization"},"image":{"@id":"https:\/\/www.fast2sms.com\/help\/webhook-secret-header\/#primaryimage"},"thumbnailUrl":"https:\/\/www.fast2sms.com\/help\/wp-content\/uploads\/2026\/11\/webhook-row-menu-hd-2-scaled.webp","articleSection":["API","Webhooks"],"inLanguage":"en-IN"},{"@type":"WebPage","@id":"https:\/\/www.fast2sms.com\/help\/webhook-secret-header\/","url":"https:\/\/www.fast2sms.com\/help\/webhook-secret-header\/","name":"Secure Your Webhook: Secret Header Check | Fast2SMS","isPartOf":{"@id":"https:\/\/www.fast2sms.com\/help\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.fast2sms.com\/help\/webhook-secret-header\/#primaryimage"},"image":{"@id":"https:\/\/www.fast2sms.com\/help\/webhook-secret-header\/#primaryimage"},"thumbnailUrl":"https:\/\/www.fast2sms.com\/help\/wp-content\/uploads\/2026\/11\/webhook-row-menu-hd-2-scaled.webp","datePublished":"2026-11-18T18:46:58+00:00","dateModified":"2026-11-18T19:26:17+00:00","description":"Protect your Fast2SMS webhook URL: add a secret header, check it in PHP, Node.js or Python, learn about webhook_secret_key and add HTTPS checks.","breadcrumb":{"@id":"https:\/\/www.fast2sms.com\/help\/webhook-secret-header\/#breadcrumb"},"inLanguage":"en-IN","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.fast2sms.com\/help\/webhook-secret-header\/"]}]},{"@type":"ImageObject","inLanguage":"en-IN","@id":"https:\/\/www.fast2sms.com\/help\/webhook-secret-header\/#primaryimage","url":"https:\/\/www.fast2sms.com\/help\/wp-content\/uploads\/2026\/11\/webhook-row-menu-hd-2-scaled.webp","contentUrl":"https:\/\/www.fast2sms.com\/help\/wp-content\/uploads\/2026\/11\/webhook-row-menu-hd-2-scaled.webp","width":2560,"height":1600,"caption":"Row menu on an SMS webhook with Edit Webhook, Test Webhook and Delete Webhook"},{"@type":"BreadcrumbList","@id":"https:\/\/www.fast2sms.com\/help\/webhook-secret-header\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.fast2sms.com\/help\/"},{"@type":"ListItem","position":2,"name":"API","item":"https:\/\/www.fast2sms.com\/help\/api\/"},{"@type":"ListItem","position":3,"name":"How to secure your Fast2SMS webhook (secret header and webhook_secret_key)"}]},{"@type":"WebSite","@id":"https:\/\/www.fast2sms.com\/help\/#website","url":"https:\/\/www.fast2sms.com\/help\/","name":"Fast2SMS","description":"Help","publisher":{"@id":"https:\/\/www.fast2sms.com\/#organization"},"inLanguage":"en-IN"},{"@type":"Organization","@id":"https:\/\/www.fast2sms.com\/#organization","name":"Fast2SMS","url":"https:\/\/www.fast2sms.com\/","logo":{"@type":"ImageObject","@id":"https:\/\/www.fast2sms.com\/#logo","url":"https:\/\/www.fast2sms.com\/Fast2SMS.png","contentUrl":"https:\/\/www.fast2sms.com\/Fast2SMS.png","caption":"Fast2SMS"},"image":{"@id":"https:\/\/www.fast2sms.com\/#logo"},"email":"support@fast2sms.com","telephone":"+91-6262778822","sameAs":["https:\/\/www.facebook.com\/Fast2SMS","https:\/\/www.instagram.com\/fast2sms","https:\/\/x.com\/fast2sms","https:\/\/www.youtube.com\/Fast2SMSofficial","https:\/\/www.linkedin.com\/company\/fast2sms"]}]}},"_links":{"self":[{"href":"https:\/\/www.fast2sms.com\/help\/wp-json\/wp\/v2\/posts\/18925","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fast2sms.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fast2sms.com\/help\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fast2sms.com\/help\/wp-json\/wp\/v2\/comments?post=18925"}],"version-history":[{"count":1,"href":"https:\/\/www.fast2sms.com\/help\/wp-json\/wp\/v2\/posts\/18925\/revisions"}],"predecessor-version":[{"id":19467,"href":"https:\/\/www.fast2sms.com\/help\/wp-json\/wp\/v2\/posts\/18925\/revisions\/19467"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.fast2sms.com\/help\/wp-json\/wp\/v2\/media\/18918"}],"wp:attachment":[{"href":"https:\/\/www.fast2sms.com\/help\/wp-json\/wp\/v2\/media?parent=18925"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fast2sms.com\/help\/wp-json\/wp\/v2\/categories?post=18925"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fast2sms.com\/help\/wp-json\/wp\/v2\/tags?post=18925"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}