# updateRun

```graphql
mutation UpdateRun($command: RunsUpdateRunCommand!) {
  updateRun(command: $command) {
    id
    runId
    status
    projectId
    target {
      type
      agentKind
      name
      id
    }
    input
    output
    error {
      code
      message
      details
    }
    title
    labels
    parentRunId
    rootRunId
    createdAt
    updatedAt
    startedAt
    finishedAt
    config
    execution {
      id
      timeoutSeconds
      retryLimit
      attempt
      exitCode
      durationMs
      toolErrorCount
      logs
      startMode
    }
    taskId
    conversationId
    inputMessageId
    outputMessageId
    batchId
    trigger {
      type
      id
      name
      toolCallId
      nodeId
    }
    usage {
      funding
      modelCalls
      captureStatus
    }
    descendants {
      total
      active
      hasFailures
    }
    artifacts {
      artifactId
      type
      mediaType
      sizeBytes
      sha256
      href
    }
    metadata
    etag
  }
}
```

Update a run. Requires project.runs.write.

## Arguments

| Name            | Type                       | Required | Description                                                                                                                       |
| --------------- | -------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `command`       | RunsUpdateRunCommand!      | Yes      |                                                                                                                                   |
| `command.runId` | ID!                        | Yes      | Run to update. Conversation-owned runs also require editor access on the conversation. Run-scoped credentials cannot update runs. |
| `command.input` | RunsUpdateRunCommandInput! | Yes      | Update the run title or labels.                                                                                                   |

## Variables

```json
{
  "command": {
    "runId": "string",
    "input": {}
  }
}
```

## Responses

| Status | Description                              |
| ------ | ---------------------------------------- |
| 200    | The RunsVersionedRun! in data.updateRun. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "mutation UpdateRun($command: RunsUpdateRunCommand!) {\n  updateRun(command: $command) {\n    id\n    runId\n    status\n    projectId\n    target {\n      type\n      agentKind\n      name\n      id\n    }\n    input\n    output\n    error {\n      code\n      message\n      details\n    }\n    title\n    labels\n    parentRunId\n    rootRunId\n    createdAt\n    updatedAt\n    startedAt\n    finishedAt\n    config\n    execution {\n      id\n      timeoutSeconds\n      retryLimit\n      attempt\n      exitCode\n      durationMs\n      toolErrorCount\n      logs\n      startMode\n    }\n    taskId\n    conversationId\n    inputMessageId\n    outputMessageId\n    batchId\n    trigger {\n      type\n      id\n      name\n      toolCallId\n      nodeId\n    }\n    usage {\n      funding\n      modelCalls\n      captureStatus\n    }\n    descendants {\n      total\n      active\n      hasFailures\n    }\n    artifacts {\n      artifactId\n      type\n      mediaType\n      sizeBytes\n      sha256\n      href\n    }\n    metadata\n    etag\n  }\n}",
  "variables": {
    "command": {
      "runId": "string",
      "input": {}
    }
  }
}'
```

## Example response

```json
{
  "data": {
    "updateRun": {
      "id": "string",
      "runId": "string",
      "status": "string",
      "projectId": "string",
      "target": {
        "type": "string",
        "agentKind": "string",
        "name": "string",
        "id": "string"
      },
      "input": {},
      "output": {},
      "error": {
        "code": "string",
        "message": "string",
        "details": {}
      },
      "title": "string",
      "labels": {},
      "parentRunId": "string",
      "rootRunId": "string",
      "createdAt": "string",
      "updatedAt": "string",
      "startedAt": "string",
      "finishedAt": "string",
      "config": {},
      "execution": {
        "id": "string",
        "timeoutSeconds": 0,
        "retryLimit": 0,
        "attempt": 0,
        "exitCode": 0,
        "durationMs": 0,
        "toolErrorCount": 0,
        "logs": "string",
        "startMode": "string"
      },
      "taskId": "string",
      "conversationId": "string",
      "inputMessageId": "string",
      "outputMessageId": "string",
      "batchId": "string",
      "trigger": {
        "type": "string",
        "id": "string",
        "name": "string",
        "toolCallId": "string",
        "nodeId": "string"
      },
      "usage": {
        "funding": "string",
        "modelCalls": 0,
        "captureStatus": "string"
      },
      "descendants": {
        "total": 0,
        "active": 0,
        "hasFailures": false
      },
      "artifacts": [
        {
          "artifactId": "string",
          "type": "string",
          "mediaType": "string",
          "sizeBytes": 0,
          "sha256": "string",
          "href": "string"
        }
      ],
      "metadata": {},
      "etag": "string"
    }
  }
}
```
