Skip to main content
The V0 API (/api/conversations) is deprecated and scheduled for removal on April 1, 2026. Please migrate to the V1 API as soon as possible.

Overview

This guide helps you migrate from OpenHands V0 APIs to the new V1 APIs. The V1 API introduces significant architectural improvements including decoupled sandboxes and conversations, better reliability, and enhanced developer experience.

Key Architectural Change

In V1, Conversations and Sandboxes are decoupled. Sandboxes (runtime environments) are managed independently, enabling features like:
  • Pause and resume sandboxes without losing state
  • Sandbox reuse across conversations
  • Independent lifecycle management for better resource control
V1 also introduces two levels of API:
  • App Server API - The main API for managing conversations and sandboxes (focus of this guide)
  • Agent Server API - Fine-grained control of individual runtimes and sandboxes (see Agent Server API section)

Benefits of V1 APIs

ThemeKey Result
Reliability61% reduction in system failures — eliminated entire classes of infrastructure errors
PerformanceLighter-weight runtime with co-located execution — removes inter-pod communication overhead
Developer ExperienceModern API patterns — dedicated search, filtering, batch operations, webhooks, and flexible sandbox controls

Reliability

  • 61% reduction in system-attributable failures — Production data showed V1 reduced errors from 78.0 to 30.0 per 1k conversations
  • Eliminated infrastructure errors — V0’s inter-pod communication caused authentication failures, runtime readiness races, and connection timeouts. V1 eliminates these entirely.
  • Co-located execution model — Removes dependency on inter-pod HTTP communication, eliminating an entire class of failure modes
  • Replay-based recovery — Event-sourced state enables recovery via replay after failures

Performance

  • Lighter-weight agent server — More efficient runtime API reduces resource overhead
  • Decoupled sandboxes and conversations — Independent lifecycle management for better resource control
  • Event-sourced state — One-to-one mapping between execution events and LLM messages enables clean integration, persistence, and replay

Developer Experience

Sandbox Controls
  • Pause and resume sandboxes — Pause when not in use, resume without losing state
  • Explicit status tracking — Clear states (STARTING, RUNNING, PAUSED, ERROR, MISSING)
  • Sandbox specs — Reusable templates with custom commands, environment variables, and working directories
Querying & Filtering
  • Dedicated search endpoints — Enhanced filtering for conversations and events
  • Count endpoints — Get counts without fetching full data
  • Batch get operations — Retrieve multiple items by ID in a single request
  • Enhanced event filtering — Filter by kind, timestamp ranges, with improved pagination
Streaming & Real-time
  • Stream from start — Stream conversation updates from moment of creation
  • Start task tracking — Monitor conversation startup progress
  • Webhook support — Native callbacks for lifecycle events and event stream updates
Export & Portability
  • Conversation export — Download trajectories as zip files
  • Workspace portability — Easier portability across environments

App Server API Endpoint Mapping

The following table maps V0 endpoints to their V1 equivalents, organized by typical workflow order.

Health & Status

OperationV0 EndpointV1 EndpointNotes
Check server healthGET /healthGET /healthNo change
Check if server is aliveGET /aliveGET /aliveNo change
Check if server is readyGET /readyGET /readyNo change

Conversation Lifecycle

OperationV0 EndpointV1 EndpointNotes
Create a new conversationPOST /api/conversationsPOST /api/v1/app-conversationsV1 combines create + start; use stream-start for real-time updates
Start conversation (streaming)POST /api/conversations/{id}/startPOST /api/v1/app-conversations/stream-startV1 supports streaming from start
List/search conversationsGET /api/conversationsGET /api/v1/app-conversations/searchV1 uses dedicated search endpoint
Get conversation by IDGET /api/conversations/{id}GET /api/v1/app-conversationsV1 uses batch get with query params
Get conversation countN/AGET /api/v1/app-conversations/countNew in V1
Update conversationPATCH /api/conversations/{id}PATCH /api/v1/app-conversations/{id}Similar functionality
Stop conversationPOST /api/conversations/{id}/stopN/AIn V1, manage via sandbox pause/resume
Delete conversationDELETE /api/conversations/{id}DELETE /api/v1/app-conversations/{id}V1 conversations tied to sandbox lifecycle

Messaging & Events

OperationV0 EndpointV1 EndpointNotes
Send a messagePOST /api/conversations/{id}/messagesPOST /api/v1/conversation/{id}/eventsV1 uses event-based messaging
Add an eventPOST /api/conversations/{id}/eventsPOST /api/v1/conversation/{id}/eventsDifferent event model in V1
Search/get eventsGET /api/conversations/{id}/eventsGET /api/v1/conversation/{id}/events/searchV1 has dedicated search endpoint with filtering
Get event countN/AGET /api/v1/conversation/{id}/events/countNew in V1
Batch get eventsN/AGET /api/v1/conversation/{id}/eventsNew in V1

File Operations

OperationV0 EndpointV1 EndpointNotes
List files in workspaceGET /api/conversations/{id}/list-filesUse Agent Server APIUse POST /api/bash/execute_bash_command with ls
Read file contentGET /api/conversations/{id}/select-fileUse Agent Server APIV1 uses Agent Server for file operations
Upload filesPOST /api/conversations/{id}/upload-filesUse Agent Server APIUse Agent Server POST /api/file/upload/{path}
Get workspace zipGET /api/conversations/{id}/zip-directoryUse Agent Server APIUse Agent Server GET /api/file/download/{path}

Sandbox Management (New in V1)

