# Update study todo

Edit the title, note, optional whole-hour scheduledAt, WeChat reminder setting, optional site contentRef, or completion status of an exact todo id.

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

## Request parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `title` | string | 否 | title |
| `note` | string | 否 | note |
| `scheduledAt` | string | 否 | scheduledAt |
| `wechatEnabled` | boolean | 否 | wechatEnabled |
| `contentRef` | unknown | 否 | contentRef |
| `status` | string | 否 | status |
| `id` | string | 是 | id |

## Request example

```bash
curl -X POST \
  'https://work.ieltsbuddy.igopx.cn/api/v1/agent/capabilities/ielts_study_todos_update' \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $IELTS_BUDDY_TOKEN" \
  --data '{"id":"00000000-0000-4000-8000-000000000000"}'
```

## Request schema

```json
{
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "note": {
      "type": "string",
      "maxLength": 2000
    },
    "scheduledAt": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
        },
        {
          "type": "null"
        }
      ]
    },
    "wechatEnabled": {
      "type": "boolean"
    },
    "contentRef": {
      "anyOf": [
        {
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "question_part"
                },
                "partId": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "required": [
                "kind",
                "partId"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "mock_paper"
                },
                "paperId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 160
                }
              },
              "required": [
                "kind",
                "paperId"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "courseId": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                },
                "kind": {
                  "type": "string",
                  "const": "course_section"
                },
                "sectionId": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "required": [
                "courseId",
                "kind",
                "sectionId"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "listening_dictation"
                },
                "partId": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "required": [
                "kind",
                "partId"
              ],
              "additionalProperties": false
            }
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "open",
        "done"
      ]
    },
    "id": {
      "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)$"
    }
  },
  "required": [
    "id"
  ],
  "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` | 接口或目标资源不存在 |
