{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/elocuenti-com/json-schema/elocuenti-com-pipelines-response-schema.json",
  "title": "PipelinesResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/elocuenti-com-pipelines-api-openapi.yml#/components/schemas/PipelinesResponse",
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Pipeline"
      },
      "title": "Data"
    },
    "request_id": {
      "type": "string",
      "description": "The identifier of this request. Give it to support if you need help.",
      "title": "Request Id"
    },
    "next_cursor": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Send it as `cursor` to get the next page. `null` on the last page.",
      "title": "Next Cursor"
    },
    "has_more": {
      "type": "boolean",
      "description": "`true` when there is another page.",
      "title": "Has More"
    }
  },
  "required": [
    "data",
    "request_id",
    "next_cursor",
    "has_more"
  ],
  "$defs": {
    "Pipeline": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The identifier of the funnel. Use it as `pipeline_id` to move a conversation.",
          "title": "Id"
        },
        "name": {
          "type": "string",
          "description": "The name of the funnel.",
          "title": "Name"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "What the funnel is for, or `null` if it has no description.",
          "title": "Description"
        },
        "channel": {
          "type": "string",
          "enum": [
            "text",
            "voice"
          ],
          "description": "`text` for chat conversations (WhatsApp, Instagram, Messenger), `voice` for calls.",
          "title": "Channel"
        },
        "is_default": {
          "type": "boolean",
          "description": "`true` for the funnel where new conversations start.",
          "title": "Is Default"
        },
        "is_active": {
          "type": "boolean",
          "description": "`false` for a funnel that was turned off: conversations cannot be moved into it.",
          "title": "Is Active"
        },
        "ai_reply": {
          "type": "string",
          "enum": [
            "inherit",
            "on",
            "off"
          ],
          "description": "Whether the AI answers the conversations of this funnel: `on`, `off`, or `inherit` to follow the business setting.",
          "title": "Ai Reply"
        },
        "stages": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PipelineStage"
          },
          "description": "The stages of the funnel, in order.",
          "title": "Stages"
        }
      },
      "required": [
        "id",
        "name",
        "description",
        "channel",
        "is_default",
        "is_active",
        "ai_reply",
        "stages"
      ],
      "description": "A funnel with its stages.",
      "title": "Pipeline"
    },
    "PipelineCaptureField": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "description": "The identifier of the attribute, the same in every funnel (letters, digits and `_`).",
          "title": "Key"
        },
        "label": {
          "type": "string",
          "description": "The name of the attribute as your team sees it in the dashboard.",
          "title": "Label"
        },
        "type": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "string",
                "number",
                "integer",
                "boolean",
                "date",
                "datetime",
                "enum",
                "media"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "What kind of value it holds. `enum` is one of `options`; `media` is a file the customer sends. `null` when the attribute has no definition in your catalog.",
          "title": "Type"
        },
        "options": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            {
              "type": "null"
            }
          ],
          "description": "The allowed values when `type` is `enum`; `null` otherwise.",
          "title": "Options"
        },
        "required": {
          "type": "boolean",
          "description": "`true` when the stage needs this value to be considered complete; `false` when it is optional.",
          "title": "Required"
        }
      },
      "required": [
        "key",
        "label",
        "type",
        "options",
        "required"
      ],
      "description": "A piece of information the AI asks the customer for in a stage.",
      "title": "PipelineCaptureField"
    },
    "PipelineStage": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The identifier of the stage. Use it as `stage_id` to move a conversation.",
          "title": "Id"
        },
        "name": {
          "type": "string",
          "description": "The name of the stage.",
          "title": "Name"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "What the stage is for, or `null` if it has no description.",
          "title": "Description"
        },
        "order": {
          "type": "integer",
          "description": "Stages come in ascending order of this number. It only sorts them: it can skip values.",
          "title": "Order"
        },
        "type": {
          "type": "string",
          "enum": [
            "initial",
            "qualification",
            "nurture",
            "negotiation",
            "closing",
            "won",
            "lost",
            "in_progress",
            "completed"
          ],
          "description": "The kind of stage, as set in the dashboard.",
          "title": "Type"
        },
        "is_final": {
          "type": "boolean",
          "description": "`true` when the stage ends the funnel (a won or lost sale, for example).",
          "title": "Is Final"
        },
        "capture_fields": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PipelineCaptureField"
          },
          "description": "What the AI asks the customer for in this stage. Empty when the stage captures nothing.",
          "title": "Capture Fields"
        }
      },
      "required": [
        "id",
        "name",
        "description",
        "order",
        "type",
        "is_final",
        "capture_fields"
      ],
      "description": "One stage of a funnel.",
      "title": "PipelineStage"
    }
  }
}