---
updatedAt: 2026-10-30T08:42:46.000Z
agentTools:
  projectIndex: https://docs.wati.io/llms.txt
---

# Get sales pipeline

Note:
- From date and to date are in ISO 8601 format of UTC timezone.
- Set agentIds to null or exclude it to include all agents in the results.
- Set stageIds to null or exclude it to include all stages in the results.

### Permissions

For API access tokens and OIDC tokens, satisfy **at least one** of: `api`, `salesanalyticsv3:read`. API access tokens may satisfy a listed scope through the configured scope hierarchy; OIDC tokens are checked against their scope claims. Legacy JWT authentication does not use this scope check. Authentication, role, tenant, and applicable feature or plan checks still apply. For HTTP 403, check the credential type, applicable scopes, roles, and workspace access; 403 does not always mean a missing scope. Authentication/authorization failures do not guarantee a JSON response body.

# OpenAPI definition

```json
{
  "openapi": "3.0.4",
  "info": {
    "title": "WATI API",
    "version": "2.6",
    "description": "Documentation contract version 2.6. Use V3 for supported business operations, adopting its request, response, defaults and pagination. Retain V1/V2 only for the business exceptions listed in Introduction. API route versions are independent of this artifact version.\n\nSend Authorization: Bearer <your-token> with the workspace credential and regional API host. API route version does not select the authentication mechanism. Endpoint scopes, roles, account availability and channel access still apply; consult Authentication and each operation.\n\nChannel support is operation-specific. GET /api/ext/v3/channels lists additional connected channels and may exclude the default WhatsApp number; do not infer full channel coverage or permission to send from discovery alone.\n\nInspect HTTP status and business result separately. Some operations report business failure or partial recipient failure in HTTP 200. Authorization errors may have no JSON body. A 429 can indicate a rate or usage limit. For unknown write outcomes, reconcile state before retrying; do not assume idempotency.\n\nCreate webhook subscriptions through the documented V2 exception or the dashboard, then manage them through V3. Use supported event types for the workspace and distinguish request acceptance from final message delivery.",
    "contact": {
      "name": "WATI Support",
      "url": "https://docs.wati.io"
    }
  },
  "servers": [
    {
      "url": "https://live-mt-server.wati.io",
      "description": "WATI API host. Legacy v1 and v2 endpoints require tenantId in the path; v3 endpoints do not."
    }
  ],
  "tags": [
    {
      "name": "Sales Analytics",
      "description": "Lead stages and sales pipeline data."
    }
  ],
  "paths": {
    "/api/ext/v3/salesAnalytics/pipeline": {
      "post": {
        "tags": [
          "Sales Analytics"
        ],
        "summary": "Get sales pipeline",
        "description": "Note:\n- From date and to date are in ISO 8601 format of UTC timezone.\n- Set agentIds to null or exclude it to include all agents in the results.\n- Set stageIds to null or exclude it to include all stages in the results.\n\n### Permissions\n\nFor API access tokens and OIDC tokens, satisfy **at least one** of: `api`, `salesanalyticsv3:read`. API access tokens may satisfy a listed scope through the configured scope hierarchy; OIDC tokens are checked against their scope claims. Legacy JWT authentication does not use this scope check. Authentication, role, tenant, and applicable feature or plan checks still apply. For HTTP 403, check the credential type, applicable scopes, roles, and workspace access; 403 does not always mean a missing scope. Authentication/authorization failures do not guarantee a JSON response body.",
        "operationId": "SalesAnalytics_GetSalesPipeline",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/GetSalesPipelineRequest"
              },
              "example": {
                "from": "2026-07-07T16:15:38.4377612Z",
                "to": "2026-07-14T16:15:38.4377643Z",
                "agentIds": [
                  "650a26c6f84a9c0dd6ad66e1",
                  "650a26c6f84a9c0dd6ad66e2"
                ],
                "selectedStageIds": [
                  "650a26c6f84a9c0dd6ad66e3",
                  "650a26c6f84a9c0dd6ad66e4"
                ]
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GetSalesPipelineRequest"
              },
              "example": {
                "from": "2026-07-07T16:15:38.4377612Z",
                "to": "2026-07-14T16:15:38.4377643Z",
                "agentIds": [
                  "650a26c6f84a9c0dd6ad66e1",
                  "650a26c6f84a9c0dd6ad66e2"
                ],
                "selectedStageIds": [
                  "650a26c6f84a9c0dd6ad66e3",
                  "650a26c6f84a9c0dd6ad66e4"
                ]
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/GetSalesPipelineRequest"
              },
              "example": {
                "from": "2026-07-07T16:15:38.4377612Z",
                "to": "2026-07-14T16:15:38.4377643Z",
                "agentIds": [
                  "650a26c6f84a9c0dd6ad66e1",
                  "650a26c6f84a9c0dd6ad66e2"
                ],
                "selectedStageIds": [
                  "650a26c6f84a9c0dd6ad66e3",
                  "650a26c6f84a9c0dd6ad66e4"
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/GetSalesPipelineRequest"
              },
              "example": {
                "from": "2026-07-07T16:15:38.4377612Z",
                "to": "2026-07-14T16:15:38.4377643Z",
                "agentIds": [
                  "650a26c6f84a9c0dd6ad66e1",
                  "650a26c6f84a9c0dd6ad66e2"
                ],
                "selectedStageIds": [
                  "650a26c6f84a9c0dd6ad66e3",
                  "650a26c6f84a9c0dd6ad66e4"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the sales pipeline data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetSalesPipelineResponse"
                },
                "example": {
                  "win_rate": 20,
                  "entries": [
                    {
                      "stage": "New Lead",
                      "count": 150
                    },
                    {
                      "stage": "Contacted",
                      "count": 90
                    },
                    {
                      "stage": "Qualified",
                      "count": 80
                    },
                    {
                      "stage": "Proposal",
                      "count": 50
                    },
                    {
                      "stage": "Deal Won",
                      "count": 100
                    },
                    {
                      "stage": "Deal Lost",
                      "count": 30
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidRequestResponse"
                }
              }
            }
          },
          "401": {
            "description": "The request is unauthorized."
          },
          "403": {
            "description": "The request is forbidden. Authorization failed. Check the Permissions section for the credential-specific scope rules, and check roles and workspace access. The response may have no body; do not require a JSON error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenRequestResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Either the rate limit has been exceeded or usage limits have been reached."
          },
          "500": {
            "description": "Unexpected error occurred. Please try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnexpectedErrorResponse"
                }
              }
            }
          }
        },
        "x-wati-permissions": {
          "scopeRequirementGroups": [
            {
              "anyOf": [
                "api",
                "salesanalyticsv3:read"
              ]
            }
          ],
          "groupOperator": "allOf",
          "appliesTo": [
            "ApiAccessToken",
            "OIDC"
          ],
          "legacyJwtScopeCheck": "skipped",
          "apiAccessTokenHierarchy": "configured-by-identity-provider",
          "oidcFallbackWhenNoEndpointScope": null,
          "sourceCommit": "03c6d4bc1590408c569e65602f969c6a596672e3"
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ForbiddenRequestResponse": {
        "required": [
          "code",
          "message"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "description": "The error code associated with the error.",
            "format": "int32"
          },
          "message": {
            "type": "string",
            "description": "The descriptive error message explaining what went wrong.",
            "nullable": true
          },
          "timestamp": {
            "type": "string",
            "description": "The timestamp indicating when the error was recorded.",
            "format": "date-time"
          }
        },
        "additionalProperties": false,
        "description": "Represents the result of a forbidden request, containing error details."
      },
      "GetSalesPipelineRequest": {
        "required": [
          "from",
          "to"
        ],
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "description": "The start date to get the sales pipeline in ISO 8601 format of UTC timezone.",
            "format": "date-time",
            "example": "2025-12-01T00:00:00Z"
          },
          "to": {
            "type": "string",
            "description": "The end date to get the sales pipeline in ISO 8601 format of UTC timezone.",
            "format": "date-time",
            "example": "2025-12-08T23:59:59Z"
          },
          "agentIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The list of agent IDs. Each ID must be a valid ObjectId.\nNote: Set agentIds to null or exclude it to include all agents in the results.",
            "nullable": true
          },
          "selectedStageIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The list of stage IDs to filter.\nNote: Set stageIds to null or exclude it to include all stages in the results.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Request model for getting the sales pipeline."
      },
      "GetSalesPipelineResponse": {
        "type": "object",
        "properties": {
          "win_rate": {
            "type": "number",
            "description": "The overall win rate as a percentage.",
            "format": "double"
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StagePipelineDto"
            },
            "description": "The list of stage pipeline entries.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Response model for getting sales pipeline."
      },
      "InvalidRequestResponse": {
        "required": [
          "code",
          "message"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "description": "The error code associated with the error.",
            "format": "int32"
          },
          "message": {
            "type": "string",
            "description": "The descriptive error message explaining what went wrong.",
            "nullable": true
          },
          "timestamp": {
            "type": "string",
            "description": "The timestamp indicating when the error was recorded.",
            "format": "date-time"
          }
        },
        "additionalProperties": false,
        "description": "Represents the result of a bad request, containing error details."
      },
      "StagePipelineDto": {
        "type": "object",
        "properties": {
          "stage": {
            "type": "string",
            "description": "The name of the stage.",
            "nullable": true
          },
          "count": {
            "type": "integer",
            "description": "The count of leads in this stage.",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "Represents a stage pipeline entry."
      },
      "UnexpectedErrorResponse": {
        "required": [
          "code",
          "message"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "description": "The error code associated with the error.",
            "format": "int32"
          },
          "message": {
            "type": "string",
            "description": "The descriptive error message explaining what went wrong.",
            "nullable": true
          },
          "timestamp": {
            "type": "string",
            "description": "The timestamp indicating when the error was recorded.",
            "format": "date-time"
          }
        },
        "additionalProperties": false,
        "description": "Represents an unexpected error."
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "API token from your WATI Dashboard > API Settings. Pass as `Authorization: Bearer <token>`."
      }
    }
  },
  "security": [
    {
      "BearerAuth": []
    }
  ]
}
```