# Tasks

## List tasks

`GET https://app.italic.com/api/v2/tasks`

Required permission: agent:chat or actions:review. What waits in Tasks in the apps, newest first: runs with drafts to approve or discard, and workflow questions. With agent:chat, chat runs; with actions:review, workflow runs.

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Italic API",
    "version": "2.0.0",
    "description": "Recordings, devices, chat, tasks, workflows, connectors and notifications. Text syncs to Italic; audio stays on the client."
  },
  "servers": [
    {
      "url": "https://app.italic.com/api/v2"
    }
  ],
  "paths": {
    "/tasks": {
      "get": {
        "operationId": "listTasks",
        "summary": "List tasks",
        "tags": [
          "Tasks"
        ],
        "parameters": [],
        "description": "Required permission: agent:chat or actions:review. What waits in Tasks in the apps, newest first: runs with drafts to approve or discard, and workflow questions. With agent:chat, chat runs; with actions:review, workflow runs.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Writes without read permission return an ID and revision only.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for troubleshooting."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunList"
                }
              }
            }
          },
          "default": {
            "description": "Request failed. Errors include a stable code and a readable message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "An API key from Settings → Developers → API keys."
      },
      "accountSession": {
        "type": "http",
        "scheme": "bearer",
        "description": "A signed-in Italic account session. An API key cannot create or revoke keys."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "minLength": 0,
                "maxLength": 100
              },
              "message": {
                "type": "string",
                "minLength": 0,
                "maxLength": 1000
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "error"
        ]
      },
      "Question": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
          },
          "prompt": {
            "type": "string"
          },
          "about": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "recipient",
              "account",
              "text"
            ]
          },
          "choices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "label": {
                  "type": "string"
                },
                "detail": {
                  "type": "string"
                }
              },
              "required": [
                "label"
              ]
            }
          }
        },
        "required": [
          "id",
          "prompt",
          "kind",
          "choices"
        ]
      },
      "Run": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
          },
          "source": {
            "type": "string",
            "enum": [
              "chat",
              "recording"
            ],
            "description": "`recording`: a workflow run a recording started."
          },
          "recordingId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
          },
          "status": {
            "type": "string",
            "enum": [
              "running",
              "awaiting_approval",
              "completed",
              "failed",
              "cancelled"
            ]
          },
          "reply": {
            "type": "string",
            "description": "Italic's answer, in Markdown."
          },
          "error": {
            "type": "string"
          },
          "prompt": {
            "type": "string",
            "description": "Chat runs: what was asked."
          },
          "workflows": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256,
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name"
              ]
            }
          },
          "actions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RunAction"
            }
          },
          "questions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Question"
            }
          },
          "createdAt": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "updatedAt": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "id",
          "source",
          "status",
          "actions",
          "questions",
          "createdAt",
          "updatedAt"
        ]
      },
      "RunAction": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
          },
          "tool": {
            "type": "string",
            "description": "What the draft does: send_email, create_event, create_reminder, trash_email, send_webhook, create_notion_page, send_slack_message, save_to_drive, mcp_call and others."
          },
          "status": {
            "type": "string",
            "enum": [
              "proposed",
              "approved",
              "executing",
              "succeeded",
              "failed",
              "rejected",
              "uncertain"
            ],
            "description": "`proposed`: waiting for approval. `approved`: an iPhone adds it (reminders). `uncertain`: it may or may not have happened."
          },
          "executor": {
            "type": "string",
            "enum": [
              "cloud",
              "device"
            ]
          },
          "args": {
            "type": "object",
            "description": "The draft's fields, as the apps' card shows them."
          },
          "result": {
            "type": "object"
          },
          "link": {
            "type": "string",
            "description": "Opens what a finished action made, such as the sent email."
          },
          "workflowId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
          }
        },
        "required": [
          "id",
          "tool",
          "status",
          "executor",
          "args"
        ]
      },
      "RunList": {
        "type": "object",
        "properties": {
          "runs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Run"
            }
          }
        },
        "required": [
          "runs"
        ]
      }
    }
  }
}
```

## Approve or discard a draft

`POST https://app.italic.com/api/v2/runs/{id}/actions/{actionId}/decision`

