---
title: Resolve Task
description: Resolves a pending task in a chat. Blocks until the model response is complete and returns the resulting message.
docs_index: /docs/llms.txt
lastUpdated: 2026-11-23
badge: "POST"
---

> For an index of all documentation, see [/docs/llms.txt](/docs/llms.txt).

Resolves a pending task in a chat. Blocks until the model response is complete and returns the resulting message.

#### `POST /v2/chats/{chatId}/messages/resolve`

## Usage

```typescript
import { v0 } from 'v0'

const result = await v0.messages.resolve({
  chatId: 'chat_abc123',
  task: {
    type: 'plan-exit-response',
    status: 'approved',
    content: 'Proceed with the implementation.',
  },
})

console.log(result)
```

```bash
curl -X POST "https://api.v0.dev/v2/chats/chat_abc123/messages/resolve"   -H "Authorization: Bearer $V0_API_KEY"   -H "Content-Type: application/json"   -d '{
    "task": {
      "type": "plan-exit-response",
      "status": "approved",
      "content": "Proceed with the implementation."
    }
  }'
```

## API Signature

### Request

#### Path Parameters

- `chatId: string` The unique identifier of the chat.
  - **Minimum length:** 1

#### Request Body

- `task: 'confirmed-steps' | 'plan-exit-response' | 'answered-questions' | 'confirmed-permissions' | 'vercel-connect-setup' | 'vercel-connect-authorization'` The task resolution data. Use this when the chat is waiting for user input on the matching task type.
  - **confirmed-steps** Resolves an integration installation task. The agent asked the user to install integrations, MCP presets, or set environment variables. Send this after provisioning the integration on Vercel.
    - `type: 'confirmed-steps'`
    - `connectedIntegrationNames?: string[]` Names of integrations that were successfully connected (e.g. "Neon"). Pass an empty array to skip.
      - **Maximum items:** 100
    - `connectedNpmRegistryIds?: string[]` **Deprecated.** Deprecated. npm registry connections are no longer supported; this field is accepted for compatibility and ignored.
      - **Maximum items:** 100
    - `connectedMcpPresetNames?: ('Linear' | 'Notion' | 'Context7' | 'Sentry' | 'Zapier' | 'Glean' | 'Hex' | 'Sanity' | 'Granola' | 'PostHog' | 'Contentful' | 'Mobbin' | 'Slack' | 'Nitrosend' | 'Datadog')[]` Names of MCP presets that were connected (e.g. "Linear", "Sentry"). Pass an empty array to skip.
    - `appliedScripts?: string[]` Names of scripts that were applied.
    - `addedEnvVars?: string[]` Names of environment variables that were added.
  - **plan-exit-response** Resolves a plan review task. The agent proposed an implementation plan and is waiting for approval.
    - `type: 'plan-exit-response'`
    - `status: 'approved' | 'rejected' | 'request-changes'` Whether the plan is approved, rejected, or needs changes.
    - `content: string` Feedback or instructions for the agent.
      - **Minimum length:** 1
  - **answered-questions** Resolves a question task. The agent asked the user one or more multiple-choice questions.
    - `type: 'answered-questions'`
    - `answers: object[]` Answers to the questions the agent asked.
      - **Minimum items:** 1
      - `item: object`
        - `questionId: string` The ID of the question being answered.
          - **Minimum length:** 1
        - `questionText: string` The text of the question being answered.
          - **Minimum length:** 1
        - `selectedLabels: string[]` The labels of the selected options. For single-select questions, pass one item.
        - `customText?: string` Free-form text input, used when the user selects "Other" or wants to add context.
          - **Minimum length:** 1
  - **confirmed-permissions** Resolves a permission request task. The agent wants to execute a tool (shell command, script, MCP call) and needs approval. Also used to resolve environment variable prompts.
    - `type: 'confirmed-permissions'`
    - `permissions: object[]` The permissions to grant. Pass the suggestedPermissions from the stopped task.
      - **Minimum items:** 1
      - `item: object`
        - `type: 'ALLOW_DYNAMIC_TOOL_STRICT'`
        - `toolName: string` The name of the tool being permitted.
          - **Minimum length:** 1
        - `input: unknown` The tool call input arguments. Pass the exact input from the stopped task.
        - `toolDisplayName?: string | null` The tool's original human-readable name from the stopped task. Display-only; pass back unchanged. Capped at 100 characters, matching the cap applied when the name is ingested from the server.
        - `taskNameActive?: string | null` Label shown while the tool is running (e.g. "Running migration").
        - `taskNameComplete?: string | null` Label shown after the tool completes (e.g. "Migration complete").
        - `userMessage?: string` Optional message from the user about this permission.
          - **Minimum length:** 1
    - `userMessage?: string` Optional message from the user about the permission grant.
      - **Minimum length:** 1
  - **vercel-connect-setup** Resolves a Vercel Connect setup task. The agent asked the user to complete connector setup in a browser (a `configure_vercel_connect` agent action with `status: "setup-required"`). Complete setup at the action’s `setupUrl`, poll GET /chats/\{chatId}/connect/status until it returns `ready`, then send this task. The server verifies the setup result and attaches the connector; no connector ID is needed. Returns 409 if setup is still pending or failed, or 404 if setup has not started or the request expired.
    - `type: 'vercel-connect-setup'`
  - **vercel-connect-authorization** Resolves a Vercel Connect authorization task (a `configure_vercel_connect` agent action with `status: "authorization-required"`). Sign in at the action's `authorizationUrl`, poll GET /chats/\{chatId}/connect/status until `ready`, then send this task. Returns 409 while authorization is pending or after it failed, 404 if it has not started or expired.
    - `type: 'vercel-connect-authorization'`
