Strapi blog logo
  • Product

      Why Strapi?Content ArchitectureRoadmapIntegrationsTry live demo
      OverviewContent Types BuilderCustomizable APIMedia LibraryRoles & Permissions
      Discover Strapi Enterprise EditionDiscover our partners
  • Pricing

  • Solutions

      Static WebsitesMobile ApplicationsCorporate websitesEditorial SitesEcommerce
      Delivery HeroL'EquipeSociete GeneralePixelDustBanco International
      Discover all our user stories
  • Community

      CommunityWrite for the communityWall of LoveStrapi Conf 2021
      SlackGitHubYoutubeCommunity Forum
      Meet the Strapi Community StarsDiscover the Strapi Showcase
  • Resources

      BlogStartersNewsroomSupport
      Strapi AcademyTutorialsVideos GuidesWebinars
      The Guide to Headless CMS Strapi Community Forum
  • Docs

      Getting StartedContent APIConfigurationInstallationDeploymentMigration
      Getting StartedContent ManagerContent-Types BuilderUsers, Roles & PermissionsPlugins
      Developer DocumentationStrapi User Guide

Looking for our logo ?

Logo Brand download
Download Logo Pack
See more Strapi assets
Strapi blog logo
  • Product

    Product

    • Why Strapi?
    • Content Architecture
    • Roadmap
    • Integrations
    • Try live demo

    Features

    • Overview
    • Content Types Builder
    • Customizable API
    • Media Library
    • Roles & Permissions
    • Discover Strapi Enterprise Edition
    • Discover our partners
    Features cover

    Unlock the full potential of content management

    See all features
    Strapi Enterprise Edition

    Discover the advanced features included in Strapi Enterprise Edition.

    Get Started
  • Pricing
  • Solutions

    Solutions

    • Static Websites
    • Mobile Applications
    • Corporate websites
    • Editorial Sites
    • Ecommerce

    Stories

    • Delivery Hero
    • L'Equipe
    • Societe Generale
    • PixelDust
    • Banco International
    • Discover all our user stories
    Delivery Hero team

    Delivery Hero manages their partner portal with Strapi.

    Read their story
    turn 10 studios website

    How 1minus1 delivered a creative website for Turn10 Studios 25% faster with Strapi

    Discover their story
  • Community

    Community

    • Community
    • Write for the community
    • Wall of Love
    • Strapi Conf 2021

    Resources

    • Slack
    • GitHub
    • Youtube
    • Community Forum
    • Meet the Strapi Community Stars
    • Discover the Strapi Showcase
    Strapi Conf

    The first Strapi Global User Conference.

    Register now
    Write for the community

    Contribute on educational content for the community

    Discover the program
  • Resources

    Resources

    • Blog
    • Starters
    • Newsroom
    • Support

    Learning

    • Strapi Academy
    • Tutorials
    • Videos Guides
    • Webinars
    • The Guide to Headless CMS
    • Strapi Community Forum
    Introducing Strapi Academy

    Everything you need to know to master Strapi.

    Go to the academy
    Strapi Repository on GitHub

    Get started with the Strapi repository

    Go to repository
  • Docs

    Developers

    • Getting Started
    • Content API
    • Configuration
    • Installation
    • Deployment
    • Migration

    User Guide

    • Getting Started
    • Content Manager
    • Content-Types Builder
    • Users, Roles & Permissions
    • Plugins
    • Developer Documentation
    • Strapi User Guide
    Install Strapi

    Install Strapi locally or wherever you need.

    Get Started
    Migration Guides Strapi

    Using a previous version of Strapi? Migrate to the latest.

    Read Guides
Get Started
Back to articles

What Is a Webhook and How Does It Work

webhook
  • Share on facebook
  • Share on linkedin
  • Share on twitter
  • Share by email
Sunny Hsiao Avatar

Sunny Hsiao

What Is a Webhook and How Does It Work?

You may have come across webhook integrations in several of the applications you use without even knowing it, or you may be wondering: what is a webhook, exactly, and why would I need it? To put it simply, webhooks are one of the ways apps are able to share updates with you by sending automated messages. For instance, if you wanted to receive a notification every time someone you follow updated their social media, a webhook would act as the liaison. In essence, it is a solution you can implement to have apps ‘communicate’ with one another, pushing data between them. Let us delve deeper into all you need to know about webhooks and how to use them.

What Is a Webhook?

In answer to the question: ‘What is a webhook?’, some like to compare them to APIs. Such a comparison is relevant in the sense that both can be used to access information from an application. The difference lies in how the information is obtained.

321