Required permission: agent:chat or actions:review. A chat run's draft needs agent:chat; a workflow run's needs actions:review. Approving runs the action (it sends the email, adds the event), checked again as the apps check it: the app must still be on and the fields valid. Approving names the draft's tool. The returned action status says whether it worked.

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Italic API",
    "version": "2.0.0",
    "description": "Recordings, devices, chat, tasks, workflows, connectors and notifications. Text syncs to Italic; audio stays on the client."
  },
  "servers": [
    {
      "url": "https://app.italic.com/api/v2"
    }
  ],
  "paths": {
    "/runs/{id}/actions/{actionId}/decision": {
      "post": {
        "operationId": "decideAction",
        "summary": "Approve or discard a draft",
        "tags": [
          "Tasks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
            }
          },
          {
            "name": "actionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
            }
          }
        ],
        "description": "Required permission: agent:chat or actions:review. A chat run's draft needs agent:chat; a workflow run's needs actions:review. Approving runs the action (it sends the email, adds the event), checked again as the apps check it: the app must still be on and the fields valid. Approving names the draft's tool. The returned action status says whether it worked.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Decision"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. Writes without read permission return an ID and revision only.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for troubleshooting."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunResult"
                }
              }
            }
          },
          "default": {
            "description": "Request failed. Errors include a stable code and a readable message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "An API key from Settings → Developers → API keys."
      },
      "accountSession": {
        "type": "http",
        "scheme": "bearer",
        "description": "A signed-in Italic account session. An API key cannot create or revoke keys."
      }
    },
    "schemas": {
      "Decision": {
        "type": "object",
        "properties": {
          "decision": {
            "type": "string",
            "enum": [
              "approve",
              "reject"
            ]
          },
          "tool": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "The draft's `tool`, as you showed it to the person. Required to approve."
          },
          "args": {
            "type": "object",
            "description": "Edited fields of an email, event or reminder draft, replacing its `args`. Omit to approve it as drafted."
          }
        },
        "required": [
          "decision"
        ],
        "additionalProperties": false
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "minLength": 0,
                "maxLength": 100
              },
              "message": {
                "type": "string",
                "minLength": 0,
                "maxLength": 1000
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "error"
        ]
      },
      "Question": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
          },
          "prompt": {
            "type": "string"
          },
          "about": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "recipient",
              "account",
              "text"
            ]
          },
          "choices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "label": {
                  "type": "string"
                },
                "detail": {
                  "type": "string"
                }
              },
              "required": [
                "label"
              ]
            }
          }
        },
        "required": [
          "id",
          "prompt",
          "kind",
          "choices"
        ]
      },
      "Run": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
          },
          "source": {
            "type": "string",
            "enum": [
              "chat",
              "recording"
            ],
            "description": "`recording`: a workflow run a recording started."
          },
          "recordingId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
          },
          "status": {
            "type": "string",
            "enum": [
              "running",
              "awaiting_approval",
              "completed",
              "failed",
              "cancelled"
            ]
          },
          "reply": {
            "type": "string",
            "description": "Italic's answer, in Markdown."
          },
          "error": {
            "type": "string"
          },
          "prompt": {
            "type": "string",
            "description": "Chat runs: what was asked."
          },
          "workflows": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256,
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name"
              ]
            }
          },
          "actions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RunAction"
            }
          },
          "questions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Question"
            }
          },
          "createdAt": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "updatedAt": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "id",
          "source",
          "status",
          "actions",
          "questions",
          "createdAt",
          "updatedAt"
        ]
      },
      "RunAction": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
          },
          "tool": {
            "type": "string",
            "description": "What the draft does: send_email, create_event, create_reminder, trash_email, send_webhook, create_notion_page, send_slack_message, save_to_drive, mcp_call and others."
          },
          "status": {
            "type": "string",
            "enum": [
              "proposed",
              "approved",
              "executing",
              "succeeded",
              "failed",
              "rejected",
              "uncertain"
            ],
            "description": "`proposed`: waiting for approval. `approved`: an iPhone adds it (reminders). `uncertain`: it may or may not have happened."
          },
          "executor": {
            "type": "string",
            "enum": [
              "cloud",
              "device"
            ]
          },
          "args": {
            "type": "object",
            "description": "The draft's fields, as the apps' card shows them."
          },
          "result": {
            "type": "object"
          },
          "link": {
            "type": "string",
            "description": "Opens what a finished action made, such as the sent email."
          },
          "workflowId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
          }
        },
        "required": [
          "id",
          "tool",
          "status",
          "executor",
          "args"
        ]
      },
      "RunResult": {
        "type": "object",
        "properties": {
          "run": {
            "$ref": "#/components/schemas/Run"
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "run"
        ]
      }
    }
  }
}
```

## Answer a question

`POST https://app.italic.com/api/v2/runs/{id}/questions/{questionId}/answer`

