Skip to main content
Webhooks let the Plant Store push event notifications to your server instead of requiring you to poll the API. When a new plant is added to the store, the Plant Store sends an HTTP POST request to your configured webhook endpoint with a NewPlant payload. Mintlify supports documenting webhooks alongside your REST endpoints so your team has a single reference for the full API surface.

Event: new plant added

The POST /plant/webhook event fires every time a plant is successfully created in the store. Your server receives a NewPlant object in the request body.

Payload fields

name
string
required
Common name of the plant that was added (for example, "Monstera").
tag
string
Optional category tag for the plant (for example, "tropical").
id
integer
required
Unique integer identifier of the newly created plant.

Acknowledging the webhook

Your endpoint must return an HTTP 200 status code to confirm that it received the event. If the Plant Store does not receive a 200 response within the timeout window, it may retry the delivery. Return the 200 as quickly as possible — if you need to do slow processing, queue the work and respond immediately.
Webhook deliveries that do not receive a 200 response may be retried. Implement idempotency in your handler using the id field to avoid processing the same event twice.

Example payload

{
  "name": "Monstera",
  "tag": "tropical",
  "id": 1
}

Example handler

The following example shows a minimal webhook handler in Node.js that acknowledges receipt and logs the payload:
app.post('/plant/webhook', (req, res) => {
  const plant = req.body;

  // Process the event
  console.log('New plant added:', plant.name, '(ID:', plant.id + ')');

  // Acknowledge receipt immediately
  res.sendStatus(200);
});

Security

Validate that incoming webhook requests originate from the Plant Store before processing the payload. Check any signatures or shared secrets provided by the platform and reject requests that fail validation with a 400 status.