# Search study todos

Search the shared todo list by exact id, title/note keywords, status or inclusive date range. Return complete pages with hasMore and nextOffset; dates and times use Asia/Shanghai.

- Capability ID: `study_todos.search`
- Operation: `ielts_study_todos_search`
- Category: 学习待办
- Endpoint: `POST /api/v1/agent/capabilities/ielts_study_todos_search`
- Authentication: Bearer Token（通过 /api/v1/agent-bindings 绑定账号）
- Required scopes: study_plans:read
- Side effect: read
- Human documentation: https://ieltsbuddy.igopx.cn/developers/api/ielts_study_todos_search

## Request parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | 否 | Exact todo id, when known. |
| `search` | string | 否 | Literal keywords in the title or note. |
| `status` | string | 否 | status |
| `dateFrom` | string | 否 | dateFrom |
| `dateTo` | string | 否 | dateTo |
| `limit` | number | 否 | limit |
| `offset` | number | 否 | offset |

## Request example

示例用于说明请求结构；资源 ID 必须替换为当前账号检索得到的真实值。写操作只在用户要求时调用。

```bash
curl -X POST \
  'https://work.ieltsbuddy.igopx.cn/api/v1/agent/capabilities/ielts_study_todos_search' \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $IELTS_BUDDY_TOKEN" \
  --data '{"search":"","status":"all","limit":6,"offset":0}'
```

## Request schema

```json
{
  "type": "object",
  "properties": {
    "id": {
      "description": "Exact todo id, when known.",
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "search": {
      "default": "",
      "description": "Literal keywords in the title or note.",
      "type": "string",
      "maxLength": 200
    },
    "status": {
      "default": "all",
      "type": "string",
      "enum": [
        "open",
        "done",
        "all"
      ]
    },
    "dateFrom": {
      "type": "string",
      "format": "date",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
    },
    "dateTo": {
      "type": "string",
      "format": "date",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
    },
    "limit": {
      "default": 6,
      "type": "integer",
      "minimum": 1,
      "maximum": 20
    },
    "offset": {
      "default": 0,
      "type": "integer",
      "minimum": 0,
      "maximum": 100000
    }
  },
  "additionalProperties": false
}
```

## Response envelope

接口结果位于 data；code 为 0 表示调用成功。


```json
{
  "code": 0,
  "data": {},
  "message": "ok"
}
```

## Errors

| HTTP | Code | Meaning |
| --- | --- | --- |
| 400 | `40001` | 请求参数不符合接口契约 |
| 401 | `40101` | 缺少或使用了无效的访问令牌 |
| 403 | `40301` | 访问令牌不包含接口所需权限 |
| 404 | `40401` | 接口或目标资源不存在 |