Required permission: agent:chat. Answers a workflow run's question with one of `choice`, `text` or `dismiss`; the rest of its workflow then runs.

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Italic API",
    "version": "2.0.0",
    "description": "Recordings, devices, chat, tasks, workflows, connectors and notifications. Text syncs to Italic; audio stays on the client."
  },
  "servers": [
    {
      "url": "https://app.italic.com/api/v2"
    }
  ],
  "paths": {
    "/runs/{id}/questions/{questionId}/answer": {
      "post": {
        "operationId": "answerQuestion",
        "summary": "Answer a question",
        "tags": [
          "Tasks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
            }
          },
          {
            "name": "questionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
            }
          }
        ],
        "description": "Required permission: agent:chat. Answers a workflow run's question with one of `choice`, `text` or `dismiss`; the rest of its workflow then runs.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Answer"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. Writes without read permission return an ID and revision only.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for troubleshooting."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunResult"
                }
              }
            }
          },
          "default": {
            "description": "Request failed. Errors include a stable code and a readable message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "An API key from Settings → Developers → API keys."
      },
      "accountSession": {
        "type": "http",
        "scheme": "bearer",
        "description": "A signed-in Italic account session. An API key cannot create or revoke keys."
      }
    },
    "schemas": {
      "Answer": {
        "type": "object",
        "properties": {
          "choice": {
            "type": "integer",
            "minimum": 0,
            "maximum": 50,
            "description": "Index of one of the question's choices."
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000,
            "description": "A typed answer. A recipient question needs an email address in it."
          },
          "dismiss": {
            "type": "boolean",
            "description": "true skips the question; the workflow ends there."
          }
        },
        "required": [],
        "additionalProperties": false
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "minLength": 0,
                "maxLength": 100
              },
              "message": {
                "type": "string",
                "minLength": 0,
                "maxLength": 1000
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "error"
        ]
      },
      "Question": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
          },
          "prompt": {
            "type": "string"
          },
          "about": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "recipient",
              "account",
              "text"
            ]
          },
          "choices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "label": {
                  "type": "string"
                },
                "detail": {
                  "type": "string"
                }
              },
              "required": [
                "label"
              ]
            }
          }
        },
        "required": [
          "id",
          "prompt",
          "kind",
          "choices"
        ]
      },
      "Run": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
          },
          "source": {
            "type": "string",
            "enum": [
              "chat",
              "recording"
            ],
            "description": "`recording`: a workflow run a recording started."
          },
          "recordingId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
          },
          "status": {
            "type": "string",
            "enum": [
              "running",
              "awaiting_approval",
              "completed",
              "failed",
              "cancelled"
            ]
          },
          "reply": {
            "type": "string",
            "description": "Italic's answer, in Markdown."
          },
          "error": {
            "type": "string"
          },
          "prompt": {
            "type": "string",
            "description": "Chat runs: what was asked."
          },
          "workflows": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256,
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name"
              ]
            }
          },
          "actions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RunAction"
            }
          },
          "questions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Question"
            }
          },
          "createdAt": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "updatedAt": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "id",
          "source",
          "status",
          "actions",
          "questions",
          "createdAt",
          "updatedAt"
        ]
      },
      "RunAction": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
          },
          "tool": {
            "type": "string",
            "description": "What the draft does: send_email, create_event, create_reminder, trash_email, send_webhook, create_notion_page, send_slack_message, save_to_drive, mcp_call and others."
          },
          "status": {
            "type": "string",
            "enum": [
              "proposed",
              "approved",
              "executing",
              "succeeded",
              "failed",
              "rejected",
              "uncertain"
            ],
            "description": "`proposed`: waiting for approval. `approved`: an iPhone adds it (reminders). `uncertain`: it may or may not have happened."
          },
          "executor": {
            "type": "string",
            "enum": [
              "cloud",
              "device"
            ]
          },
          "args": {
            "type": "object",
            "description": "The draft's fields, as the apps' card shows them."
          },
          "result": {
            "type": "object"
          },
          "link": {
            "type": "string",
            "description": "Opens what a finished action made, such as the sent email."
          },
          "workflowId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
          }
        },
        "required": [
          "id",
          "tool",
          "status",
          "executor",
          "args"
        ]
      },
      "RunResult": {
        "type": "object",
        "properties": {
          "run": {
            "$ref": "#/components/schemas/Run"
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "run"
        ]
      }
    }
  }
}
```
