> ## Documentation Index
> Fetch the complete documentation index at: https://developer.surense.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Search documents

Search documents with filtering and pagination.

Example:

```json
{
    "startRow": 0,
    "endRow": 10,
    "sorts": [
        {
            "dir": "desc",
            "field": "createdDate"
        }
    ],
    "filtersOperator": "and",
    "filters": [
        {
            "field": "typeId",
            "operator": "isAnyOf",
            "value": [
                "5f72bf7a-de42-45e6-bc25-d96cf2512e5d"
            ]
        },
        {
            "field": "name",
            "operator": "contains",
            "value": "בדיקה"
        },
        {
            "field": "customerId",
            "value": "2d037b9f-350d-4069-9a19-99b4f67dbf3a",
            "operator": "equals"
        }
    ]
}
```

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "API",
    "description": "Surense API",
    "termsOfService": "https://static.surense.com/terms.htm",
    "contact": {
      "name": "API Support",
      "email": "contact@surense.com"
    },
    "version": "1"
  },
  "servers": [
    {
      "url": "https://api.surense.com/api/v1",
      "description": "Production"
    }
  ],
  "paths": {
    "/documents/search": {
      "post": {
        "tags": [
          "Documents"
        ],
        "summary": "Search documents",
        "description": "Search documents with filtering and pagination.",
        "operationId": "searchDocuments",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchDocumentsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "FilterDefinition": {
        "type": "object",
        "description": "Filter definition for search criteria",
        "properties": {
          "field": {
            "type": "string",
            "description": "Field name to filter by. Available fields can be fetched using GET /{entity}/fields (e.g., /meetings/fields, /workflows/fields, /leads/fields). The field name is shown under `fieldName`",
            "example": "status"
          },
          "value": {
            "description": "Filter value. Can be a string or an array of values.",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "operator": {
            "type": "string",
            "description": "Filter operator",
            "enum": [
              "inRange",
              "notInRange",
              "greaterThan",
              "lessThan",
              "equals",
              "isAnyOf",
              "isNoneOf",
              "notEquals",
              "isEmpty",
              "greaterThanOrEqual"
            ],
            "example": "equals"
          },
          "list": {
            "type": "boolean"
          }
        },
        "required": [
          "field",
          "operator"
        ]
      },
      "SortDefinition": {
        "type": "object",
        "description": "Sort definition for search results",
        "properties": {
          "field": {
            "type": "string",
            "description": "Field name to sort by. Available fields can be fetched using GET /{entity}/fields (e.g., /meetings/fields, /workflows/fields, /leads/fields). The field name is shown under `fieldName`",
            "example": "name"
          },
          "dir": {
            "type": "string",
            "description": "Sort direction: 'asc' for ascending order, 'desc' for descending order (defaults to 'asc' if not specified)",
            "enum": [
              "asc",
              "desc"
            ],
            "example": "asc"
          }
        },
        "required": [
          "field"
        ]
      },
      "SearchDocumentsRequest": {
        "type": "object",
        "properties": {
          "sorts": {
            "type": "array",
            "description": "List of sort definitions for search results",
            "items": {
              "$ref": "#/components/schemas/SortDefinition"
            }
          },
          "filtersOperator": {
            "type": "string",
            "description": "Operator to combine multiple filters (defaults to 'and' if not specified)",
            "enum": [
              "and",
              "or"
            ],
            "example": "and"
          },
          "filters": {
            "type": "array",
            "description": "List of filter definitions for search criteria",
            "items": {
              "$ref": "#/components/schemas/FilterDefinition"
            }
          },
          "startRow": {
            "type": "integer",
            "format": "int32",
            "description": "Starting row index for pagination (0-based) (defaults to 0 if not specified)",
            "example": 0
          },
          "endRow": {
            "type": "integer",
            "format": "int32",
            "description": "Ending row index for pagination (exclusive). The page size (i.e. endRow - startRow) must be less than or equals 50. (defaults to 50 if not specified)",
            "example": 50
          },
          "includeIndirect": {
            "type": "boolean"
          },
          "includeAppmail": {
            "type": "boolean"
          },
          "excludeReports": {
            "type": "boolean",
            "deprecated": true
          },
          "excludeMeetingSummaries": {
            "type": "boolean",
            "deprecated": true
          }
        }
      }
    }
  }
}
```