> For the complete documentation index, see [llms.txt](https://docs.tnid.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tnid.com/api-reference/001_user/012_documents/028__update_user_ai_task.md).

# Update A User AI Task

GraphQL endpoint: `/user`

Updates a task. Existing answers are left as they are; each one keeps the prompt that produced it, so an answer from before the change stays readable. Nothing is run again — use `runUserAiTask` for that.

## Query

```graphql
mutation ($id: ID!, $prompt: String, $name: String, $runOnRoot: Boolean, $folderIds: [ID!], $outputShape: JSON) {
  updateUserAiTask(id: $id, prompt: $prompt, name: $name, runOnRoot: $runOnRoot, folderIds: $folderIds, outputShape: $outputShape) {
    id
    name
    prompt
    runOnRoot
    folders { id name }
    outputShape
  }
}

```

## Variables

```json
{
  "id": "00000000-0000-4000-8000-000000000001",
  "prompt": "Extract the vendor too."
}
```

## Response

```json
{
  "data": {
    "updateUserAiTask": {
      "folders": [],
      "id": "00000000-0000-4000-8000-000000000001",
      "name": "task-0",
      "outputShape": {
        "total": "number"
      },
      "prompt": "Extract the vendor too.",
      "runOnRoot": true
    }
  }
}
```
