> For the complete documentation index, see [llms.txt](https://docs.360dialog.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.360dialog.com/docs/messaging-api/api-reference/flows.md).

# Flows

Endpoints for managing WhatsApp Flows

## List Flows

> Retrieve the WhatsApp Flows

```json
{"openapi":"3.1.0","info":{"title":"Messaging API","version":"1.50.0"},"tags":[{"name":"Flows","description":"Endpoints for managing WhatsApp Flows"}],"servers":[{"description":"Production server","url":"https://waba-v2.360dialog.io"}],"security":[{"D360-API-KEY":[]}],"components":{"securitySchemes":{"D360-API-KEY":{"description":"API Key for Messaging API authentication. Send your API key in the D360-API-KEY header.","in":"header","name":"D360-API-KEY","type":"apiKey"}},"schemas":{"flows.ListResponse":{"description":"Response payload containing the WhatsApp Flows of the WABA","properties":{"data":{"description":"The Flows of the WhatsApp Business Account","items":{"$ref":"#/components/schemas/flows.Flow"},"type":"array","uniqueItems":false},"paging":{"$ref":"#/components/schemas/pagination.Paging","description":"Cursor pagination as issued by Meta"}},"type":"object"},"flows.Flow":{"description":"A WhatsApp Flow","properties":{"categories":{"description":"Flow categories, e.g. LEAD_GENERATION, SIGN_UP, APPOINTMENT_BOOKING, OTHER","items":{"type":"string"},"type":"array","uniqueItems":false},"id":{"description":"Flow ID","type":"string"},"name":{"description":"Flow name","type":"string"},"status":{"description":"DRAFT, PUBLISHED, DEPRECATED, BLOCKED or THROTTLED","enum":["DRAFT","PUBLISHED","DEPRECATED","BLOCKED","THROTTLED"],"type":"string"},"validation_errors":{"description":"Unresolved validation errors, must be empty to publish","items":{"$ref":"#/components/schemas/flows.FlowValidationError"},"type":"array","uniqueItems":false}},"type":"object"},"flows.FlowValidationError":{"description":"A validation error reported by Meta for a Flow","properties":{"error":{"description":"Error code","type":"string"},"error_type":{"description":"Error type","type":"string"},"message":{"description":"Human-readable description","type":"string"},"pointer_path":{"description":"Path to the offending element in the Flow JSON","type":"string"}},"type":"object"},"pagination.Paging":{"description":"Cursor pagination. next/previous point back at this API; follow them directly, or page manually with the after/before query parameters","properties":{"cursors":{"$ref":"#/components/schemas/pagination.Cursors","description":"Page cursors"},"next":{"description":"URL of the next page as issued by Meta","type":"string"},"previous":{"description":"URL of the previous page as issued by Meta","type":"string"}},"type":"object"},"pagination.Cursors":{"properties":{"after":{"description":"Cursor of the next page","type":"string"},"before":{"description":"Cursor of the previous page","type":"string"}},"type":"object"},"utils.ErrorResp":{"properties":{"error":{"type":"string"}},"type":"object"}}},"paths":{"/flows":{"get":{"description":"Retrieve the WhatsApp Flows","operationId":"get-flows","parameters":[{"description":"Comma-separated list of fields to include (e.g. id,name,status,categories)","in":"query","name":"fields","schema":{"type":"string"}},{"description":"Maximum number of Flows to return per page","in":"query","name":"limit","schema":{"type":"integer"}},{"description":"Cursor for the next page of results","in":"query","name":"after","schema":{"type":"string"}},{"description":"Cursor for the previous page of results","in":"query","name":"before","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/flows.ListResponse"}}},"description":"Flows retrieved successfully"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Forbidden"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Internal server error"}},"summary":"List Flows","tags":["Flows"]}}}}
```

## Create Flow

> Create a WhatsApp Flow on the WhatsApp Business Account. The Flow is created as a draft unless \`publish\` is true. Send its screens either inline via \`flow\_json\` or afterwards via POST /flows/{flow\_id}/assets. \`clone\_flow\_id\` must reference a Flow owned by this WABA.

```json
{"openapi":"3.1.0","info":{"title":"Messaging API","version":"1.50.0"},"tags":[{"name":"Flows","description":"Endpoints for managing WhatsApp Flows"}],"servers":[{"description":"Production server","url":"https://waba-v2.360dialog.io"}],"security":[{"D360-API-KEY":[]}],"components":{"securitySchemes":{"D360-API-KEY":{"description":"API Key for Messaging API authentication. Send your API key in the D360-API-KEY header.","in":"header","name":"D360-API-KEY","type":"apiKey"}},"schemas":{"flows.CreateFlowRequest":{"description":"Request payload to create a WhatsApp Flow","properties":{"categories":{"description":"Flow categories, at least one of LEAD_GENERATION, SIGN_UP, SIGN_IN, APPOINTMENT_BOOKING, SURVEY, CONTACT_US, CUSTOMER_SUPPORT, OTHER","items":{"type":"string"},"type":"array","uniqueItems":false},"clone_flow_id":{"description":"ID of an existing Flow to clone","type":"string"},"endpoint_uri":{"description":"Endpoint URI for Flows with a data exchange endpoint","type":"string"},"flow_json":{"description":"The Flow JSON as a string. Optional: it can also be uploaded via POST /flows/{flow_id}/assets","type":"string"},"name":{"description":"Flow name, unique within the WABA","type":"string"},"publish":{"description":"Publish the Flow immediately instead of creating a draft. Requires flow_json","type":"boolean"}},"type":"object"},"flows.CreateFlowResponse":{"description":"Response payload for a created WhatsApp Flow","properties":{"id":{"description":"ID of the created Flow","type":"string"},"success":{"description":"Whether the Flow was created","type":"boolean"},"validation_errors":{"description":"Validation errors found in the submitted flow_json","items":{"$ref":"#/components/schemas/flows.FlowValidationError"},"type":"array","uniqueItems":false}},"type":"object"},"flows.FlowValidationError":{"description":"A validation error reported by Meta for a Flow","properties":{"error":{"description":"Error code","type":"string"},"error_type":{"description":"Error type","type":"string"},"message":{"description":"Human-readable description","type":"string"},"pointer_path":{"description":"Path to the offending element in the Flow JSON","type":"string"}},"type":"object"},"utils.ErrorResp":{"properties":{"error":{"type":"string"}},"type":"object"}}},"paths":{"/flows":{"post":{"description":"Create a WhatsApp Flow on the WhatsApp Business Account. The Flow is created as a draft unless `publish` is true. Send its screens either inline via `flow_json` or afterwards via POST /flows/{flow_id}/assets. `clone_flow_id` must reference a Flow owned by this WABA.","operationId":"post-flow","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/flows.CreateFlowRequest","summary":"requestBody","description":"Flow creation payload"}}},"description":"Flow creation payload","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/flows.CreateFlowResponse"}}},"description":"Flow created successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Forbidden"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Internal server error"}},"summary":"Create Flow","tags":["Flows"]}}}}
```

## Get Flow

> Retrieve a single Flow's details. Request the \`preview\` field (optionally with \`.invalidate(false)\`) to get a shareable preview link.

```json
{"openapi":"3.1.0","info":{"title":"Messaging API","version":"1.50.0"},"tags":[{"name":"Flows","description":"Endpoints for managing WhatsApp Flows"}],"servers":[{"description":"Production server","url":"https://waba-v2.360dialog.io"}],"security":[{"D360-API-KEY":[]}],"components":{"securitySchemes":{"D360-API-KEY":{"description":"API Key for Messaging API authentication. Send your API key in the D360-API-KEY header.","in":"header","name":"D360-API-KEY","type":"apiKey"}},"schemas":{"flows.GetFlowResponse":{"description":"Response payload for a single WhatsApp Flow's details","properties":{"application":{"$ref":"#/components/schemas/flows.FlowRef","description":"The Facebook developer application used to create the Flow, if requested via fields=application"},"categories":{"description":"Flow categories, e.g. LEAD_GENERATION, SIGN_UP, APPOINTMENT_BOOKING, OTHER","items":{"type":"string"},"type":"array","uniqueItems":false},"data_api_version":{"description":"The Data API version specified in the uploaded Flow JSON, only for Flows with an Endpoint","type":"string"},"endpoint_uri":{"description":"The URL of the WA Flow Endpoint","type":"string"},"id":{"description":"Flow ID","type":"string"},"json_version":{"description":"The Flow JSON version specified in the uploaded asset","type":"string"},"name":{"description":"Flow name","type":"string"},"preview":{"$ref":"#/components/schemas/flows.FlowPreview","description":"The web preview page of the Flow, if requested via fields=preview"},"status":{"description":"DRAFT, PUBLISHED, DEPRECATED, BLOCKED or THROTTLED","enum":["DRAFT","PUBLISHED","DEPRECATED","BLOCKED","THROTTLED"],"type":"string"},"validation_errors":{"description":"Unresolved validation errors, must be empty to publish","items":{"$ref":"#/components/schemas/flows.FlowValidationError"},"type":"array","uniqueItems":false},"whatsapp_business_account":{"$ref":"#/components/schemas/flows.FlowRef","description":"The WhatsApp Business account which owns the Flow, if requested via fields=whatsapp_business_account"}},"type":"object"},"flows.FlowRef":{"properties":{"id":{"description":"Object ID","type":"string"}},"type":"object"},"flows.FlowPreview":{"description":"Shareable web preview of a Flow","properties":{"expires_at":{"description":"Time when the preview link expires","type":"string"},"preview_url":{"description":"Link to the preview page. Does not require login and can be shared with stakeholders","type":"string"}},"type":"object"},"flows.FlowValidationError":{"description":"A validation error reported by Meta for a Flow","properties":{"error":{"description":"Error code","type":"string"},"error_type":{"description":"Error type","type":"string"},"message":{"description":"Human-readable description","type":"string"},"pointer_path":{"description":"Path to the offending element in the Flow JSON","type":"string"}},"type":"object"},"utils.ErrorResp":{"properties":{"error":{"type":"string"}},"type":"object"}}},"paths":{"/flows/{flow_id}":{"get":{"description":"Retrieve a single Flow's details. Request the `preview` field (optionally with `.invalidate(false)`) to get a shareable preview link.","operationId":"get-flow","parameters":[{"description":"Flow ID","in":"path","name":"flow_id","required":true,"schema":{"type":"string"}},{"description":"Comma-separated list of fields to include (e.g. id,name,status,preview)","in":"query","name":"fields","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/flows.GetFlowResponse"}}},"description":"Flow retrieved successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Flow not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Internal server error"}},"summary":"Get Flow","tags":["Flows"]}}}}
```

## Update Flow

> Update a draft Flow's name, categories or endpoint URI.

```json
{"openapi":"3.1.0","info":{"title":"Messaging API","version":"1.50.0"},"tags":[{"name":"Flows","description":"Endpoints for managing WhatsApp Flows"}],"servers":[{"description":"Production server","url":"https://waba-v2.360dialog.io"}],"security":[{"D360-API-KEY":[]}],"components":{"securitySchemes":{"D360-API-KEY":{"description":"API Key for Messaging API authentication. Send your API key in the D360-API-KEY header.","in":"header","name":"D360-API-KEY","type":"apiKey"}},"schemas":{"flows.UpdateFlowRequest":{"description":"Request payload to update a WhatsApp Flow's metadata","properties":{"categories":{"description":"A list of Flow categories. Missing value keeps the existing categories","items":{"type":"string"},"type":"array","uniqueItems":false},"endpoint_uri":{"description":"Endpoint URI for Flows with a data exchange endpoint","type":"string"},"name":{"description":"Flow name","type":"string"}},"type":"object"},"flows.UpdateFlowResponse":{"description":"Response payload for an updated WhatsApp Flow","properties":{"success":{"description":"Whether the Flow was updated","type":"boolean"}},"type":"object"},"utils.ErrorResp":{"properties":{"error":{"type":"string"}},"type":"object"}}},"paths":{"/flows/{flow_id}":{"post":{"description":"Update a draft Flow's name, categories or endpoint URI.","operationId":"update-flow","parameters":[{"description":"Flow ID","in":"path","name":"flow_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/flows.UpdateFlowRequest","summary":"requestBody","description":"Flow update payload"}}},"description":"Flow update payload","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/flows.UpdateFlowResponse"}}},"description":"Flow updated successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Forbidden"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Internal server error"}},"summary":"Update Flow","tags":["Flows"]}}}}
```

## Delete Flow

> Delete a draft Flow. A Flow can only be deleted while it is in DRAFT status.

```json
{"openapi":"3.1.0","info":{"title":"Messaging API","version":"1.50.0"},"tags":[{"name":"Flows","description":"Endpoints for managing WhatsApp Flows"}],"servers":[{"description":"Production server","url":"https://waba-v2.360dialog.io"}],"security":[{"D360-API-KEY":[]}],"components":{"securitySchemes":{"D360-API-KEY":{"description":"API Key for Messaging API authentication. Send your API key in the D360-API-KEY header.","in":"header","name":"D360-API-KEY","type":"apiKey"}},"schemas":{"flows.DeleteFlowResponse":{"description":"Response payload for a deleted WhatsApp Flow","properties":{"success":{"description":"Whether the Flow was deleted","type":"boolean"}},"type":"object"},"utils.ErrorResp":{"properties":{"error":{"type":"string"}},"type":"object"}}},"paths":{"/flows/{flow_id}":{"delete":{"description":"Delete a draft Flow. A Flow can only be deleted while it is in DRAFT status.","operationId":"delete-flow","parameters":[{"description":"Flow ID","in":"path","name":"flow_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/flows.DeleteFlowResponse"}}},"description":"Flow deleted successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Bad request - Flow is not in DRAFT status"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Flow not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Internal server error"}},"summary":"Delete Flow","tags":["Flows"]}}}}
```

## List Flow assets

> Retrieve all assets attached to a Flow, including its Flow JSON.

```json
{"openapi":"3.1.0","info":{"title":"Messaging API","version":"1.50.0"},"tags":[{"name":"Flows","description":"Endpoints for managing WhatsApp Flows"}],"servers":[{"description":"Production server","url":"https://waba-v2.360dialog.io"}],"security":[{"D360-API-KEY":[]}],"components":{"securitySchemes":{"D360-API-KEY":{"description":"API Key for Messaging API authentication. Send your API key in the D360-API-KEY header.","in":"header","name":"D360-API-KEY","type":"apiKey"}},"schemas":{"flows.FlowAssetsResponse":{"description":"Response payload containing the assets attached to a WhatsApp Flow","properties":{"data":{"description":"The assets attached to the Flow","items":{"$ref":"#/components/schemas/flows.FlowAsset"},"type":"array","uniqueItems":false},"paging":{"$ref":"#/components/schemas/pagination.Paging","description":"Cursor pagination as issued by Meta"}},"type":"object"},"flows.FlowAsset":{"description":"An asset attached to a WhatsApp Flow","properties":{"asset_type":{"description":"Asset type","type":"string"},"download_url":{"description":"URL to download the asset content","type":"string"},"name":{"description":"Asset name","type":"string"}},"type":"object"},"pagination.Paging":{"description":"Cursor pagination. next/previous point back at this API; follow them directly, or page manually with the after/before query parameters","properties":{"cursors":{"$ref":"#/components/schemas/pagination.Cursors","description":"Page cursors"},"next":{"description":"URL of the next page as issued by Meta","type":"string"},"previous":{"description":"URL of the previous page as issued by Meta","type":"string"}},"type":"object"},"pagination.Cursors":{"properties":{"after":{"description":"Cursor of the next page","type":"string"},"before":{"description":"Cursor of the previous page","type":"string"}},"type":"object"},"utils.ErrorResp":{"properties":{"error":{"type":"string"}},"type":"object"}}},"paths":{"/flows/{flow_id}/assets":{"get":{"description":"Retrieve all assets attached to a Flow, including its Flow JSON.","operationId":"get-flow-assets","parameters":[{"description":"Flow ID","in":"path","name":"flow_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/flows.FlowAssetsResponse"}}},"description":"Flow assets retrieved successfully"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Flow not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Internal server error"}},"summary":"List Flow assets","tags":["Flows"]}}}}
```

## Upload Flow JSON

> Upload the Flow JSON of a draft Flow, replacing its current screens. Returns the validation errors Meta found; a Flow can only be published once they are resolved.

```json
{"openapi":"3.1.0","info":{"title":"Messaging API","version":"1.50.0"},"tags":[{"name":"Flows","description":"Endpoints for managing WhatsApp Flows"}],"servers":[{"description":"Production server","url":"https://waba-v2.360dialog.io"}],"security":[{"D360-API-KEY":[]}],"components":{"securitySchemes":{"D360-API-KEY":{"description":"API Key for Messaging API authentication. Send your API key in the D360-API-KEY header.","in":"header","name":"D360-API-KEY","type":"apiKey"}},"schemas":{"flows.UploadFlowAssetResponse":{"description":"Response payload for an uploaded Flow JSON","properties":{"success":{"description":"Whether the upload was accepted","type":"boolean"},"validation_errors":{"description":"Validation errors found in the uploaded Flow JSON. The upload succeeds even when this is not empty, but the Flow cannot be published until it is","items":{"$ref":"#/components/schemas/flows.FlowValidationError"},"type":"array","uniqueItems":false}},"type":"object"},"flows.FlowValidationError":{"description":"A validation error reported by Meta for a Flow","properties":{"error":{"description":"Error code","type":"string"},"error_type":{"description":"Error type","type":"string"},"message":{"description":"Human-readable description","type":"string"},"pointer_path":{"description":"Path to the offending element in the Flow JSON","type":"string"}},"type":"object"},"utils.ErrorResp":{"properties":{"error":{"type":"string"}},"type":"object"}}},"paths":{"/flows/{flow_id}/assets":{"post":{"description":"Upload the Flow JSON of a draft Flow, replacing its current screens. Returns the validation errors Meta found; a Flow can only be published once they are resolved.","operationId":"post-flow-asset","parameters":[{"description":"Flow ID","in":"path","name":"flow_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"asset_type":{"description":"Asset type (must be FLOW_JSON)","type":"string"},"file":{"description":"The Flow JSON file. Max 1 MB.","format":"binary","type":"string"},"name":{"description":"Asset name (must be flow.json)","type":"string"}},"required":["name","asset_type","file"],"type":"object"}}},"description":"Asset name (must be flow.json)","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/flows.UploadFlowAssetResponse"}}},"description":"Flow JSON uploaded successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Forbidden"},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Request body too large"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Internal server error"}},"summary":"Upload Flow JSON","tags":["Flows"]}}}}
```

## Deprecate Flow

> Mark a published Flow as deprecated. Deprecated Flows can no longer be sent or opened, and cannot be restored.

```json
{"openapi":"3.1.0","info":{"title":"Messaging API","version":"1.50.0"},"tags":[{"name":"Flows","description":"Endpoints for managing WhatsApp Flows"}],"servers":[{"description":"Production server","url":"https://waba-v2.360dialog.io"}],"security":[{"D360-API-KEY":[]}],"components":{"securitySchemes":{"D360-API-KEY":{"description":"API Key for Messaging API authentication. Send your API key in the D360-API-KEY header.","in":"header","name":"D360-API-KEY","type":"apiKey"}},"schemas":{"flows.DeprecateFlowResponse":{"description":"Response payload for a deprecated WhatsApp Flow","properties":{"success":{"description":"Whether the Flow was deprecated","type":"boolean"}},"type":"object"},"utils.ErrorResp":{"properties":{"error":{"type":"string"}},"type":"object"}}},"paths":{"/flows/{flow_id}/deprecate":{"post":{"description":"Mark a published Flow as deprecated. Deprecated Flows can no longer be sent or opened, and cannot be restored.","operationId":"post-flow-deprecate","parameters":[{"description":"Flow ID","in":"path","name":"flow_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/flows.DeprecateFlowResponse"}}},"description":"Flow deprecated successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Bad request - Flow is not published"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Forbidden"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Internal server error"}},"summary":"Deprecate Flow","tags":["Flows"]}}}}
```

## Get Flow preview link

> Get a shareable, no-login web preview link for a Flow. Meta has no dedicated preview edge: this builds a \`fields=preview\.invalidate(...)\` request on the flow node. Pass \`invalidate=true\` to invalidate the previous link and generate a new one.

```json
{"openapi":"3.1.0","info":{"title":"Messaging API","version":"1.50.0"},"tags":[{"name":"Flows","description":"Endpoints for managing WhatsApp Flows"}],"servers":[{"description":"Production server","url":"https://waba-v2.360dialog.io"}],"security":[{"D360-API-KEY":[]}],"components":{"securitySchemes":{"D360-API-KEY":{"description":"API Key for Messaging API authentication. Send your API key in the D360-API-KEY header.","in":"header","name":"D360-API-KEY","type":"apiKey"}},"schemas":{"flows.GetFlowPreviewResponse":{"description":"Response payload containing a Flow's web preview link","properties":{"id":{"description":"Flow ID","type":"string"},"preview":{"$ref":"#/components/schemas/flows.FlowPreview","description":"The web preview page of the Flow"}},"type":"object"},"flows.FlowPreview":{"description":"Shareable web preview of a Flow","properties":{"expires_at":{"description":"Time when the preview link expires","type":"string"},"preview_url":{"description":"Link to the preview page. Does not require login and can be shared with stakeholders","type":"string"}},"type":"object"},"utils.ErrorResp":{"properties":{"error":{"type":"string"}},"type":"object"}}},"paths":{"/flows/{flow_id}/preview":{"get":{"description":"Get a shareable, no-login web preview link for a Flow. Meta has no dedicated preview edge: this builds a `fields=preview.invalidate(...)` request on the flow node. Pass `invalidate=true` to invalidate the previous link and generate a new one.","operationId":"get-flow-preview","parameters":[{"description":"Flow ID","in":"path","name":"flow_id","required":true,"schema":{"type":"string"}},{"description":"Invalidate the previous preview link and generate a new one","in":"query","name":"invalidate","schema":{"default":false,"type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/flows.GetFlowPreviewResponse"}}},"description":"Preview link retrieved successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Flow not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Internal server error"}},"summary":"Get Flow preview link","tags":["Flows"]}}}}
```

## Publish Flow

> Publish a draft Flow so it can be sent to end users. A published Flow can no longer be edited.

```json
{"openapi":"3.1.0","info":{"title":"Messaging API","version":"1.50.0"},"tags":[{"name":"Flows","description":"Endpoints for managing WhatsApp Flows"}],"servers":[{"description":"Production server","url":"https://waba-v2.360dialog.io"}],"security":[{"D360-API-KEY":[]}],"components":{"securitySchemes":{"D360-API-KEY":{"description":"API Key for Messaging API authentication. Send your API key in the D360-API-KEY header.","in":"header","name":"D360-API-KEY","type":"apiKey"}},"schemas":{"flows.PublishFlowResponse":{"description":"Response payload for a published WhatsApp Flow","properties":{"success":{"description":"Whether the Flow was published","type":"boolean"}},"type":"object"},"utils.ErrorResp":{"properties":{"error":{"type":"string"}},"type":"object"}}},"paths":{"/flows/{flow_id}/publish":{"post":{"description":"Publish a draft Flow so it can be sent to end users. A published Flow can no longer be edited.","operationId":"post-flow-publish","parameters":[{"description":"Flow ID","in":"path","name":"flow_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/flows.PublishFlowResponse"}}},"description":"Flow published successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Bad request - Flow has unresolved validation errors"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Forbidden"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Internal server error"}},"summary":"Publish Flow","tags":["Flows"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.360dialog.com/docs/messaging-api/api-reference/flows.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
