---
title: "Generate WhatsApp Flow"
method: POST
path: "/whatsapp/1/senders/{sender}/flows/generate"
tags: ["channels", "whatsapp", "whatsapp-service-management", "whatsapp-flow-management"]
---

# Generate WhatsApp Flow

`POST /whatsapp/1/senders/{sender}/flows/generate`

## Request

- Base URL: `https://api.infobip.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.infobip.com/whatsapp/1/senders/{sender}/flows/generate`
- Auth: one of:
  - OAuth 2
    - Client credentials
    - Token URL: `https://api.infobip.com/auth/1/oauth2/token`
  - API key in header `Authorization`
  - API key in header `Authorization`
  - HTTP basic

Use this endpoint to automatically generate a WhatsApp Flow definition  using AI, based on a natural language prompt. Provide a descriptive prompt (e.g., "Create a Static WhatsApp Flow to collect details like Name, Surname and email for our global event next week."). The AI will generate a flow configuration designed to match your intent. If you include a responseId from an earlier request, the prompt will be used to modify or refine the flow that was previously generated, so you can adjust and improve it step by step.

## Path parameters

- `sender` string, required

## Request body

- 0089ea7cf06f0b77e4c88a7276c6f25dd5c0c5bbab819756fc42c548980cae19GenerateFlowRequestApiData
  - `prompt` string, required: Prompt for flow generation.
  - `responseId` string: Optional identifier of a previous response. If provided, this request will update or modify the generatedFlow associated with the given responseId. Use this to refine or change an existing flow by referencing an earlier response.

## Response `200`

Generated whatsapp flow

- 0089ea7cf06f0b77e4c88a7276c6f25dd5c0c5bbab819756fc42c548980cae19GenerateFlowResponseApiData
  - `originalPrompt` string, required: The prompt text used to generate this flow.
  - `responseId` string, required: Unique identifier for this response. Use this value in future requests to reference generated flow.
  - `generatedFlow` object, required: The generated output corresponding to the provided prompt.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `429`: Too Many Requests
- `500`: Internal Server Error

---

[API](https://skmtc.dev/infobip/apis/infobip-openapi-specification.md) - [All operations](https://skmtc.dev/infobip/apis/infobip-openapi-specification/llms.txt) - [OpenAPI document](https://skmtc.dev/infobip/apis/infobip-openapi-specification/revisions/9dcbbaf902de?raw)
