Xano Documentation
  • πŸ‘‹Welcome to Xano!
  • 🌟Frequently Asked Questions
  • πŸ”Security & Compliance (Trust Center)
  • πŸ™Feature Requests
  • πŸ’”Known Issues
  • Before You Begin
    • Using These Docs
    • Where should I start?
    • Set Up a Free Xano Account
    • Key Concepts
    • The Development Life Cycle
    • Navigating Xano
    • Plans & Pricing
  • The Database
    • Designing your Database
    • Database Basics
      • Using the Xano Database
      • Field Types
      • Relationships
      • Database Views
      • Export and Sharing
      • Data Sources
    • Migrating your Data
      • Airtable to Xano
      • Supabase to Xano
      • CSV Import & Export
    • Database Performance and Maintenance
      • Storage
      • Indexing
      • Maintenance
      • Schema Versioning
  • πŸ› οΈThe Function Stack
    • Building with Visual Development
      • APIs
        • Swagger (OpenAPI Documentation)
      • Custom Functions
        • Async Functions
      • Background Tasks
      • Triggers
      • Middleware
      • Configuring Expressions
      • Working with Data
    • Functions
      • AI Tools
      • Database Requests
        • Query All Records
          • External Filtering Examples
        • Get Record
        • Add Record
        • Edit Record
        • Add or Edit Record
        • Patch Record
        • Delete Record
        • Bulk Operations
        • Database Transaction
        • External Database Query
        • Direct Database Query
        • Get Database Schema
      • Data Manipulation
        • Create Variable
        • Update Variable
        • Conditional
        • Switch
        • Loops
        • Math
        • Arrays
        • Objects
        • Text
      • Security
      • APIs & Lambdas
        • Realtime Functions
        • External API Request
        • Lambda Functions
      • Data Caching (Redis)
      • Custom Functions
      • Utility Functions
      • File Storage
      • Cloud Services
    • Filters
      • Manipulation
      • Math
      • Timestamp
      • Text
      • Array
      • Transform
      • Conversion
      • Comparison
      • Security
    • Data Types
      • Text
      • Expression
      • Array
      • Object
      • Integer
      • Decimal
      • Boolean
      • Timestamp
      • Null
    • Environment Variables
    • Additional Features
      • Response Caching
  • Testing and Debugging
    • Testing and Debugging Function Stacks
    • Unit Tests
    • Test Suites
  • CI/CD
  • File Storage
    • File Storage in Xano
    • Private File Storage
  • Realtime
    • Realtime in Xano
    • Channel Permissions
    • Realtime in Webflow
  • Maintenance, Monitoring, and Logging
    • Statement Explorer
    • Request History
    • Instance Dashboard
      • Memory Usage
  • Building Backend Features
    • User Authentication & User Data
      • Separating User Data
      • Restricting Access (RBAC)
      • OAuth (SSO)
    • Webhooks
    • Messaging
    • Emails
    • Custom Report Generation
    • Fuzzy Search
    • Chatbots
  • Xano Features
    • Snippets
    • Instance Settings
      • Release Track Preferences
      • Static IP (Outgoing)
      • Change Server Region
      • Direct Database Connector
      • Backup and Restore
      • Security Policy
    • Workspace Settings
    • Advanced Back-end Features
      • Xano Link
      • Developer API (Deprecated)
    • Metadata API
      • Master Metadata API
      • Tables and Schema
      • Content
      • Search
      • File
      • Request History
      • Workspace Import and Export
      • Token Scopes Reference
  • Build With AI
    • Building a Backend Using AI
    • Get Started Assistant
    • AI Database Assistant
    • AI Lambda Assistant
    • AI SQL Assistant
    • API Request Assistant
    • Template Engine
    • Streaming APIs
  • Using AI Builders with Xano
  • Build For AI
    • MCP Builder
      • Connecting Clients
      • MCP Functions
    • Xano MCP Server
  • Xano Transform
    • Using Xano Transform
  • Xano Actions
    • What are Actions?
    • Browse Actions
  • Team Collaboration
    • Realtime Collaboration
    • Managing Team Members
    • Branching & Merging
    • Role-based Access Control (RBAC)
  • Agencies
    • Xano for Agencies
    • Agency Features
      • Agency Dashboard
      • Client Invite
      • Transfer Ownership
      • Agency Profile
      • Commission
      • Private Marketplace
  • Enterprise
    • Xano for Enterprise
    • Enterprise Features
      • Microservices
        • Ollama
          • Choosing a Model
      • Tenant Center
      • Compliance Center
      • Security Policy
      • Instance Activity
      • Deployment
      • RBAC (Role-based Access Control)
      • Xano Link
  • Your Xano Account
    • Account Page
    • Billing
    • Referrals & Commissions
  • Troubleshooting & Support
    • Error Reference
    • Troubleshooting Performance
      • When a single workflow feels slow
      • When everything feels slow
      • RAM Usage
      • Function Stack Performance
    • Getting Help
      • Granting Access
      • Community Code of Conduct
      • Community Content Modification Policy
  • Special Pricing
    • Students & Education
    • Non-Profits
  • Security
    • Best Practices