- `modelConfiguration?: object` Overrides for the model behavior.
  - `modelId?: 'v0-mini' | 'v0-pro' | 'v0-max' | 'v0-max-fast' | string` Model to use for the generation. Use a v0 model ID, or an [AI Gateway](https://vercel.com/ai-gateway/models) model ID in `creator/model` format. Gateway models must support tool calling and Zero Data Retention, and are subject to team model policy; unsupported IDs are rejected.
  - `imageGenerations?: boolean` Enables image generations to generate up to 5 images per version.

### Response

- `id: string` Unique message identifier.
- `chatId: string` ID of the chat this message belongs to.
- `role: 'user' | 'assistant'` Who produced this message.
- `createdAt: string` ISO timestamp when the message was created.
- `updatedAt: string` ISO timestamp when the message was last updated.
- `content: string` The trailing prose of the message — the agent’s closing summary, or the user’s message text. Empty string when there is no closing prose.
- `parts: ('text' | 'thinking' | 'file-read' | 'file-edit' | 'search' | 'bash' | 'tool-call' | 'agent-action')[]` Ordered list of parts that make up the message. Iterate to render the full narrative including thinking, file operations, tool calls, and prose.
  - **text** A block of text output by the agent.
    - `type: 'text'`
    - `text: string` Markdown prose written by the agent or user.
    - `startedAt?: string` ISO timestamp when this part began.
    - `finishedAt?: string` ISO timestamp when this part completed.
  - **thinking** Extended thinking output by the agent.
    - `type: 'thinking'`
    - `text: string` The agent's reasoning trace.
    - `startedAt?: string` ISO timestamp when this part began.
    - `finishedAt?: string` ISO timestamp when this part completed.
  - **file-read** Files read by the agent.
    - `type: 'file-read'`
    - `paths: string[]` The file paths the agent read in this step.
    - `startedAt?: string` ISO timestamp when this part began.
    - `finishedAt?: string` ISO timestamp when this part completed.
  - **file-edit** The agent created, modified, deleted, renamed, or patched a file.
    - `type: 'file-edit'`
    - `operation: 'create' | 'update' | 'delete' | 'rename' | 'patch'` The type of file edit performed.
    - `path: string` The target file path.
    - `toPath?: string` The new path when operation is "rename".
    - `startedAt?: string` ISO timestamp when this part began.
    - `finishedAt?: string` ISO timestamp when this part completed.
  - **search** The agent searched for something.
    - `type: 'search'`
    - `scope: 'repo' | 'web'` Whether the agent searched the repository or the web.
    - `query: string` The search query.
    - `startedAt?: string` ISO timestamp when this part began.
    - `finishedAt?: string` ISO timestamp when this part completed.
  - **bash** The agent ran a shell command.
    - `type: 'bash'`
    - `command: string` The shell command that was executed.
    - `output?: string` Combined stdout/stderr captured from the terminal. May be empty if the command produced no output.
    - `exitCode?: integer | null` Process exit code, when available. Reserved for future use; currently always omitted.
    - `isDangerous?: boolean` True if the command was flagged as potentially dangerous and required explicit user approval.
    - `timeoutMs?: integer` Command timeout in milliseconds, when configured.
    - `startedAt?: string` ISO timestamp when this part began.
    - `finishedAt?: string` ISO timestamp when this part completed.
  - **tool-call** The agent invoked a tool (MCP, integration, or other dynamic tool). For shell commands, use the "bash" part instead.
    - `type: 'tool-call'`
    - `name: string` The identifier the tool was invoked under. For MCP/integration tools this is a normalized identifier derived from the tool name — prefer `toolDisplayName` for display when present.
    - `toolDisplayName?: string | null` The tool's original human-readable name (an MCP/integration tool's server-side name), when `name` is a normalized identifier. Display-only.
    - `input?: unknown` The arguments passed to the tool. Schema depends on the specific tool.
    - `output?: unknown` The result returned by the tool. Schema depends on the specific tool.
    - `status: 'ok' | 'error'` Whether the tool call succeeded or returned an error.
    - `suggestedPermissions?: object[]` Present when the agent is blocked waiting for you to approve this tool call (for example, running a setup or migration script). Pass these objects back unchanged as the `permissions` of a `confirmed-permissions` task to approve. Omitted once the tool has run.
      - `item: object` A permission the agent is waiting for you to grant. Pass these objects back unchanged as the `permissions` of a `confirmed-permissions` task.
        - `type: 'ALLOW_DYNAMIC_TOOL_STRICT'` Permission grant type.
        - `toolName: string` The tool this permission authorizes.
        - `input?: unknown` The tool input this permission authorizes. Pass back unchanged when resolving.
        - `toolDisplayName?: string | null` The tool's original human-readable name (an MCP/integration tool's server name), when `toolName` is a normalized identifier. Display-only; pass back unchanged.
        - `taskNameActive?: string | null` Internal label for the in-progress task. Pass back unchanged.
        - `taskNameComplete?: string | null` Internal label for the completed task. Pass back unchanged.
        - `userMessage?: string` Optional message associated with the permission.
    - `startedAt?: string` ISO timestamp when this part began.
    - `finishedAt?: string` ISO timestamp when this part completed.
  - **agent-action** A typed escape hatch for agent actions that don’t fit the other part types. Forward-compatible: new action types may appear without API version changes.
    - `type: 'agent-action'`
    - `name: string` Stable identifier for the action (e.g. "generate\_image", "manage\_todos", "diagnostics"). See documentation for the registry of known names.
    - `summary: string` A short human-readable summary of what happened. Always populated so clients can render something even without knowing the action name.
    - `data?: object | object | object | object | object | object | object | object | object | object | object` Structured payload for actions that carry data. Present on `ask_user_questions`, `exit_plan_mode`, `get_or_request_integration`, and `configure_vercel_connect` parts when the agent is waiting on you, and on `show_artifact` and `security_review` parts. Narrow by the part `name`: the presence of `data` alone does not mean the agent is waiting on you. Omitted for actions that do not carry structured data.
      - `questions: object[]` The questions the agent is waiting for answers to. Resolve with an `answered-questions` task.
        - `item: object`
          - `id: string` Question identifier. Pass back as `questionId` when resolving with an `answered-questions` task.
          - `question: string` The full question text.
          - `header: string` Short label for the question.
          - `multiSelect: boolean` Whether more than one option may be selected.
          - `options: object[]` The available answer options.
            - `item: object`
              - `id: string` Option identifier.
              - `label: string` Display label. Pass matching labels back in `selectedLabels` when resolving.
              - `description?: string` Optional longer explanation of the option.
    - `startedAt?: string` ISO timestamp when this part began.
    - `finishedAt?: string` ISO timestamp when this part completed.
