Task Manager

Task Manager · GPT アクション

Todoist API

  • GET /tasksRetrieve a list of tasks
  • POST /tasksCreate a new task
  • POST /tasks/{taskId}Update a specific task
  • DELETE /tasks/{taskId}Delete a specific task
  • POST /tasks/{taskId}/closeClose a specific task
元の API スキーマ
{
  "openapi": "3.0.0",
  "info": {
    "version": "1.0.0",
    "title": "Todoist API",
    "license": {
      "name": "MIT"
    }
  },
  "servers": [
    {
      "url": "https://api.todoist.com/rest/v2"
    }
  ],
  "paths": {
    "/tasks": {
      "get": {
        "summary": "Retrieve a list of tasks",
        "operationId": "getTasks",
        "tags": [
          "tasks"
        ],
        "headers": [
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "description": "Bearer token for authentication",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A list of tasks",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tasks"
                }
              }
            }
          },
          "default": {
            "description": "unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create a new task",
        "operationId": "createTask",
        "tags": [
          "tasks"
        ],
        "headers": [
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "description": "Content type of the request body",
            "schema": {
              "type": "string",
              "default": "application/json"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "description": "Bearer token for authentication",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewTask"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Task created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "default": {
            "description": "unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tasks/{taskId}": {
      "post": {
        "summary": "Update a specific task",
        "operationId": "updateTask",
        "tags": [
          "tasks"
        ],
        "parameters": [
          {
            "name": "taskId",
            "in": "path",
            "required": true,
            "description": "The ID of the task to update",
            "schema": {
              "type": "string"
            }
          }
        ],
        "headers": [
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "description": "Content type of the request body",
            "schema": {
              "type": "string",
              "default": "application/json"
            }
          },
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTask"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Task updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "default": {
            "description": "unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete a specific task",
        "operationId": "deleteTask",
        "tags": [
          "tasks"
        ],
        "parameters": [
          {
            "name": "taskId",
            "in": "path",
            "required": true,
            "description": "The ID of the task to delete",
            "schema": {
              "type": "string"
            }
          }
        ],
        "headers": [
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Task deleted successfully"
          },
          "default": {
            "description": "unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tasks/{taskId}/close": {
      "post": {
        "summary": "Close a specific task",
        "operationId": "closeTask",
        "tags": [
          "tasks"
        ],
        "parameters": [
          {
            "name": "taskId",
            "in": "path",
            "required": true,
            "description": "The ID of the task to close",
            "schema": {
              "type": "string"
            }
          }
        ],
        "headers": [
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Task closed successfully"
          },
          "default": {
            "description": "unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Task": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "assigner_id": {
            "type": "string",
            "nullable": true
          },
          "assignee_id": {
            "type": "string",
            "nullable": true
          },
          "project_id": {
            "type": "string"
          },
          "section_id": {
            "type": "string",
            "nullable": true
          },
          "parent_id": {
            "type": "string",
            "nullable": true
          },
          "order": {
            "type": "integer"
          },
          "content": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "is_completed": {
            "type": "boolean"
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "priority": {
            "type": "integer"
          },
          "comment_count": {
            "type": "integer"
          },
          "creator_id": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "due": {
            "$ref": "#/components/schemas/Due"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "duration": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "Due": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "format": "date"
          },
          "string": {
            "type": "string"
          },
          "lang": {
            "type": "string"
          },
          "is_recurring": {
            "type": "boolean"
          },
          "datetime": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "timezone": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "NewTask": {
        "type": "object",
        "required": [
          "content"
        ],
        "properties": {
          "content": {
            "type": "string"
          },
          "due_string": {
            "type": "string"
          },
          "due_lang": {
            "type": "string"
          },
          "priority": {
            "type": "integer"
          }
        }
      },
      "Tasks": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/Task"
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "format": "int32"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "UpdateTask": {
        "type": "object",
        "properties": {
          "assignee_id": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "due_date": {
            "description": "Specific date in YYYY-MM-DD format relative to user’s timezone.",
            "type": "string"
          },
          "due_datetime": {
            "description": "Specific date and time in RFC3339 format in UTC.",
            "type": "string"
          },
          "due_lang": {
            "description": "2-letter code specifying language in case due_string is not written in English.",
            "type": "string"
          },
          "due_string": {
            "description": "Human defined task due date (e.g., 'next Monday', 'Tomorrow'). Value is set using local (not UTC) time.",
            "type": "string"
          },
          "duration": {
            "description": "A positive integer for the amount of duration_unit the task will take, or null to unset.",
            "type": "integer"
          },
          "duration_unit": {
            "description": "The unit of time that the duration field above represents. Must be either minute or day.",
            "type": "string"
          },
          "labels": {
            "description": "The task's labels (a list of names that may represent either personal or shared labels).",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "priority": {
            "description": "Task priority from 1 (normal) to 4 (urgent).",
            "type": "integer"
          }
        }
      }
    }
  }
}