---
title: "Flows · Referência REST"
description: "As rotas de Flows. Todo corpo é JSON, e o erro sempre volta como um objeto com código e mensagem."
lang: "pt-BR"
canonical: "https://zaiped.com/developers/docs/reference/flows"
alternate: "https://zaiped.com/en/developers/docs/reference/flows"
---

# Flows · Referência REST

## GET /v1/flows

List WhatsApp Flows

**Resposta (object[])**

- `id` · string (Obrigatório): Zaiped id (flows)
- `name` · string (Obrigatório)
- `categories` · string[] (Obrigatório)
- `status` · "local" | "draft" | "published" | "deprecated" | "blocked" | "throttled" (Obrigatório)
- `metaFlowId` · string
- `flowJson` · string (Obrigatório)
- `validationErrors` · object[]
- `previewUrl` · string
- `responseCount` · number (Obrigatório)
- `updatedAt` · number (Obrigatório)

```
curl -X GET "https://zaiped.com/v1/flows" \
  -H "Authorization: Bearer zp_..."
```

## POST /v1/flows

Create a Flow

**Corpo da requisição**

- `name` · string (Obrigatório)
- `categories` · string[] (Obrigatório)
- `flowJson` · string
- `library` · string
- `lang` · "pt-BR" | "en-US"
- `push` · boolean

**Resposta (object)**

- `id` · string (Obrigatório): Zaiped id (flows)
- `name` · string (Obrigatório)
- `categories` · string[] (Obrigatório)
- `status` · "local" | "draft" | "published" | "deprecated" | "blocked" | "throttled" (Obrigatório)
- `metaFlowId` · string
- `flowJson` · string (Obrigatório)
- `validationErrors` · object[]
- `previewUrl` · string
- `responseCount` · number (Obrigatório)
- `updatedAt` · number (Obrigatório)

```
curl -X POST "https://zaiped.com/v1/flows" \
  -H "Authorization: Bearer zp_..." \
  -H "Content-Type: application/json" \
  -d '{
  "name": "…",
  "categories": []
}'
```

## GET /v1/flows/{flowId}

Get a Flow

**Parâmetros de caminho**

- `flowId` · string (Obrigatório): The flow id, as returned by list_flows.

**Resposta (object)**

- `id` · string (Obrigatório): Zaiped id (flows)
- `name` · string (Obrigatório)
- `categories` · string[] (Obrigatório)
- `status` · "local" | "draft" | "published" | "deprecated" | "blocked" | "throttled" (Obrigatório)
- `metaFlowId` · string
- `flowJson` · string (Obrigatório)
- `validationErrors` · object[]
- `previewUrl` · string
- `responseCount` · number (Obrigatório)
- `updatedAt` · number (Obrigatório)

```
curl -X GET "https://zaiped.com/v1/flows/YOUR_FLOW_ID" \
  -H "Authorization: Bearer zp_..."
```

## PUT /v1/flows/{flowId}

Update a Flow

The JSON of a published flow is immutable at Meta; name and categories still change.

**Parâmetros de caminho**

- `flowId` · string (Obrigatório): The flow id.

**Corpo da requisição**

- `name` · string
- `categories` · string[]
- `flowJson` · string
- `push` · boolean

**Resposta (object)**

- `id` · string (Obrigatório): Zaiped id (flows)
- `name` · string (Obrigatório)
- `categories` · string[] (Obrigatório)
- `status` · "local" | "draft" | "published" | "deprecated" | "blocked" | "throttled" (Obrigatório)
- `metaFlowId` · string
- `flowJson` · string (Obrigatório)
- `validationErrors` · object[]
- `previewUrl` · string
- `responseCount` · number (Obrigatório)
- `updatedAt` · number (Obrigatório)

```
curl -X PUT "https://zaiped.com/v1/flows/YOUR_FLOW_ID" \
  -H "Authorization: Bearer zp_..." \
  -H "Content-Type: application/json" \
  -d '{}'
```

## DELETE /v1/flows/{flowId}

Delete a Flow

**Parâmetros de caminho**

- `flowId` · string (Obrigatório): The flow id.

**Resposta (object)**

- `ok` · true (Obrigatório)

```
curl -X DELETE "https://zaiped.com/v1/flows/YOUR_FLOW_ID" \
  -H "Authorization: Bearer zp_..."
```

## POST /v1/flows/{flowId}/publish

Publish a Flow

Pushes the current JSON, requires zero validation errors and publishes.

**Parâmetros de caminho**

- `flowId` · string (Obrigatório): The flow id.

**Resposta (object)**

- `ok` · true (Obrigatório)

```
curl -X POST "https://zaiped.com/v1/flows/YOUR_FLOW_ID/publish" \
  -H "Authorization: Bearer zp_..."
```

## POST /v1/flows/{flowId}/deprecate

Deprecate a published Flow

**Parâmetros de caminho**

- `flowId` · string (Obrigatório): The flow id.

**Resposta (object)**

- `ok` · true (Obrigatório)

```
curl -X POST "https://zaiped.com/v1/flows/YOUR_FLOW_ID/deprecate" \
  -H "Authorization: Bearer zp_..."
```

## GET /v1/flows/{flowId}/responses

List responses to a Flow

**Parâmetros de caminho**

- `flowId` · string (Obrigatório): The flow id.

**Resposta (object)**

- `rows` · object[] (Obrigatório)
- `truncated` · boolean (Obrigatório)

```
curl -X GET "https://zaiped.com/v1/flows/YOUR_FLOW_ID/responses" \
  -H "Authorization: Bearer zp_..."
```