- `finishReason: 'stop' | 'length' | 'content-filter' | 'tool-calls' | 'error' | 'other' | null` Why generation ended. Null while the agent is still generating; once non-null, the message is final and safe to consume.
- `filesStatus: 'pending' | 'ready' | 'failed' | null` Whether `GET /chats/{chatId}/files` reflects this assistant message. `pending` while the agent is generating or its changes are still being saved, which can continue for a few seconds after `finishReason` is set; `ready` once they are saved; `failed` if saving them failed, in which case the files are those of the previous version. Null on user messages.
- `restorable: boolean` True when this is an assistant message that produced restorable code and is not the currently active code.
- `attachments?: object[]` Files attached to this message.
  - `item: object`
    - `url: string` URL to the attachment.
    - `name?: string` Original filename, when available.
    - `contentType?: string` MIME type.
    - `size?: integer` Size in bytes.
- `authorId: string | null` ID of the user who authored a user message; null for assistant messages.
- `usage: object` Model identifier, token usage, and credit cost. Token and credit values are zero on user messages and on assistant messages that have not yet generated tokens.
  - `model: string | null` Model identifier used for the assistant message, or null when not applicable or unavailable.
  - `tokens: object` Token counts for this message.
    - `input: number` Prompt input value (non-cached).
    - `output: number` Completion output value.
    - `cacheRead: number` Cache-read input value.
    - `cacheWrite: number` Cache-write input value.
    - `total: number` Sum of input, output, cacheRead, and cacheWrite.
  - `creditsCost: object` Credit cost for this message.
    - `input: number` Prompt input value (non-cached).
    - `output: number` Completion output value.
    - `cacheRead: number` Cache-read input value.
    - `cacheWrite: number` Cache-write input value.
    - `total: number` Sum of input, output, cacheRead, and cacheWrite.

---

For a semantic overview of all documentation, see [/docs/sitemap.md](/docs/sitemap.md)

For an index of all available documentation, see [/docs/llms.txt](/docs/llms.txt)

For agent-facing discovery, including API and MCP surfaces, see [/docs/agents.md](/docs/agents.md)