Powered by GitBook
On this page
  • Building Webhooks
  • Create a new API endpoint with a POST method
  • Add a Get All Raw Input function
  • Process the output of Get All Raw Input as needed
  • Securing your Webhooks
  • Signature Verification (recommended)
  • Check a static token provided in the headers

Was this helpful?

  1. Building Backend Features

Webhooks

Webhooks are specialized API endpoints designed to be triggered based on other events

Last updated 1 month ago

Was this helpful?

Quick Summary

Webhooks are API endpoints specifically designed for one system to automatically push information to another when a specific event happens. For example, Slack provides you with a webhook URL. This URL is ready and listening, much like your own API endpoint.

But here’s the key difference:

  1. Something like a form submission endpoint receives data because the user initiated the request (e.g., they clicked 'Submit').

  2. The Slack webhook receives data because your server, after processing the form (the event), initiated a new request, automatically pushing the form details to Slack's URL. Slack didn't ask for it; your system sent it because something happened.

You'd build webhooks in Xano typically to ingest information pushed from other places β€” like if a user pays for something via Stripe, or they perform an action in your app that you want to log.

Building Webhooks

1

Create a new API endpoint with a POST method

  1. Click + Add API Endpoint from inside one of your API groups.

2

Add a Get All Raw Input function

You'll need to choose the encoding, or the format, of the data being sent to this endpoint. This will more often than not be JSON.

While Get All Raw Input offers flexibility, always check the documentation of the service sending the webhook. They will specify the structure (schema) of the data payload you should expect.

3

Process the output of Get All Raw Input as needed

From here, the process is completely unique to whatever data is being sent to the webhook, and what you need to do with it.

Examples:

  • Store the data in a database table using Add Record

  • Transform or manipulate the data using Filters or an Expression

  • Send the data to another service, such as an analytics platform, using an External API Request

  • Begin a more in-depth process using a combination of the above to perform multiple actions, such as transforming data, storing it, and sending Emails

Securing your Webhooks

Just like any other API endpoint you're building, it's important to ensure that they are built securely. Webhooks have some more specific-to-them ways that they are usually kept locked up.

1

Signature Verification (recommended)

The service you're accepting requests from may offer signature verification. At a high level, this means that you would cross-check the signature they sent with your own calculated signature, using a private key that only you and the service are aware of, and ensure that they match.

If they match: The request is verified and you can proceed.

If they don't match: you should deny the request

In general, this process follows a typical flow:

  • Extract the signature provided in the request headers

  • Ensure you have a raw, unaltered copy of the request body (which you do using Get All Raw Input)

2

Check a static token provided in the headers

Similar to how standard User Authentication & User Data works, some services may just send an API key or bearer token as part of the request header. You'll want to compare this against your own stored key and ensure that they match.

It's also good practice to rotate this token on a regular basis to ensure that it is not compromised.

Tip

Use Middleware or Custom Functions to build your webhook verification and quickly deploy it across multiple function stacks.

Choose Custom API Endpoint and fill in the details. Make sure to select POST as the verb.

Typically, webhooks need to be able to dynamically process data that might look a little different between requests. So, we use to make sure that we aren't confined to just the inputs that are defined in the inputs section.

If the webhook is receiving a list of items, loop against them using

Use the proper Security filter (such as ) to encode your own signature, and ensure that it matches with the one you extracted from the request.

For Each Loop
hmac_sha256 / hmac384 / hmac512
Get All Raw Input