With APIs, it is possible to add data, to edit it, and to retrieve it. For instance, you could deploy an API to connect two applications. However, to transfer information from one app to the other, an order needs to be given. In other words, only when the data is requested specifically does it actually get sent. What makes webhooks so special is the fact that they are entirely automated. They can be configured to output data whenever an event in particular happens. Where APIs rely on a request-based output mechanism, webhooks work on an event-based output mechanism.

To illustrate this concept, one could think of a more concrete situation. Say, for instance, that you are quite sensitive to the cold. Yet, you hate bringing a coat with you everywhere you go if it means you’ll have to carry it instead of wearing it, because you can’t stand being too warm either. You might then decide to check the weather for yourself each night, or you might prefer to receive a message informing you to bring a coat because it’s going to be too chilly for you. If it’s warm enough, no need to bother you: only the temperature dropping below a certain point will trigger the notification. What is a webhook? In this case, it is the little helper that checks the weather for you and only distracts you from your busy life if it knows you will be interested in a particular event.

From a more web-centric perspective, a webhook can be a wonderful way to automatise certain actions. For instance, if you wanted to send a discount code to the first 1,000 subscribers who open one of your emails, checking the stats manually and forwarding the code in question 1,000 times would be extremely cumbersome. What is a webhook going to do instead? It will allow codes to be sent right up until the number has been reached and make sure the action does not continue after that point.

How Do Webhooks Work?

The basic principle behind webhooks is one action serving as a signal to trigger another action. In more concrete terms, it is an HTTP callback. Whenever a specific event takes place, the webhook picks up on it and collects the data, which it immediately sends to a URL defined by the user in the form of an HTTP request. This means that webhooks can be utilised for real-time notifications, making it possible to sync events efficiently. Even something happening on a website can cause another website to trigger an action.

webhhooks

Such headless CMS as Strapi give you the option to set up webhooks for your applications. You can even create them right from the interface by identifying the URL you wish to send data to. The webhook itself should also contain a description of the event it addresses, defined by special headers. Next, a test is in order to make sure the webhook works as intended. Some CMS (this is the case for Strapi) even provide a Trigger Button you can use to verify that everything is working correctly. Finally, you will need to enable your webhook, which will go live immediately.

image3

What is a webhook’s best potential? Probably the fact that it could be adapted to whatever your imagination can come up with! Its simplicity, together with the absence of constant polling, means that it is exceptionally great at streamlining systems that would otherwise have to parse, often at the risk of overloading or losing data. The use of HTTP provides a much more straightforward solution for real-time applications. Regardless of the type of event you wish to track over the web, webhooks are there to make your life easier. Be sure to give them a try if you haven’t already!

  • Get Strapi up and running in 3 minutes
  • Get access to a hosted Strapi with sample data
  • Discover Enterprise Edition
  • Share on facebook
  • Share on linkedin
  • Share on twitter
  • Share by email

You might be also interested in

Adding Webhooks in Strapi 🎯
  • Product

Adding Webhooks in Strapi 🎯

Webhooks are already implemented on your favorite headless CMS by now.

Pierre Burgy

Pierre Burgy

October 31, 2018

Webhooks explained and how to use them in Strapi
  • Product

Webhooks explained and how to use them in Strapi

Webhooks are automated messages that are sent each time an event happens. Let's get you hooked on it (pun intended).

Yves

Yves Do

January 22, 2020

What is a CMS Website and Why Should You Use One?
  • Strapi
  • Content Management

What is a CMS Website and Why Should You Use One?

Opting for a CMS website is a great way to create a powerful presence online even if you don’t know a single line of code! Here’s what you need to know.

Sunny Hsiao Avatar

Sunny Hsiao

October 20, 2020

Newsletter

Sign up for the Strapi newsletter to keep up with the latest news from the Strapi community!

Unleash content.

Read the docs
Get Started

Strapi is the most popular open-source Headless CMS. Strapi gives developers the freedom to use their favorite tools and frameworks while allowing editors to easily manage their content and distribute it anywhere.

Product

  • Why Strapi?
  • Content Architecture
  • Features
  • Enterprise Edition
  • Partner Program
  • Roadmap
  • Support
  • Integrations
  • Try live demo

Resources

  • How to get started
  • Meet the community
  • Tutorials
  • API documentation
  • GitHub repository
  • Starters
  • Strapi vs Wordpress
  • The Guide to headless CMS

Integrations

  • Gatsby CMS
  • React CMS
  • Vue.js CMS
  • Nuxt.js CMS
  • Next.js CMS
  • Angular CMS
  • Gridsome CMS
  • Jekyll CMS
  • 11ty CMS
  • Svelte CMS
  • Sapper CMS
  • Ruby CMS
  • Python CMS

Company

  • About us
  • Blog
  • Careers
  • Contact
  • Newsroom
  • © 2021, Strapi
  • LicenseTermsPrivacy