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

# Query conversations

Query current conversations within a time range by last customer message time. Results can be limited by the active channel scope; a channel filter does not guarantee complete coverage across all connected channels. With page.size, return a synchronous page (200); without it, create or reuse a durable scan (202). count_only is asynchronous. Query predicates honor current conversation access control. Scan results can reflect state evaluated over time; an accepted scan is not a completed result. The service can reject invalid fields, stale cursors, unavailable evidence, or an idempotency-key conflict. Some query validation and scan-state failures currently return HTTP 500. Inspect the actual status and response body; do not assume every invalid query returns 400 or retry an unchanged request indefinitely.

### Permissions

For API access tokens and OIDC tokens, satisfy **at least one** of: `api`, `conversationsv3:read`, `wati_integration: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. Allowed roles: `DEVELOPER`, `TRIAL`, `ADMINISTRATOR`, `EXTERNAL_ADMINISTRATOR`, `PARTNER_ADMINISTRATOR`, `AI_OPERATOR`, or `API_TOKEN`. A user with `FLEXI_TRIAL` or `FLEXI_PAID` is explicitly denied, even if another listed role is present. A qualifying outstanding invoice can also result in a 403 response.

### Plan availability

Commercial plan policy: synchronous queries are included in Growth, Pro and Business; new asynchronous scans are packaged for Pro and Business. Current query behavior still uses omitted `page.size` to request a scan and returns HTTP 202 with a scan ID. This documentation correction does not introduce a new opt-in parameter or change that request/response contract. Account-specific runtime enforcement may differ; a compatible transition is required before new restrictions affect existing callers. Authentication, roles, scopes and workspace/channel requirements still apply. See [Endpoint availability by plan](https://docs.wati.io/reference/endpoint-availability-by-plan).

# 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": "Conversations",
      "description": "Send messages (text, file, interactive), manage conversation status and operator assignment."
    }
  ],
  "paths": {
    "/api/ext/v3/conversations/query": {
      "post": {
        "summary": "Query conversations",
        "description": "Query current conversations within a time range by last customer message time. Results can be limited by the active channel scope; a channel filter does not guarantee complete coverage across all connected channels. With page.size, return a synchronous page (200); without it, create or reuse a durable scan (202). count_only is asynchronous. Query predicates honor current conversation access control. Scan results can reflect state evaluated over time; an accepted scan is not a completed result. The service can reject invalid fields, stale cursors, unavailable evidence, or an idempotency-key conflict. Some query validation and scan-state failures currently return HTTP 500. Inspect the actual status and response body; do not assume every invalid query returns 400 or retry an unchanged request indefinitely.\n\n### Permissions\n\nFor API access tokens and OIDC tokens, satisfy **at least one** of: `api`, `conversationsv3:read`, `wati_integration: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. Allowed roles: `DEVELOPER`, `TRIAL`, `ADMINISTRATOR`, `EXTERNAL_ADMINISTRATOR`, `PARTNER_ADMINISTRATOR`, `AI_OPERATOR`, or `API_TOKEN`. A user with `FLEXI_TRIAL` or `FLEXI_PAID` is explicitly denied, even if another listed role is present. A qualifying outstanding invoice can also result in a 403 response.\n\n### Plan availability\n\nCommercial plan policy: synchronous queries are included in Growth, Pro and Business; new asynchronous scans are packaged for Pro and Business. Current query behavior still uses omitted `page.size` to request a scan and returns HTTP 202 with a scan ID. This documentation correction does not introduce a new opt-in parameter or change that request/response contract. Account-specific runtime enforcement may differ; a compatible transition is required before new restrictions affect existing callers. Authentication, roles, scopes and workspace/channel requirements still apply. See [Endpoint availability by plan](https://docs.wati.io/reference/endpoint-availability-by-plan).",
        "operationId": "ConversationQuery_Queryconversations",
        "tags": [
          "Conversations"
        ],
        "x-wati-permissions": {
          "scopeRequirementGroups": [
            {
              "anyOf": [
                "api",
                "conversationsv3:read",
                "wati_integration:read"
              ]
            }
          ],
          "groupOperator": "allOf",
          "appliesTo": [
            "ApiAccessToken",
            "OIDC"
          ],
          "legacyJwtScopeCheck": "skipped",
          "apiAccessTokenHierarchy": "configured-by-identity-provider",
          "oidcFallbackWhenNoEndpointScope": null,
          "sourceCommit": "f7d7bef54fc6591851b145b7bdf12ed2c3a2534f"
        },
        "responses": {
          "200": {
            "description": "Synchronous conversation page.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "conversation_id": {
                            "type": "string"
                          },
                          "contact_id": {
                            "type": "string"
                          },
                          "channel": {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "type": {
                                "type": "string"
                              },
                              "business_number": {
                                "type": "string"
                              },
                              "platform_id": {
                                "type": "string"
                              }
                            }
                          },
                          "status": {
                            "type": "string"
                          },
                          "assignee_id": {
                            "type": "string"
                          },
                          "team_ids": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "tags": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "additionalProperties": false,
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                }
                              }
                            }
                          },
                          "assignment": {
                            "type": "string"
                          },
                          "unread": {
                            "type": "boolean"
                          },
                          "last_customer_message_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "seconds_since_last_customer_message": {
                            "type": "integer",
                            "format": "int64"
                          },
                          "reply_state": {
                            "type": "string"
                          },
                          "last_effective_reply_at": {
                            "type": "string",
                            "format": "date-time",
                            "nullable": true
                          },
                          "waiting_seconds": {
                            "type": "integer",
                            "format": "int64",
                            "nullable": true
                          },
                          "inbox_expired": {
                            "type": "boolean"
                          },
                          "session_state": {
                            "type": "string"
                          },
                          "reply_window_expires_at": {
                            "type": "string",
                            "format": "date-time",
                            "nullable": true
                          },
                          "session_basis": {
                            "type": "string"
                          },
                          "evaluated_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "matched_messages": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "additionalProperties": false,
                              "properties": {
                                "message_id": {
                                  "type": "string"
                                },
                                "sent_at": {
                                  "type": "string",
                                  "format": "date-time"
                                },
                                "direction": {
                                  "type": "string"
                                },
                                "type": {
                                  "type": "string"
                                },
                                "text": {
                                  "type": "string"
                                },
                                "content_truncated": {
                                  "type": "boolean"
                                }
                              }
                            }
                          },
                          "matched_messages_truncated": {
                            "type": "boolean"
                          },
                          "context": {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                              "status": {
                                "type": "string"
                              },
                              "messages": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "additionalProperties": false,
                                  "properties": {
                                    "message_id": {
                                      "type": "string"
                                    },
                                    "sent_at": {
                                      "type": "string",
                                      "format": "date-time"
                                    },
                                    "direction": {
                                      "type": "string"
                                    },
                                    "type": {
                                      "type": "string"
                                    },
                                    "text": {
                                      "type": "string"
                                    },
                                    "content_truncated": {
                                      "type": "boolean"
                                    }
                                  }
                                }
                              },
                              "has_more": {
                                "type": "boolean"
                              },
                              "archive_coverage": {
                                "type": "string"
                              },
                              "error_code": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    },
                    "page": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "returned_count": {
                          "type": "integer",
                          "format": "int32"
                        },
                        "has_more": {
                          "type": "boolean"
                        },
                        "next_cursor": {
                          "type": "string"
                        }
                      }
                    },
                    "count": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "status": {
                          "type": "string"
                        },
                        "conversation_count": {
                          "type": "integer",
                          "format": "int64",
                          "nullable": true
                        },
                        "exact": {
                          "type": "boolean"
                        }
                      }
                    },
                    "meta": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "evaluated_at": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "consistency": {
                          "type": "string"
                        },
                        "time_basis": {
                          "type": "string"
                        },
                        "state_basis": {
                          "type": "string"
                        },
                        "reply_policy": {
                          "type": "string"
                        },
                        "bot_replies_count": {
                          "type": "boolean"
                        },
                        "limitations": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "202": {
            "description": "Scan accepted; Retry-After header and Location identify the scan. The scan may still be queued or running.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "scan_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "result_mode": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "started_at": {
                      "type": "string",
                      "format": "date-time",
                      "nullable": true
                    },
                    "completed_at": {
                      "type": "string",
                      "format": "date-time",
                      "nullable": true
                    },
                    "expires_at": {
                      "type": "string",
                      "format": "date-time",
                      "nullable": true
                    },
                    "processed_count": {
                      "type": "integer",
                      "format": "int64"
                    },
                    "matched_count_so_far": {
                      "type": "integer",
                      "format": "int64"
                    },
                    "conversation_count": {
                      "type": "integer",
                      "format": "int64",
                      "nullable": true
                    },
                    "exact": {
                      "type": "boolean"
                    },
                    "context_complete": {
                      "type": "boolean"
                    },
                    "consistency": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "retry_after_seconds": {
                      "type": "integer",
                      "format": "int32"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Malformed request. Some query validation or scan-state failures currently return 500 instead; inspect the actual response."
          },
          "401": {
            "description": "The request is unauthorized."
          },
          "403": {
            "description": "Access denied by credential scopes, role or FLEXI exclusion, workspace permissions, or billing-related restrictions. Dunning can return JSON with an error field; other denials may have no JSON body."
          },
          "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"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional key for asynchronous scan reuse; maximum 128 characters on the asynchronous path.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "Conversation query. Unknown fields are rejected.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "time_range": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "from": {
                        "type": "string"
                      },
                      "to": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "from",
                      "to"
                    ],
                    "description": "UTC or offset timestamps; from is inclusive, to is exclusive."
                  },
                  "filters": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "statuses": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "enum": [
                            "new",
                            "open",
                            "pending",
                            "solved",
                            "expired",
                            "broadcast",
                            "awaiting_response"
                          ],
                          "minLength": 1,
                          "pattern": ".*\\S.*"
                        },
                        "minItems": 1,
                        "maxItems": 100,
                        "nullable": true
                      },
                      "assignee_ids": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "pattern": ".*\\S.*"
                        },
                        "minItems": 1,
                        "maxItems": 100,
                        "nullable": true
                      },
                      "team_ids": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "pattern": ".*\\S.*"
                        },
                        "minItems": 1,
                        "maxItems": 100,
                        "nullable": true
                      },
                      "assignment": {
                        "type": "string",
                        "enum": [
                          "assigned",
                          "unassigned"
                        ]
                      },
                      "channel_types": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "enum": [
                            "whatsapp",
                            "whatsapp_group",
                            "instagram",
                            "messenger",
                            "tiktok",
                            "webchat",
                            "rcs"
                          ],
                          "minLength": 1,
                          "pattern": ".*\\S.*"
                        },
                        "minItems": 1,
                        "maxItems": 100,
                        "nullable": true
                      },
                      "channel_ids": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "pattern": "^(default|[0-9a-fA-F]{24})$"
                        },
                        "minItems": 1,
                        "maxItems": 100,
                        "nullable": true,
                        "description": "Channel IDs are 24-character hexadecimal IDs or default. Omit to use the active channel scope; this does not guarantee all connected channels are covered."
                      },
                      "unread": {
                        "type": "boolean",
                        "nullable": true
                      },
                      "reply_state": {
                        "type": "string",
                        "enum": [
                          "awaiting_business",
                          "replied",
                          "unknown"
                        ]
                      },
                      "min_wait_seconds": {
                        "type": "integer",
                        "format": "int64",
                        "nullable": true,
                        "minimum": 0,
                        "description": "Requires reply_state=awaiting_business when non-null. Minimum 0."
                      },
                      "tags": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "any_of": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "minLength": 1,
                              "pattern": ".*\\S.*"
                            },
                            "description": "Existing tag IDs; all_of and none_of are unsupported.",
                            "minItems": 1,
                            "maxItems": 100
                          }
                        },
                        "required": [
                          "any_of"
                        ],
                        "nullable": true
                      },
                      "inbox_expired": {
                        "type": "boolean",
                        "nullable": true
                      },
                      "session_state": {
                        "type": "string",
                        "enum": [
                          "open",
                          "expired",
                          "not_applicable",
                          "unknown"
                        ]
                      },
                      "message_query": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "text": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 512,
                            "pattern": ".*\\S.*"
                          }
                        },
                        "required": [
                          "text"
                        ],
                        "nullable": true
                      }
                    },
                    "allOf": [
                      {
                        "anyOf": [
                          {
                            "not": {
                              "required": [
                                "min_wait_seconds"
                              ]
                            }
                          },
                          {
                            "properties": {
                              "min_wait_seconds": {
                                "type": "integer",
                                "nullable": true,
                                "enum": [
                                  null
                                ]
                              }
                            }
                          },
                          {
                            "required": [
                              "reply_state"
                            ],
                            "properties": {
                              "reply_state": {
                                "type": "string",
                                "enum": [
                                  "awaiting_business"
                                ]
                              }
                            }
                          }
                        ]
                      }
                    ]
                  },
                  "page": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "size": {
                        "type": "integer",
                        "format": "int32",
                        "nullable": true,
                        "minimum": 1,
                        "maximum": 100
                      },
                      "cursor": {
                        "type": "string"
                      }
                    },
                    "description": "Set size (1–100) for a synchronous page. Omit page.size to start an asynchronous scan.",
                    "nullable": true,
                    "allOf": [
                      {
                        "anyOf": [
                          {
                            "not": {
                              "required": [
                                "cursor"
                              ]
                            }
                          },
                          {
                            "properties": {
                              "cursor": {
                                "type": "string",
                                "enum": [
                                  ""
                                ]
                              }
                            }
                          },
                          {
                            "required": [
                              "size"
                            ],
                            "properties": {
                              "size": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 100
                              }
                            }
                          }
                        ]
                      }
                    ]
                  },
                  "context": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "messages_per_conversation": {
                        "type": "integer",
                        "format": "int32",
                        "minimum": 0,
                        "maximum": 50
                      }
                    }
                  },
                  "count": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "mode": {
                        "type": "string",
                        "enum": [
                          "none",
                          "exact"
                        ]
                      }
                    }
                  },
                  "result_mode": {
                    "type": "string",
                    "enum": [
                      "conversations",
                      "count_only"
                    ]
                  }
                },
                "required": [
                  "time_range"
                ],
                "allOf": [
                  {
                    "anyOf": [
                      {
                        "not": {
                          "required": [
                            "result_mode"
                          ],
                          "properties": {
                            "result_mode": {
                              "type": "string",
                              "enum": [
                                "count_only"
                              ]
                            }
                          }
                        }
                      },
                      {
                        "allOf": [
                          {
                            "anyOf": [
                              {
                                "not": {
                                  "required": [
                                    "page"
                                  ]
                                }
                              },
                              {
                                "properties": {
                                  "page": {
                                    "type": "object",
                                    "nullable": true,
                                    "enum": [
                                      null
                                    ]
                                  }
                                }
                              }
                            ]
                          },
                          {
                            "properties": {
                              "context": {
                                "type": "object",
                                "properties": {
                                  "messages_per_conversation": {
                                    "type": "integer",
                                    "enum": [
                                      0
                                    ]
                                  }
                                }
                              }
                            }
                          }
                        ]
                      }
                    ]
                  }
                ],
                "description": "Unknown fields are rejected. Arrays, when non-null, contain 1–100 nonblank values. A nonempty page.cursor requires page.size. min_wait_seconds requires reply_state=awaiting_business. count_only is asynchronous: omit page and omit context or set messages_per_conversation=0. Time range must include timezone offsets and from must be earlier than to."
              },
              "example": {
                "time_range": {
                  "from": "2026-10-01T00:00:00Z",
                  "to": "2026-10-02T00:00:00Z"
                },
                "filters": {
                  "statuses": [
                    "open"
                  ]
                },
                "page": {
                  "size": 20
                },
                "count": {
                  "mode": "none"
                },
                "result_mode": "conversations"
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "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": []
    }
  ]
}
```