Create Session
Session Management
Create Session
Create a new agent session with a browser environment.
POST
Create Session
Overview
Creates a new session with an agent and browser environment. The session is ready to receive messages and execute tasks.Request
Bearer token for authentication
The agent model to use for this sessionOptions:
agi-0- Full-featured agent (default)agi-0-fast- Faster agent for quick tasks
URL to receive webhook notifications for session lifecycle and task execution events
- Must be a valid HTTP or HTTPS URL
- Maximum length: 2,000 characters
- Must start with
http://orhttps://
Restore session from a specific session’s snapshot
- Provide the UUID of a previously saved session
- The new session will restore from that session’s snapshot
- Takes precedence over
restore_default_environment_from_user_id
Restore session from the user’s default environment snapshot
- Provide your user ID to restore from your default environment
- Creates a session that automatically restores from the default snapshot
- Lower priority than
restore_from_session_id
Enable memory snapshots for faster restoration
true- Uses memory snapshots for faster restoration (default, recommended)false- Uses filesystem snapshots only (slower but more reliable)
Response
Unique identifier (UUID) for the created session
URL to view and interact with the agent’s browser in real-time
The agent model being used
Current session status (typically
ready for new sessions)ISO 8601 timestamp of session creation
Example Requests
Error Responses
Invalid agent name or request parameters
Infrastructure failure or bootstrap error
Use Cases
Quick Research Task
Create a session for one-time research without saving state:Watch Agent Work
Open thevnc_url in your browser to watch the agent navigate and interact with websites in real-time.
With Webhooks
Create a session with webhook notifications for real-time event updates:Restore from Default Snapshot
Create a session that automatically restores from your default environment:Restore from Specific Session
Create a session restoring from a specific session’s snapshot:Best Practices
The
vnc_url is perfect for debugging. Open it in a browser to see exactly what the agent is doing