> ## 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 to-do tasks

Search to-do tasks with filtering and pagination. Task IDs can be found when using `POST /mywork/todo` under the field named 'id'.

Example:

```json
{
    "page": 0,
    "pageSize": 30,
    "remindersFirst": false,
    "sortBy": "doneAt",
    "sortDir": "desc"
}
```

<br />

# 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": {
    "/mywork/todo": {
      "post": {
        "tags": [
          "My Work"
        ],
        "summary": "Search to-do tasks",
        "description": "Search to-do tasks with filtering and pagination. Task IDs can be found when using `POST /mywork/todo` under the field named 'id'.",
        "operationId": "searchMyWorkTodo",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchTodoRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth2": [
              "global:user"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "SearchTodoRequest": {
        "type": "object",
        "description": "Request to search to-do tasks",
        "properties": {
          "page": {
            "type": "integer",
            "format": "int32",
            "description": "Page number (0-based)",
            "example": 0
          },
          "pageSize": {
            "type": "integer",
            "format": "int32",
            "description": "Page size",
            "example": 20
          },
          "sortBy": {
            "type": "string",
            "description": "Sort by field",
            "example": "dueAt"
          },
          "sortDir": {
            "type": "string",
            "description": "Sort direction",
            "example": "ASC"
          },
          "remindersFirst": {
            "type": "boolean",
            "description": "Show reminders first",
            "example": true
          },
          "dueAtStart": {
            "type": "string",
            "description": "Due date start (inclusive)",
            "example": "2024-01-01T00:00:00Z"
          },
          "dueAtEnd": {
            "type": "string",
            "description": "Due date end (exclusive)",
            "example": "2024-12-31T23:59:59Z"
          }
        },
        "required": [
          "remindersFirst",
          "sortBy"
        ]
      }
    },
    "securitySchemes": {
      "oauth2": {
        "type": "oauth2",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://auth.surense.com/authorize",
            "tokenUrl": "https://auth.surense.com/oauth/token",
            "scopes": {
              "openid": "OpenID",
              "profile": "Profile",
              "global:export": "Export"
            }
          }
        }
      }
    }
  }
}
```