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

# Define a moment to guard

> **Beta.** The request and response shapes may still change.

Define a moment you want to guard - signup, checkout, password reset - and reference the recipes that run there. The flow identifier is what you pass as `flow_id` to [Evaluate a flow](/watch/v2/api-reference/evaluate-flow).

Every recipe referenced here must exist. Only recipes in `LIVE` or `SHADOW` status take part in an evaluation; a `DRAFT` or `INACTIVE` one is referenced by the flow and reported on by neither.

A flow represents a moment in your product - signup, checkout, password reset, a payout request - and references the recipes that run there.

```json theme={null}
{
  "name": "signup",
  "recipes": ["rcp_01jc0t6fwwfgfsq1md24mhyztj", "rcp_01jd1u7gxxghgtr2ne35nizauk"]
}
```

The identifier you get back is what you pass as `flow_id` to [Evaluate a flow](/watch/v2/api-reference/evaluate-flow). That call answers with the most severe verdict and action across the recipes that ran, plus each recipe's own result.

Every recipe referenced here must exist; one that doesn't is refused against the `recipes` field. Only `LIVE` and `SHADOW` recipes take part in an evaluation, so a flow can safely reference a `DRAFT` recipe you are still assembling.

## One flow per moment, not per rule

Keep flows coarse and recipes specific. A flow is a stable identifier compiled into your product, so changing what a moment checks should mean swapping recipes inside the flow, not asking your application to call a different `flow_id`.


## OpenAPI

````yaml post /v2/watch/management/flows
openapi: 3.1.0
info:
  title: Prelude API
  version: 2.0.0
  description: The Prelude API allows you to send messages to your users.
  contact:
    email: support@prelude.so
servers:
  - url: https://api.prelude.dev
    description: Production server
security:
  - apiToken: []
tags:
  - name: Notify
    description: Send transactional and marketing messages with compliance enforcement.
  - name: Transactional
    description: Send transactional messages (deprecated - use Notify API instead).
  - name: Verify
    description: Verify phone numbers.
  - name: Watch
    description: Evaluate email addresses and phone numbers for trustworthiness.
  - name: Lookup
    description: >-
      Retrieve detailed information about a phone number including carrier data,
      line type, and portability status.
paths:
  /v2/watch/management/flows:
    post:
      tags:
        - Watch
      summary: Create a flow
      description: >-
        **Beta.** The request and response shapes may still change.


        Define a moment you want to guard - signup, checkout, password reset -
        and reference the recipes that run there. The flow identifier is what
        you pass as `flow_id` to [Evaluate a
        flow](/watch/v2/api-reference/evaluate-flow).


        Every recipe referenced here must exist. Only recipes in `LIVE` or
        `SHADOW` status take part in an evaluation; a `DRAFT` or `INACTIVE` one
        is referenced by the flow and reported on by neither.
      operationId: createWatchFlow
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WatchFlowRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WatchFlow'
        '400':
          description: KO
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Error'
                example:
                  code: invalid_flow
                  message: >-
                    The provided flow is invalid. See `details` field for more
                    information.
                  type: bad_request
                  param: flow
                  details:
                    - path: recipes
                      message: A recipe named here does not exist.
                  request_id: 3d19215e-2991-4a05-a41a-527314e6ff6a
components:
  schemas:
    WatchFlowRequest:
      type: object
      properties:
        name:
          type: string
          maxLength: 128
          description: The moment this flow guards.
          examples:
            - signup
        recipes:
          type: array
          minItems: 1
          items:
            type: string
          description: >-
            The recipes that run when this flow is evaluated. At least one is
            required, and each must exist.
          examples:
            - - rcp_01jc0t6fwwfgfsq1md24mhyztj
      required:
        - name
        - recipes
    WatchFlow:
      type: object
      properties:
        id:
          type: string
          examples:
            - flo_01jc0t6fwwfgfsq1md24mhyztj
          description: The flow identifier. Pass it as `flow_id` when you evaluate.
        name:
          type: string
          examples:
            - signup
        recipes:
          type: array
          items:
            type: string
          examples:
            - - rcp_01jc0t6fwwfgfsq1md24mhyztj
      required:
        - id
        - name
        - recipes
    Error:
      type: object
      properties:
        code:
          type: string
          description: The error code.
          examples:
            - invalid_phone_number
        message:
          type: string
          examples:
            - >-
              The provided phone number is invalid. Provide a valid E.164 phone
              number.
          description: A human-readable message describing the error.
        type:
          type: string
          examples:
            - bad_request
          description: The error type.
        request_id:
          type: string
          examples:
            - 3d19215e-2991-4a05-a41a-527314e6ff6a
          description: >-
            A string that identifies this specific request. Report it back to us
            to help us diagnose your issues.
        param:
          type: string
          examples:
            - phone_number
          description: The parameter the error refers to, when it applies to a single one.
      required:
        - code
        - message
        - type
  securitySchemes:
    apiToken:
      type: http
      scheme: bearer

````