---
title: "Create Flow Run Notification Policy"
method: POST
path: "/api/flow_run_notification_policies/"
tags: ["Flow Run Notification Policies"]
---

# Create Flow Run Notification Policy

`POST /api/flow_run_notification_policies/`

## Request

- The document declares no server URL.
- Auth: none declared

Creates a new flow run notification policy.

## Headers

- `x-prefect-api-version` string

## Request body

- FlowRunNotificationPolicyCreate: Data used by the Prefect REST API to create a flow run notification policy.
  - `is_active` boolean: Whether the policy is currently active
  - `state_names` string[], required: The flow run states that trigger notifications
  - `tags` string[], required: The flow run tags that trigger notifications (set [] to disable)
  - `block_document_id` string, uuid, required: The block document ID used for sending notifications
  - `message_template` string: A templatable notification message. Use {braces} to add variables. Valid variables include: 'flow_id', 'flow_name', 'flow_run_id', 'flow_run_name', 'flow_run_notification_policy_id', 'flow_run_parameters', 'flow_run_state_message', 'flow_run_state_name', 'flow_run_state_timestamp', 'flow_run_state_type', 'flow_run_url'

## Response `201`

Successful Response

- FlowRunNotificationPolicy: An ORM representation of a flow run notification.
  - `id` string, uuid
  - `created` string, date-time
  - `updated` string, date-time
  - `is_active` boolean: Whether the policy is currently active
  - `state_names` string[], required: The flow run states that trigger notifications
  - `tags` string[], required: The flow run tags that trigger notifications (set [] to disable)
  - `block_document_id` string, uuid, required: The block document ID used for sending notifications
  - `message_template` string: A templatable notification message. Use {braces} to add variables. Valid variables include: 'flow_id', 'flow_name', 'flow_run_id', 'flow_run_name', 'flow_run_notification_policy_id', 'flow_run_parameters', 'flow_run_state_message', 'flow_run_state_name', 'flow_run_state_timestamp', 'flow_run_state_type', 'flow_run_url'

## Other responses

- `422`: Validation Error

## Changes

- **2024-04-03** `93ae2b3f2efd`: 3 breaking
  - the request property `block_document_id` became required
  - the request property `state_names` became required
  - the request property `tags` became required

[Operation history](https://skmtc.dev/prefecthq/apis/prefect-unreleased-api/changes/api/flow_run_notification_policies/post.md)

---

[API](https://skmtc.dev/prefecthq/apis/prefect-unreleased-api.md) - [All operations](https://skmtc.dev/prefecthq/apis/prefect-unreleased-api/llms.txt) - [OpenAPI document](https://skmtc.dev/prefecthq/apis/prefect-unreleased-api/revisions/29ba6c4f8837?raw)
