> ## Documentation Index
> Fetch the complete documentation index at: https://sleekplan.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Webhooks

> Subscribe to real-time HTTP POST notifications when feedback, votes, comments, or changelog entries change in your Sleekplan workspace

Webhooks deliver real-time POSTs to your endpoint whenever something happens in your Sleekplan workspace. Use them to mirror data, automate workflows, or connect Sleekplan to tools without a native integration.

## Use cases

* Store new feedback items directly in your own database.
* Capture a visitor's email address the moment they set it.
* Trigger a Slack message or Zapier workflow when a user votes, comments, or subscribes to a suggestion.
* Sync changelog publishes to an external CMS or mailing list.

***

<Steps>
  <Step title="Create a public HTTP endpoint">
    Set up a server endpoint that accepts `POST` requests and returns a `2xx` HTTP status to acknowledge receipt.

    **Secure your endpoint**

    Append a secret key as a GET parameter to your endpoint URL, then validate the parameter server-side before processing the payload:

    ```
    https://endpoint.yourapp.com/webhooks?key=MY_SECRET_KEY
    ```

    <Note>
      Sleekplan does not sign webhook payloads with an HMAC signature. Using a secret GET parameter is the recommended way to verify that requests originate from Sleekplan.
    </Note>
  </Step>

  <Step title="Register the webhook">
    1. Open your product **Settings**.
    2. Navigate to the **Developer** section.
    3. Scroll to **Webhooks**, click **Add webhook**.
    4. Enter your endpoint URL (with the `?key=` parameter).
    5. Save — Sleekplan starts delivering events immediately.
  </Step>
</Steps>

***

## Events

### Feedback and suggestion events

| Event                 | Triggered when                                   |
| --------------------- | ------------------------------------------------ |
| `item.create`         | A new feedback item is submitted.                |
| `item.update`         | A feedback item is edited or its status changes. |
| `item.delete`         | A feedback item is deleted.                      |
| `comment.create`      | A comment is added to a feedback item.           |
| `comment.update`      | A comment is edited.                             |
| `comment.delete`      | A comment is deleted.                            |
| `vote.create`         | A user votes on a feedback item.                 |
| `subscription.create` | A user subscribes to a feedback item.            |
| `subscription.delete` | A user unsubscribes from a feedback item.        |

### Other events

| Event                 | Triggered when                             |
| --------------------- | ------------------------------------------ |
| `user.create`         | A new user record is created in Sleekplan. |
| `user.update`         | A user's profile data is updated.          |
| `user.delete`         | A user is deleted.                         |
| `changelog.create`    | A new changelog entry is published.        |
| `changelog.update`    | A changelog entry is edited.               |
| `changelog.subscribe` | A user subscribes to the changelog.        |
| `satisfaction.create` | A CSAT response is submitted.              |

***

## Payload format

### General structure

```json theme={"system"}
{
  "product_id": 5456534244,
  "action": "item.create",
  "data": {},
  "timestamp": "1506985999999"
}
```

| Field        | Type   | Description                                                                           |
| ------------ | ------ | ------------------------------------------------------------------------------------- |
| `product_id` | number | The numeric ID of your Sleekplan product.                                             |
| `action`     | string | The event key, for example `item.create` or `vote.create`.                            |
| `data`       | object | The event payload. Structure matches the REST API response for the relevant resource. |
| `timestamp`  | string | Unix timestamp (milliseconds) when the event occurred.                                |

### Example: `item.create`

```json theme={"system"}
{
  "product_id": 5456534244,
  "action": "item.create",
  "data": {
    "feedback_id": "3",
    "product_id": "1",
    "title": "Show/search for similar ideas as you type",
    "description": "This can help us avoid users posting duplicate ideas",
    "status": "open",
    "trend": "0",
    "type": "user-interface",
    "total_up": "9",
    "total_down": "0",
    "total_sum": "9",
    "total_comments": "0",
    "total_ratio": "9",
    "total_subscriber": "1",
    "scoring": "0.55",
    "effort": "1",
    "created": "2020-05-22 16:49:00",
    "updated": "2020-05-22 16:49:00",
    "user": {
      "user_id": "4",
      "admin_id": 0,
      "data_name": "lennishq",
      "data_mail": "",
      "data_img": "https://storage.sleekplan.com/..."
    }
  },
  "timestamp": "1506985999999"
}
```

<Tip>
  The shape of the `data` field matches the corresponding REST API response. See the [REST API reference](/api/overview) for the full structure of each payload type.
</Tip>