OperationEndpointNotes
Create/start a sandboxPOST /api/v1/sandboxesNew: Independent sandbox creation
Search sandboxesGET /api/v1/sandboxes/searchNew: Find existing sandboxes
Get sandboxesGET /api/v1/sandboxesNew: Batch get sandboxes
Pause a sandboxPOST /api/v1/sandboxes/{id}/pauseNew: Suspend sandbox execution
Resume a sandboxPOST /api/v1/sandboxes/{id}/resumeNew: Resume paused sandbox
Delete a sandboxDELETE /api/v1/sandboxes/{id}New: Clean up sandbox resources

Development Tools

OperationV0 EndpointV1 EndpointNotes
Get VSCode URLGET /api/conversations/{id}/vscode-urlN/AV1: Look for VSCODE in sandbox’s exposed_urls
Get web hostsGET /api/conversations/{id}/web-hostsN/AV1: Look for AGENT_SERVER in sandbox’s exposed_urls

Trajectory & Skills

OperationV0 EndpointV1 EndpointNotes
Get trajectoryGET /api/conversations/{id}/trajectoryUse Agent Server APIUse GET /api/file/download-trajectory/{conversation_id}
Get conversation skillsN/AGET /api/v1/app-conversations/{id}/skillsNew in V1

Migration Examples

Creating a Conversation

curl -X POST "https://app.all-hands.dev/api/conversations" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "initial_user_msg": "Check the README.md file",
    "repository": "yourusername/your-repo"
  }'
Response:
{
  "status": "ok",
  "conversation_id": "abc1234"
}

Key Migration Changes

  1. Endpoint URL: /api/conversations/api/v1/app-conversations
  2. Request body structure:
    • repositoryselected_repository
    • initial_user_msg (string) → initial_message (object with content array)
  3. Response handling: V1 returns a start task object with status tracking. The conversation ID is in app_conversation_id (available when status is READY).

Searching Conversations

curl "https://app.all-hands.dev/api/conversations" \
  -H "Authorization: Bearer YOUR_API_KEY"

Managing Sandbox Lifecycle (New in V1)

V1 introduces explicit sandbox management. Here’s how to pause and resume a sandbox:
# Pause a sandbox
curl -X POST "https://app.all-hands.dev/api/v1/sandboxes/{sandbox_id}/pause" \
  -H "Authorization: Bearer YOUR_API_KEY"

# Resume a sandbox
curl -X POST "https://app.all-hands.dev/api/v1/sandboxes/{sandbox_id}/resume" \
  -H "Authorization: Bearer YOUR_API_KEY"

Agent Server API

In addition to the App Server API (app.all-hands.dev), V1 exposes an Agent Server API on each sandbox runtime. This API provides direct access to workspace and conversation operations.

How to Access

  1. Get sandbox info: GET /api/v1/sandboxes?id={sandbox_id}
  2. Find AGENT_SERVER in the exposed_urls field
  3. Use session_api_key as X-Session-API-Key header
  4. Call Agent Server endpoints on that URL
  5. OpenAPI spec available at {agent_server_url}/openapi.json

Available Endpoints

EndpointDescription
POST /api/file/upload/{path}Upload files to workspace
GET /api/file/download/{path}Download individual files
GET /api/file/download-trajectory/{conversation_id}Download conversation trajectory
EndpointDescription
GET /api/git/changes/{path}Get git changes
GET /api/git/diff/{path}Get git diff
EndpointDescription
POST /api/conversations/{conversation_id}/eventsSend user message
GET /api/conversations/{conversation_id}/events/searchSearch events
GET /api/conversations/{conversation_id}/events/countCount events
DELETE /api/conversations/{conversation_id}Delete conversation
POST /api/conversations/{conversation_id}/pausePause conversation
POST /api/conversations/{conversation_id}/runResume/run conversation
POST /api/conversations/{conversation_id}/condenseCondense conversation history
POST /api/conversations/{conversation_id}/generate_titleAuto-generate title
POST /api/conversations/{conversation_id}/confirmation_policySet confirmation policy
POST /api/conversations/{conversation_id}/secretsUpdate conversation secrets
POST /api/conversations/{conversation_id}/security_analyzerSet security analyzer
POST /api/conversations/{conversation_id}/ask_agentAsk agent directly
EndpointDescription
POST /api/bash/execute_bash_commandExecute bash command (blocking)
POST /api/bash/start_bash_commandStart bash command (async)
GET /api/bash/bash_events/searchSearch bash events
EndpointDescription
GET /api/vscode/urlGet VSCode URL
GET /api/vscode/statusCheck VSCode status
GET /api/desktop/urlGet desktop URL
GET /api/tools/List available tools
EndpointDescription
GET /healthHealth check
GET /aliveAlive check
GET /server_infoGet server info
The Agent Server API requires an active/running sandbox. For operations on inactive sandboxes, use the App Server API.

Known Gaps

The following V0 capabilities do not yet have direct V1 App Server REST API equivalents:
GapV0 EndpointWorkaround
Download workspace as zipGET /api/conversations/{id}/zip-directoryUse Agent Server file download endpoints
Get trajectory (inactive runtime)GET /api/conversations/{id}/trajectoryTrajectory available while sandbox is active via Agent Server
List files in workspaceGET /api/conversations/{id}/list-filesUse Agent Server POST /api/bash/execute_bash_command with ls, or Agent SDK workspace.list_files()

Authentication

  • API keys created via /api/keys work for both V0 and V1 App Server APIs
  • Agent Server uses per-sandbox session_api_key with X-Session-API-Key header

Additional Resources