# Listar funis

`GET /api/v1/pipelines`

Funis ativos do workspace. Disponível para qualquer chave válida.

## Autenticação

Envie a chave em `Authorization: Bearer pf_live_…`.

## Respostas

### 200

Sucesso

| Campo | Tipo | Obrigatório no objeto | Descrição |
| --- | --- | --- | --- |
| `data` | `array` | Não |  |
| `data[].id` | `string` | Não |  |
| `data[].seq` | `integer` | Não | Número sequencial no workspace usado em `/api/v1/pipelines/{seq}`. |
| `data[].position` | `integer` | Não | Ordem de exibição entre os funis ativos. |
| `data[].name` | `string` | Não |  |
| `data[].description` | `string` | Não | Aceita null. |
| `data[].isDefault` | `boolean` | Não |  |
| `data[].isArchived` | `boolean` | Não |  |
| `data[].exitStageId` | `string` | Não | Aceita null. |
| `data[].pipelineType` | `string` | Não | Derivado de `behaviors`; mantido por compatibilidade. Valores: standard, recurring_clients. |
| `data[].behaviors` | `array` | Não |  |
| `data[].attendanceQueueStageId` | `string` | Não | Aceita null. |
| `data[].stages` | `array` | Não | Etapas em ordem: ativas primeiro, seguidas das etapas finais de ganho e perda. |
| `data[].stages[].id` | `string` | Não | Identificador da etapa usado em `stageId` na API, por exemplo, em `POST /api/v1/deals`. |
| `data[].stages[].seq` | `integer` | Não |  |
| `data[].stages[].order` | `integer` | Não |  |
| `data[].stages[].name` | `string` | Não |  |
| `data[].stages[].color` | `string` | Não |  |
| `data[].stages[].description` | `string` | Não | Condição esperada para o negócio estar nesta etapa. Usada como contexto pela CIA. Aceita null. |
| `data[].stages[].isWon` | `boolean` | Não |  |
| `data[].stages[].isLost` | `boolean` | Não |  |
| `data[].stages[].isRequired` | `boolean` | Não |  |
| `data[].stages[].requiredMilestoneFieldId` | `string` | Não | Aceita null. |
| `data[].stages[].dealCount` | `integer` | Não | Formato: int64. |
| `data[].createdAt` | `string` | Não | Formato: date-time. |
| `data[].updatedAt` | `string` | Não | Formato: date-time. |
| `message` | `string` | Não | Aceita null. |

```json
{
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Pipeline"
      }
    },
    "message": {
      "type": "string",
      "nullable": true
    }
  }
}
```

### 401

Chave ausente, malformada, desconhecida, revogada ou expirada, ou membro emissor inativo.

| Campo | Tipo | Obrigatório no objeto | Descrição |
| --- | --- | --- | --- |
| `error` | `string` | Sim |  |
| `code` | `string` | Sim | Valores: BAD_REQUEST, VALIDATION_ERROR, UNAUTHORIZED, FORBIDDEN, FEATURE_DISABLED, NOT_FOUND, CONFLICT, QUOTA_EXCEEDED, UNPROCESSABLE_ENTITY, INTERNAL_ERROR, SERVICE_UNAVAILABLE. |
| `requestId` | `string` | Sim |  |
| `details` | `string` | Não | Aceita null. |
| `fieldErrors` | `array` | Não | Aceita null. |
| `fieldErrors[].field` | `string` | Não |  |
| `fieldErrors[].message` | `string` | Não |  |

```json
{
  "type": "object",
  "description": "Formato padrão de erro. `details` e `fieldErrors` são omitidos quando ausentes.",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string",
      "enum": [
        "BAD_REQUEST",
        "VALIDATION_ERROR",
        "UNAUTHORIZED",
        "FORBIDDEN",
        "FEATURE_DISABLED",
        "NOT_FOUND",
        "CONFLICT",
        "QUOTA_EXCEEDED",
        "UNPROCESSABLE_ENTITY",
        "INTERNAL_ERROR",
        "SERVICE_UNAVAILABLE"
      ]
    },
    "requestId": {
      "type": "string"
    },
    "details": {
      "type": "string",
      "nullable": true
    },
    "fieldErrors": {
      "type": "array",
      "nullable": true,
      "items": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      }
    }
  },
  "required": [
    "error",
    "code",
    "requestId"
  ]
}
```

### 429

Limite de requisições excedido por workspace ou IP.

| Campo | Tipo | Obrigatório no objeto | Descrição |
| --- | --- | --- | --- |
| `error` | `string` | Sim |  |
| `code` | `string` | Sim | Valores: BAD_REQUEST, VALIDATION_ERROR, UNAUTHORIZED, FORBIDDEN, FEATURE_DISABLED, NOT_FOUND, CONFLICT, QUOTA_EXCEEDED, UNPROCESSABLE_ENTITY, INTERNAL_ERROR, SERVICE_UNAVAILABLE. |
| `requestId` | `string` | Sim |  |
| `details` | `string` | Não | Aceita null. |
| `fieldErrors` | `array` | Não | Aceita null. |
| `fieldErrors[].field` | `string` | Não |  |
| `fieldErrors[].message` | `string` | Não |  |

```json
{
  "type": "object",
  "description": "Formato padrão de erro. `details` e `fieldErrors` são omitidos quando ausentes.",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string",
      "enum": [
        "BAD_REQUEST",
        "VALIDATION_ERROR",
        "UNAUTHORIZED",
        "FORBIDDEN",
        "FEATURE_DISABLED",
        "NOT_FOUND",
        "CONFLICT",
        "QUOTA_EXCEEDED",
        "UNPROCESSABLE_ENTITY",
        "INTERNAL_ERROR",
        "SERVICE_UNAVAILABLE"
      ]
    },
    "requestId": {
      "type": "string"
    },
    "details": {
      "type": "string",
      "nullable": true
    },
    "fieldErrors": {
      "type": "array",
      "nullable": true,
      "items": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      }
    }
  },
  "required": [
    "error",
    "code",
    "requestId"
  ]
}
```
