---
title: "Create a webhook"
method: POST
path: "/webhooks"
tags: ["Webhooks"]
---

# Create a webhook

`POST /webhooks`

Use this endpoint to create a new webhook.

## Headers

- `x-oneflow-api-token` string, required
- `x-oneflow-user-email` string, email

## Request body

- object — Request body for a create webhook request.
  - `callback_url` string, https_url, required — The webhook's callback url.
  - `configuration` object — A webhook configuration.
    - `enable_draft_events` boolean — If true, the webhook will receive draft events
  - `filters` object[], nullable — An array of filters to be associated with the webhook being created.
    - `filter_rules` union[], required
      - union
        - object — This represents an event type filter rule which can be associated with a webhook filter.
          - `type` 'EVENT_TYPE', required — The type of the rule.
          - `values` string[], required — The types of events we want.
        - object — This represents a workspace filter rule which can be associated with a webhook filter.
          - `type` 'WORKSPACE', required — The type of the rule.
          - `values` integer[], required — The workspace IDs we want events for.
        - object — This represents an integration blueprint filter rule which can be associated with a webhook filter.
          - `type` 'BLUEPRINT', required — The type of the rule.
          - `values` integer[], required — The integration blueprint IDs we want events for.
  - `integration_process_id` integer, nullable — This is a feature for the future, and the default value is `null`.
  - `sign_key` string, nullable — A key to authenticate the webhook requests.
  - `template_group_id` integer, nullable

## Response `201`

Returns the created webhook.

- object — A webhook.
  - `callback_url` string, nullable, required — The webhook's callback url.
  - `configuration` object — Webhook configuration
    - `enable_draft_events` boolean — True if receiving webhooks for draft events
  - `filters` object[], nullable, required — An array of filters associated with the webhook.
    - `filter_rules` union[], required
      - union
        - object — This represents an event type filter rule which can be associated with a webhook filter.
          - `type` 'EVENT_TYPE', required — The type of the rule.
          - `values` string[], required — The types of events we want.
        - object — This represents a workspace filter rule which can be associated with a webhook filter.
          - `type` 'WORKSPACE', required — The type of the rule.
          - `values` integer[], required — The workspace IDs we want events for.
        - object — This represents an integration blueprint filter rule which can be associated with a webhook filter.
          - `type` 'BLUEPRINT', required — The type of the rule.
          - `values` integer[], required — The integration blueprint IDs we want events for.
  - `integration_instance` integer, nullable, required — Connected integration instance.
  - `integration_process_id` integer, nullable, required — This is a feature for the future, and the default value is `null`.
  - `legacy_webhook` boolean, required — True if the webhook is a legacy webhook.
  - `template_group_id` integer, nullable, required
  - `webhook_id` integer, required — webhook ID

## Other responses

- `400` — Invalid format or content of the request.
- `401` — The API token or the user email is invalid.
- `403` — The request is not authorized by the server.
- `404` — A required entity is missing.

---

[API](https://skmtc.net/oneflow/apis/public-api-for-oneflow.md) · [All operations](https://skmtc.net/oneflow/apis/public-api-for-oneflow/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/oneflow/public-api-for-oneflow/versions/0e73a45dec15/schema)
