When building a Samsara App, there’s no global webhook handler for all customers. Instead, you must create dedicated webhook endpoints for each customer using the Create a webhook endpoint with the customer’s OAuth access token. This enables your app to receive real-time notifications — like driver and address updates, form submissions, or route updates — for each customer’s data.Documentation Index
Fetch the complete documentation index at: https://samsara-showcase.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Before you begin
Authentication
All requests must include a valid API token in the request header. For Marketplace apps, this token is the customer’s OAuth access token:
Authorization: Bearer YOUR_API_TOKEN.1. List webhook endpoints
Use the List all webhooks endpoint to retrieve webhook endpoints that belong to a specific organization. Note that if your Marketplace application is installed by multiple customers, this endpoint will only return the webhook endpoints for the organization related to the access token used to authenticate the request. Example RequestsecretKey is auto-generated by Samsara and can be used to verify the authenticity of the webhook payload on your server. See the Webhooks 2.0 Reference for webhook signature verification examples.2. Retrieve a webhook endpoint
Use the Retrieve a webhook endpoint to retrieve the details of a single webhook by itsid.
Example Request
3. Create a webhook endpoint
Use the Create a webhook endpoint to create a new webhook. A webhook is defined by at least aname and a url using https. Optionally, you can add customHeaders or specify which eventTypes you want this webhook to receive.
See the Webhooks 2.0 Reference for a list of supported
eventTypes.4. Update a webhook endpoint
Use the Update a webhook endpoint to update an existing webhook. This endpoint follows the JSON merge patch standard, meaning any field specified in the request body replaces the existing field on the server. For arrays, the entire array is replaced. Example Request Suppose we only need to update thename and eventTypes:
5. Delete a webhook
Use the Delete a webhook endpoint to remove a webhook. Once deleted, Samsara will no longer send events to this URL. Example Request204 No Content status.
Using webhooks with alert configurations
Once you have created a webhook endpoint, you can use it as an action for an Alert Configuration so that when certain triggers are met (e.g. speeding, harsh events, HOS violations), Samsara will send a notification to your webhook URL. Use the Create alert configurations endpoint to bind your newly created webhook to an alert. Example RequestHow It Works
Create the webhook
First, create (or reuse) a webhook endpoint using the Create a Webhook endpoint. Copy the resulting
id from the response.Set up the alert
In the Create Alert Configuration body, specify:
- A trigger (e.g., speeding) by including the relevant
triggerTypeIdand any required parameters. - An action using
actionTypeId=4for Webhook, and place the webhook’sidinactionParams.webhooks.webhookIds.