# Listar cadências

`GET /api/v1/cadences`

Catálogo de cadências do workspace, com funil, etapa e contadores de matrícula. Use o `id` retornado para matricular um negócio.

## 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[].pipelineId` | `string` | Não |  |
| `data[].pipelineSeq` | `integer` | Não |  |
| `data[].pipelineName` | `string` | Não |  |
| `data[].kind` | `string` | Não | entry \| stage_playbook |
| `data[].stageId` | `string` | Não | Aceita null. |
| `data[].stageName` | `string` | Não | Aceita null. |
| `data[].stageColor` | `string` | Não | Aceita null. |
| `data[].name` | `string` | Não |  |
| `data[].description` | `string` | Não | Aceita null. |
| `data[].status` | `string` | Não |  |
| `data[].activeVersion` | `integer` | Não |  |
| `data[].trigger` | `string` | Não | Forma de início da cadência. |
| `data[].stepCount` | `integer` | Não |  |
| `data[].dayCount` | `integer` | Não |  |
| `data[].channels` | `array` | Não |  |
| `data[].steps` | `array` | Não | Atividades da rotina em ordem, com dia, canal e descrição. Presentes na própria listagem para consultar a rotina sem uma requisição de detalhe por cadência. |
| `data[].steps[].id` | `string` | Não |  |
| `data[].steps[].version` | `integer` | Não |  |
| `data[].steps[].dayNumber` | `integer` | Não | Dia da rotina em que a atividade ocorre. |
| `data[].steps[].stepOrder` | `integer` | Não | Ordem da atividade dentro do dia. |
| `data[].steps[].channel` | `string` | Não | Valores: whatsapp, voice_call, email, research. |
| `data[].steps[].quantity` | `integer` | Não |  |
| `data[].steps[].delayMinutes` | `integer` | Não |  |
| `data[].steps[].templateId` | `string` | Não | Aceita null. |
| `data[].steps[].scriptId` | `string` | Não | Aceita null. |
| `data[].steps[].messageRequired` | `boolean` | Não |  |
| `data[].steps[].description` | `string` | Não | Objetivo da atividade para a pessoa responsável pelo atendimento. Aceita null. |
| `data[].steps[].guardrailPrompt` | `string` | Não | Aceita null. |
| `data[].enrolledCount` | `integer` | Não | Aceita null. |
| `data[].overdueCount` | `integer` | Não | Aceita null. |
| `data[].wonCount` | `integer` | Não | Aceita null. |
| `data[].lostCount` | `integer` | Não | Aceita null. |
| `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/CadenceListItem"
      }
    },
    "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"
  ]
}
```

### 403

Autenticado, mas sem acesso: falta de permissão (`FORBIDDEN`), recurso desligado no workspace (`FEATURE_DISABLED`) ou tentativa de acessar uma agenda não permitida.

| 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"
  ]
}
```
