HTTPS Endpoints as Lightweight Webhooks
Learners will expose an Atlas Function as an HTTPS endpoint and configure request validation for use as a webhook receiver.
What Are Atlas HTTPS Endpoints?
Atlas HTTPS Endpoints (formerly Webhooks) expose an Atlas Function as a publicly accessible URL that accepts HTTP requests. They let external services (GitHub, Stripe, Twilio, Shopify, custom CI/CD pipelines) call your Atlas Function by posting to a URL — turning your database into a lightweight API backend with no separate server required.
Creating an HTTPS Endpoint
In Atlas App Services, go to HTTPS Endpoints and click Add an Endpoint. Configure: Route (URL path, e.g., /api/orders), HTTP Method (GET, POST, PUT, DELETE, or ANY), Authentication (application auth, user auth, or no auth for public endpoints), and the Linked Function that handles the request. The generated URL looks like: https://data.mongodb-api.com/app/APP_ID/endpoint/api/orders.
// The HTTPS endpoint URL format:
// https://data.mongodb-api.com/app/{APP_ID}/endpoint{route}
// Example endpoint configuration:
// Route: /webhook/stripe
// HTTP Method: POST
// Auth: no auth (Stripe handles its own signature)
// Function: handleStripeWebhookAll lessons in this course
- Database Triggers: Reacting to CRUD Events
- Scheduled Triggers and Cron Jobs
- Writing Atlas Functions in JavaScript
- HTTPS Endpoints as Lightweight Webhooks