POST
/
api
/
flow_run_notification_policies
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "created": "2023-11-07T05:31:56Z",
  "updated": "2023-11-07T05:31:56Z",
  "is_active": true,
  "state_names": [
    "<string>"
  ],
  "tags": [
    "<string>"
  ],
  "block_document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "message_template": "Flow run {flow_run_name} with id {flow_run_id} entered state {flow_run_state_name}."
}

Headers

x-prefect-api-version
string

Body

application/json

Data used by the Prefect REST API to create a flow run notification policy.

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
required

The block document ID used for sending notifications

is_active
boolean
default:
true

Whether the policy is currently active

message_template
string | null

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
application/json
Successful Response

An ORM representation of a flow run notification.

id
string
required
created
string | null
required
updated
string | null
required
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
required

The block document ID used for sending notifications

is_active
boolean
default:
true

Whether the policy is currently active

message_template
string | null

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'